[redland-dev] Parser incorrectly interprets Blank Nodes on reload...

Simon Cross simon at sanbi.ac.za
Mon Jan 24 04:43:59 PST 2005


Hi Brian,

> I am seeing a strange behavior on my model when I
> re-parse it after using the rdfxml serializer.  My
> model has lots of blank node identifiers.  When I
> serialize it to a rdfxml file, I get statements such
> as this related to the blank nodes:
> 
>   <rdf:Description rdf:about="r1r377">
>     <rdf:value>843-218-6669</rdf:value>
>   </rdf:Description>

I think the problem is in the way blank nodes are being serialized, not
in the RDF/XML parsing.  The RDF Primer bit on RDF/XML [1] says:

A blank node is referred to in RDF/XML using an rdf:nodeID attribute,
with a blank node identifier as its value, in places where the URIref of
a resource would otherwise appear. Specifically, a statement with a
blank node as its subject can be written in RDF/XML using an
rdf:Description element with an rdf:nodeID attribute instead of an
rdf:about attribute.

So the correct serialization would be:

  <rdf:Description rdf:nodeID="r1r377">
     <rdf:value>843-218-6669</rdf:value>
  </rdf:Description>

The parser seems to correctly treat the rdf:about as specifying a URI
for a non-blank node.

I've only been playing with RDF for a few weeks so don't take any of
this as gospel. :)

[1] http://www.w3.org/TR/rdf-primer/#rdfxml

Schiavo
Simon



More information about the redland-dev mailing list