Reference Iri Choices

RDF supports different, confusingly-named approaches to resource referencing, each with tradeoffs.

TLDR: Choosing between approaches:

  • Use relative-path relative IRIs for maximum composability when embedding or importing meshes and submeshes
  • Use absolute-path relative IRIs for clearer namespace context and better support for moving submeshes within the same mesh hierarchy
  • Use absolute IRIs only for cross-mesh references
  • Relative and absolute paths both preserve relationships when moving complete meshes between domains

Absolute IRI References

Any IRI that has a scheme (e.g., http:) is an Absolute IRI

This example uses two absolute IRIs, each using the example.com authority:

# In ns/djradon/_ref-flow/_current/djradon_ref.trig
<https://example.com/mesh/ns/djradon> a foaf:Person ;
   rdfs:seeAlso <https://example.com/mesh/ns/djradon/index.html> .

Pros

  • explicit

Cons

  • limits transposability and composability
  • e.g., if you moved mesh hosting away from https://example.com, the foaf:Person and rdfs:seeAlso assertions would still refer to the original references
  • not ideal if you're:
    • making updates
    • working offline

Relative IRIs

Any IRI that lacks a scheme (e.g., http:) is resolved against a base IRI following RFC 3986. Such relative IRI references come in three distinct forms:

  • Network-path reference — begins with //.

  • Absolute-path reference — begins with / but not //.

  • Relative-path reference — does not begin with / or //.

If no base is specified, an inferred base of the requested scheme and authority is used. This behaviour is essential to Semantic Flow Best Practices.

Absolute-Path Relative IRIs

  • maximum composability
# In ns/djradon/_ref/djradon_ref.trig
<> a foaf:Person ;                    # The document itself
   foaf:knows <../alice/> ;           # Another node in the mesh
   rdfs:seeAlso <bio/bio.html> .   # A resource page

Pros

Cons

Absolute-Path Relative IRIs

  • clearer context
    • ../../../ makes eyes swim
  • good intra-mesh transposability
# In ns/djradon/_ref/djradon_ref.trig
<> a foaf:Person ;
   foaf:knows </ns/alice/> ;          # Clear namespace context
   rdfs:seeAlso </ns/djradon/bio/bio.html> .

Pros

Cons


Backlinks