[rdfweb-dev] Suggestions for FOAF model alterations

James Carlyle james.carlyle at takepart.com
Thu Aug 7 12:14:45 UTC 2003


Jonathan

Your suggestions for changes to foaf:phone property are commendable but are
invalid from an RDF perspective.  I would suggest that all extensions to
FOAF are run by the always-available RDF validator at
http://www.w3.org/RDF/Validator/.  It is also easy to see what the XML is
describing in terms of statements, and worth checking that this is what you
want.  I personally _really_ want to keep the RDF model of common FOAF
usage, and it is easy to loose, and once lost, probably impossible to
regain.

> <foaf:Person>
>    <foaf:name>Jonathan Greensted</foaf:name>
>
<foaf:mboxsha1sum>1d353ed24aa4827c34b6c0546e02122d123f1853</foaf:mboxsha1sum
>
>    <foaf:phone foaf:type="mobile">tel:070 9211 9075</foaf:phone>
>    <foaf:phone foaf:type="business">tel:014 8368 5555</foaf:phone>
>    <foaf:weburi>http://www.sentient.co.uk</foaf:weburi>
>    <foaf:imageuri>http://www.sentient.co.uk/Images/me.gif</foaf:imageuri>
> </foaf:Person>

This is not valid RDF.  You cannot qualify a property such as foaf:phone in
the way that you are trying to do, because the RDF parser is looking at
nodes (in this case, Person), and properties (in this case, phone), and the
attributes for a property element are valid only if the property element is
empty
(http://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-property-attributes
-on-property-element)

Your RDF model could be changed, so that the XML looks like:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:foaf="http://purl.org/foaf_somewhere/">
<foaf:Person>
<foaf:phone foaf:type="mobile" foaf:number="070 9211 9075"/>
</foaf:Person>
</rdf:RDF>

This gives an implied untyped node for the phone property, that has a type
property and a number property.  But I am generally against untyped nodes in
FOAF.  Using a Phone node, we would have:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="http://purl.org/foaf_somewhere/">
<Person>
    <contactableBy>
        <Phone>
            <type>mobile</type>
            <number>070 9211 9075</number>
        </Phone>
    </contactableBy>
</Person>
</rdf:RDF>

Although this is longer in XML terms, in RDF terms it is the same as the
previous example:
node --> property --> node --> property*2 --> node
Notice the striping: properties generally start with a lower case name,
nodes start with an uppercase name.

I am happy to help bat some ideas around and check RDF compliance if you
wish.

James
weblog: http://takepart.com




More information about the foaf-dev mailing list