Re: SPIN Syntax simplified

On Fri, 2013-02-01 at 09:59 +1000, Holger Knublauch wrote:
> On 2/1/2013 9:33, David Booth wrote:
> > Hi Holger,
> >
> > On Fri, 2013-02-01 at 08:22 +1000, Holger Knublauch wrote:
> >> Hi David,
> >>
> >> the prefixes from the surrounding graph should be used for parsing. In a
> >> typical application, SPIN rules would be loaded from a file at start-up
> >> time and then those prefixes are readily available.
> > That is convenient, but the downside is that it requires the RDF parser
> > to have special knowledge of SPIN.
> 
> I don't think so. The RDF parser simply loads this into a string 
> literal. Only the SPIN engines would parse those literals for execution. 
> I may misunderstand your comment.

If prefixes are never re-defined then the SPIN engine only needs to know
the set of prefix definitions, so if the parser can supply them after
parsing, then that would work fine.  But Turtle allows prefixes to be
re-defined:
http://www.w3.org/TR/turtle/#prefixed-name
so that means that the same prefix could be bound to different URIs at
different points, in which case the parser would have to know about SPIN
in order to properly expand the prefix in """... ex:grandParent ...""".

This may be an edge case, depending on one's usage style.  Personally, I
would not advocate redefining prefixes, but I seem to remember that
there was a good reason for permitting redefinition, though perhaps in
hindsight it was a mistake.  Fortunately, an ambiguous definition would
be easy to detect, so I think it is a minor issue.

> 
> > Another possible approach that would avoid the need for the parser to 
> > have special knowledge of SPIN would be to allow the prefixes to be 
> > explicitly asserted at the triple level, such as: @prefix ex: 
> > <http://example/def#> . ex: spin:globalPrefix "ex:" . or equivalently: 
> > <http://example/def#> spin:globalPrefix "ex:" .
> 
> Yes, storing prefixes as triples may be a useful extension to RDF 
> anyway, independent of SPIN. 

Yes, I think it would be good to standardize that.  Parsers often keep
track of the namespace prefixes, along with some other metadata such as
filename or URI of the RDF source.  It would be nice to have a standard
way to access such information from within RDF or SPARQL.  

David

> For example, they could be attached to the 
> owl:Ontology instance of the graph. But that's a larger change, and I 
> don't understand why it would be critical at this stage.
> 
> Cheers,
> Holger
> 
> 
> 
> 

-- 
David Booth, Ph.D.
http://dbooth.org/

Aaron's Law, in memory of Web prodigy and open information 
advocate Aaron Swartz: http://bit.ly/USR4rx 

Opinions expressed herein are my own and do not necessarily 
reflect those of my employer.

Received on Friday, 1 February 2013 15:28:16 UTC