[redland-dev] implicit type of rdf:List in Turtle, Raptor

Dave Beckett dave at dajobe.org
Sun Feb 11 18:45:50 UTC 2007

Joshua Shinavier wrote:
> This is primarily a question about Turtle; I hope it is not off-topic
> here.  In parsing a Turtle list with Raptor, I noticed that the
> resulting graph is not typed.  That is to say, each element in the
> list has an rdf:first and rdf:rest edge but no rdf:type edge.  Looking
> at the Turtle spec, this is exactly what is supposed to happen, but I
> run into a problem when I feed the List to an application (Simile
> Exhibit's JSON writer) which expects resources / blank nodes to be
> explicitly typed.  For occasions like this, it would be nice if a list
> expression like
>     :a :b ( "apple" "banana" ) .
> were interpreted as
>     :a :b
>     [ rdf:type rdf:List ;
>     rdf:first "apple";
>     rdf:rest [ rdf:type rdf:List ;
>         rdf:first "banana";
>         rdf:rest rdf:nil ]
>     ] .
> instead of
>     :a :b
>     [ rdf:first "apple";
>     rdf:rest [ rdf:first "banana";
>         rdf:rest rdf:nil ]
>     ] .
> so the object has an obvious type which matches up with the
> rdfs:domain and rdfs:range of its rdf:first and rdf:rest edges,
> respectively.  Was omitting them a conscious decision to cut down on
> excess statements?  After all, you might expect a clever application
> to be able to infer them if they are important (above, from the
> rdfs:domain of :b).

Since I edited the RDF/XML spec, wrote Turtle and am the main
author of Redland, I feel uniquely overqualified to answer this
question :)

The rdf:List triple was removed from the RDF/XML spec before
the final version, and should not be generated by an RDF collection.
Any software that is relying on it, is out of date.


and output ntriples:http://www.w3.org/TR/rdf-syntax-grammar/example19.nt

... which incidently, were made with Raptor back in 2004


More information about the redland-dev mailing list