[Activerdf] RDF Container processing -- Correction

Lee Feigenbaum feigenbl at us.ibm.com
Thu Apr 5 21:10:44 IST 2007


Benno Blumenthal wrote on 04/05/2007 03:54:46 PM:

> I need to correct my SPARQL grammer.
> 
> Benno Blumenthal wrote:
> 
> >
> >
> > SELECT DISTINCT ?o WHERE { 
> > <http://iri.columbia.edu/~benno/rdflist.owl#anOwner> 
> > <http://iri.columbia.edu/~benno/rdflist.owl#hasList> [] rdf:rest [] 
> > rdf:rest [] rdf:first ?o . }
> >
> 
> which is an legal abbreviation in SeRQL, not SPARQL.  So I need to write
> 
> 
> SELECT DISTINCT ?o WHERE {
> <http://iri.columbia.edu/~benno/rdflist.owl#anOwner> 
> <http://iri.columbia.edu/~benno/rdflist.owl#hasList> ?b1 .
> ?b1 rdf:rest ?b2 .
> ?b2 rdf:rest ?b3.
> ?b3 rdf:first ?o . }

A shortened version in SPARQL would read as:

PREFIX : <http://iri.columbia.edu/~benno/rdflist.owl#> 
PREFIX rdf: <...>
SELECT DISTINCT ?o WHERE {
  :anOwner :hasList [ rdf:rest [ rdf:rest [ rdf:first ?o ] ] ]
}

Lee



More information about the ActiveRDF mailing list