DescribingAPerson
From FOAF
Contents |
[edit] Describing A Person Using FOAF
Having created a MinimalFoafDocument you'll naturally want to add further information that describes yourself further. Or perhaps you're UsingFoafKnows and want to add information about your friend?
Here's a list of the commonly used descriptive properties
* foaf:name -- the (complete) name of the Person * foaf:title -- the title of the Person, e.g. Mr, Mrs, Dr, etc * foaf:firstName -- the persons "first name" * foaf:surname -- the persons surname or family name * foaf:nick -- the persons nick name * foaf:schoolHomepage -- the home page of the persons school * foaf:workplaceHomepage -- the home page of the persons place of work * foaf:workInfoHomepage -- a page describing what the person does at their place of work * foaf:myersBriggs -- a Myers-Briggs classification of the person * foaf:phone -- the persons phone number, specified as a fully qualified international phone number, using the tel: URL scheme * foaf:homepage -- the persons homepage, see also Using foaf:weblog in your FOAF file * foaf:weblog -- the persons weblog
[edit] Example 1
See MinimalFoafDocument for the document skeleton that wraps this fragment:
<foaf:Person> <foaf:name>David Banner</foaf:name> <foaf:title>Mr</foaf:title> <foaf:firstName>David</foaf:firstName> <foaf:surname>Banner</foaf:surname> <foaf:nick>hulk</foaf:nick> <foaf:homepage rdf:resource="http://www.davidbanner.com"/> <foaf:weblog rdf:resource="http://www.davidbanner.com/blog"/> <foaf:schoolHomepage rdf:resource="http://www.mit.edu"/> <foaf:workplaceHomepage rdf:resource="http://www.gamma-rays-r-us.com"/> <foaf:workInfoHomepage rdf:resource="http://www.gamma-rays-r-us.com/~banner/crazy-experiments.html"/> <!-- etc --> </foaf:Person>
[edit] Commentary
This might look more complex, but is very simple in structure. Take care to notice that there are only two kinds of things going on inside the foaf:Person element.
Each sub-element in the XML is, following RDF's striped syntax, a relationship-encoding element. It encodes a relationship between the Person and either something named by URI, or some literal value written as a textual string.
In the markup below, we see:
* things named by URI: foaf:homepage, foaf:mbox, foaf:schoolHomepage, rdfs:seeAlso * things provided as chunks of text: foaf:myersBriggs, foaf:mbox_sha1sum,
The former all use rdf:resource= attributes on the appropriate relationship-encoding XML elements. The latter all provide their values within the enclosing relationship-encoding XML elements.
Note: all the complexity associated with writing RDF/XML comes from generalising this basic structure, to allow for:
* crossreferences to things described elsewhere in the XML element tree (rdf:about/resource/nodeID) * nested RDF descriptions, replacing the self-closing relationship-encoding elements that carry rdf:resource= with elements whose nested contents are basically more of the (potentially nested) same.
[edit] Example 2
<foaf:Person> <foaf:homepage rdf:resource="http://rdfweb.org/people/danbri/"/> <foaf:depiction rdf:resource="http://rdfweb.org/people/danbri/mugshot/danbri-small.jpeg"/> <foaf:myersBriggs>INTP</foaf:myersBriggs> <foaf:mbox rdf:resource="mailto:danbri@rdfweb.org"/> <foaf:mbox rdf:resource="mailto:danbri@w3.org"/> <foaf:mbox rdf:resource="mailto:daniel.brickley@bristol.ac.uk"/> <foaf:mbox_sha1sum>748934f32135cfcf6f8c06e253c53442721e15e7</foaf:mbox_sha1sum> <foaf:mbox_sha1sum>362ce75324396f0aa2d3e5f1246f40bf3bb44401</foaf:mbox_sha1sum> <foaf:mbox_sha1sum>f46850eab07e26c850847d88390530afcfee0711</foaf:mbox_sha1sum> <foaf:workplaceHomepage rdf:resource="http://www.w3.org/People/DanBri/"/> <foaf:schoolHomepage rdf:resource="http://www.westergate.w-sussex.sch.uk/"/> <foaf:schoolHomepage rdf:resource="http://www.bris.ac.uk/"/> <foaf:schoolHomepage rdf:resource="http://www.chichester.ac.uk/"/> <foaf:schoolHomepage rdf:resource="http://www.southdowns.ac.uk/"/> <rdfs:seeAlso rdf:resource="http://rdfweb.org/people/danbri/rdfweb/danbri-foaf.rdf"/> </foaf:Person> <!-- there is a Person (un-named) with a homepage whose URI name is ... and that is represented in the image ... and has a myers briggs classification of ... and several mailboxes identified by URI... and by sha1 hash'ed URI ... and that has a workplace homepage of ... and whose schooling included 4 organisations whose homepages are ... and who is further described in danbri-foaf.rdf --> </foaf:Person>
CategoryTutorial
