Source for file example1.php
Documentation is available at example1.php
require_once 'XML/FOAF.php';
$foaf->newAgent ('person');
$foaf->setName ('Davey Shafik');
$foaf->setFirstName ('Davey');
$foaf->setSurname ('Shafik');
$foaf->addMbox ('mailto:davey@php.net',TRUE ); // see also: XML_FOAF::setMboxSha1Sum();
$foaf->addHomepage ('http://pixelated-dreams.com/~davey/');
$foaf->addWeblog ('http://pixelated-dreams.com/blog');
$foaf->addImg ('http://pixelated-dreams.com/~davey/me.jpg');
$foaf->addPage ('http://pixelated-dreams.com/~davey/CV','Curriculum Vitae','Davey Shafiks Curriculum Vitae');
$foaf->addPage ('http://www.php-mag.net/itr/online_artikel/psecom,id,484,nodeid,114.html','Sticking The Fork In','Creating Daemons in PHP');
$foaf->addPage ('http://pawscon.com/', 'PHP and Web Standards Conference UK 2004', 'A Conference dedicated to PHP, Web Standards and the Semantic Web');
$foaf->addPhone ('07776293539');
$foaf->addJabberID ('fractured_realities@jabber.org');
$foaf->addTheme ('http://php.net');
$foaf->addOnlineAccount ('Davey','http://freenode.info','http://xmlns.com/foaf/0.1/OnlineChatAccount');
$foaf->addOnlineGamingAccount ('Davey_S','http://www.there.com');
$foaf->addWorkplaceHomepage ('http://www.pawscon.com');
$foaf->addSchoolHomepage ('http://www.nobel.herts.sch.uk/');
$foaf->addInterest ('http://xmlns.com/foaf/0.1/');
$foaf->addFundedBy ('http://synapticmedia.net');
$foaf->addLogo ('http://paws.davey.is-a-geek.com/images/paws.jpg');
$foaf->setBasedNear (52.565475 ,-1.162895 );
$foaf->addDepiction ('http://example.org/depiction/');
$foaf->addDepiction ('http://example.org/depiction/2');
// Content of a <foaf:knows><foaf:Person /></foaf:knows>
$matt->newAgent ('person');
$matt->setName ('Matt McClanahan');
$matt->addNick ('mattmcc');
$matt->addMboxSha1Sum ('0cd5f54daf6aa59d1071ea6bf2973e0171ece606',TRUE );
$matt->addSeeAlso ('http://mmcc.cx/foaf.rdf');
$matt->addJabberID ('mattmcc@jabber.com');
$matt->addOnlineChatAccount ('mattmcc','http://freenode.info','http://xmlns.com/foaf/0.1/OnlineChatAccount');
// Another <foaf:knows><foaf:Person /></foaf:knows>
Although we use another instance of XML_FOAF, we could re-use
the one from above ($matt)
$libby->newAgent ('person');
$libby->setName ('Libby Miller');
$libby->addMbox ('mailto:libby.miller@bristol.ac.uk');
$libby->addSeeAlso ('http://swordfish.rdfweb.org/people/libby/rdfweb/webwho.xrdf');
$mcd->newAgent ('Organization');
$mcd->setName ('McDonalds');
$mcd->addHomepage ('http://www.mcdonalds.com/');
if (!isset ($_GET['xml'])) {
header('Content-Type: text/xml');
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<foaf:name>Davey Shafik</foaf:name>
<foaf:title>Mr</foaf:title>
<foaf:firstName>Davey</foaf:firstName>
<foaf:surname>Shafik</foaf:surname>
<foaf:mbox_sha1sum>26b2e3834d83a5ca3fc81e5a942862f7a2bcb653</foaf:mbox_sha1sum>
<foaf:homepage rdf:resource="http://pixelated-dreams.com/~davey/" />
<foaf:img rdf:resource="http://pixelated-dreams.com/~davey/me.jpg" />
<foaf:Document rdf:about="http://pixelated-dreams.com/~davey/CV/">
<dc:title>Curriculum Vitae</dc:title>
<foaf:phone rdf:resource="tel:07776293539" />
<foaf:workplaceHomepage rdf:resource="http://www.pawscon.com" />
<foaf:schoolHomepage rdf:resource="http://www.nobel.herts.sch.uk/" />
<foaf:interest rdf:resource="http://xmlns.com/foaf/0.1/" />
<geo:Point geo:lat="52.565475" geo:long="-1.162895" />
<foaf:name>Matt McClanahan</foaf:name>
<foaf:nick>mattmcc</foaf:nick>
<foaf:mbox_sha1sum>0cd5f54daf6aa59d1071ea6bf2973e0171ece606</foaf:mbox_sha1sum>
<rdfs:seeAlso rdf:resource="http://mmcc.cx/foaf.rdf" />
<foaf:name>Libby Miller</foaf:name>
<foaf:mbox rdf:resource="mailto:libby.miller@bristol.ac.uk" />
<rdfs:seeAlso rdf:resource="http://swordfish.rdfweb.org/people/libby/rdfweb/webwho.xrdf" />
Documentation generated on Mon, 11 Mar 2019 15:47:54 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|