[redland-dev] implicit type of rdf:List in Turtle, Raptor
Joshua Shinavier
parcour at gmail.com
Tue Feb 6 01:14:30 UTC 2007
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).
More information about the redland-dev
mailing list