Follow your nose

From OpenOrg
Jump to: navigation, search

RDF Documents

Ideally all the main information required for a service should be available from the same RDF document. Most notably trivial things like rdfs:label and rdf:type.

The normal semantic web approach to finding more information is to:

  1. Resolve the URI to see if it gets more triples
  2. Follow any seeAlso relationships from the URI to see if it gets more triples.

However if you want to explicitly indicate the URL of a source of additional data, that can be useful and save worthless lookups (eg. resolving a seeAlso link, only to end up with a 50Mb PDF document)

To indicate that more triples are available about URI-X use the following pattern. It is assumed that RDF-URL will resolve to a document containing triples in one of following formats: RDF+XML, Turtle, N3, N-Triples. <syntaxhighlight lang="xml">

 <rdf:Description rdf:about="...URI-X...">
   <rdfs:label>the name of the thing for which more data is available</rdfs:label>
   <rdfs:seeAlso rdf:resource="...RDF-URL..." />

 <rdf:Description rdf:about="...RDF-URL...">
   <rdf:type rdf:resource="" />


  • If many URIs all are seeAlso to the same URL then the rdf:type bit is only required once.
  • This pattern is particularly recommended if many URIs from a document all redirect to the same final RDF document.
  • This pattern also allows you to avoid minting your own URIs for things which already have them (eg. UK railway stations), but still provide additional information about them.
  • The class indicates that the URL contains some triples in one of the standard formats.


If your RDF is getting complicated, it's probably time to import it into a SPARQL endpoint. If you provide a link to the SPARQL at the top of an RDF document, then you may omit this pattern and should (if possible) not import these into SPARQL, where they will have no value.

The following predicate should be used to link a document to the relevant endpoint (and also in voID descriptions too)

<syntaxhighlight lang="xml">

   <void:sparqlEndpoint rdf:resource="...URL-of-SPARQL-Endpoint..." />


A SPARQL endpoint should contain a list of its primary datasets and this should be discoverable using the following query:

SELECT ?dataset ?label ?homepage {
  ?dataset <> <URL-OF-SPARQL-ENDPOINT> 
  OPTIONAL { ?dataset <> ?label }
  OPTIONAL { ?dataset <> ?homepage }

(replacing URL-OF-SPARQL-ENDPOINT with the actual URL of the endpoint)