My RDF Style

I've realised that I'm unconciously using a subset of the RDF/XML serialization syntax. My mind must have read the spec, absorbed shedloads of RDF over the years and filtered out all the bits that aren't immediately useful. Now that we're all fired up about the syntax issues it might be prudent to write them down. So here are my informal style rules for writing RDF/XML:

  • Do use typed nodes (rss:channel, foaf:Person) - makes the RDF so much more readable.
  • Do use anonymous nodes - assigning a URI is making a long term commitment.
  • Do use xml:lang - we're using XML for a reason
  • Do use rdf:about instead of rdf:ID - keeps the notation simpler.
  • Do use rdfs:seeAlso, but give some other properties too - let people know where to find out more, but give them something now.
  • Don't write properties as attributes unless you're hiding RDF in XHTML - it's inconsistent.
  • Don't use collections - their semantics have been removed away anyway
  • Don't use rdf:parseType - it's for squeezing random stuff into RDF
  • Don't use rdf:datatype - maybe can you use a resource instead of a literal?

Using these rule would lead me to write the example from the RDF spec as the following. Note I've introduced another vocabulary to remove those rdf:Descriptions.

<rdf:RDF xmlns:rdf=""

  <foaf:Document rdf:about="">
    <dc:title>RDF/XML Syntax Specification (Revised)</dc:title>
        <ex:fullName>Dave Beckett</ex:fullName>
        <ex:homePage rdf:resource="" />


Other posts tagged as rdf

Earlier Posts