RDF-TriN3 Implementation

I'm implementing this in RDF-TriN3 and hoping to converge on a stable syntax. RDF-TriN3 implements this on top of an N3 parser, though implementing an RDF-compatible subset on top of a Turtle parser would also be a useful goal.

RDF-TriN3 currently supports the following shorthand extensions to N3:

@import and @profile

@import essentially inlines an external N3, Turtle or Shorthand RDF file into the current file. It parses the file linked to, copies its triples into the current graph, and copies its terms, patterns and prefixes into the current parsing context. It does not alter the current parsing context's base URI. It cannot overwrite the empty prefix. It also adds this triple to the current graph:

<> owl:imports <imported_uri> .

@profile performs a subset of @import. It just copies the terms, patterns and prefixes into the current parsing context. It does not add any triples to the current graph.

Resolution Order

Like @prefix and @base, the last matching rule "wins".

As @base may occur several times in an N3 document, changing the base URI, it is important to note that any patterns and tokens which are defined in terms of a relative URI use the base URI at the time of their definition, not the time of their use. For example: