W3C home > Mailing lists > Public > w3c-rdfcore-wg@w3.org > July 2001

N-Triples: Naming anonnodes

From: Aaron Swartz <me@aaronsw.com>
Date: Sat, 21 Jul 2001 22:27:10 -0500
Message-Id: <200107220330.f6M3UUF05968@theinfo.org>
To: w3c-rdfcore-wg@w3.org
To be quite honest I'm getting a bit tired of arguing over the 
N-Triples syntax, but I thought I'd throw this out there.

Today I came up with the idea that we could define anonymous 
nodes as having a special representation in the abstract syntax, 
but define the N-Triples conversion from RDF as having a 
well-defined set of names for them. IOW, an algorithm such as 
the one used by SiRPAC or CARA to generate anonymous nodes in 
order could be specified somehow (using XSLT, for example), and 
all RDF/XML parsers which outputted N-Triples could follow this 
specification. That way, comparison of N-Triples documents could 
be reduced to a simple sort/diff operation, while still 
retaining the semantics of anonymous nodes.

An example:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description>
   <rdf:value>foo</rdf:value>
</rdf:Description>
</rdf:RDF>

could be unambiguously defined as:

_:g0 rdf:value "foo" .

as parsers would use anonymous node names in the form of _:gn 
where n begins at zero and increments for each anonymous node 
reached in the XML.

Obviously this wouldn't work for N-Triples output from a data in 
which ordering information had been lost (I have some ideas on 
that one too, but they are less formed) but it would work for 
any RDF/XML -> N-Triples conversion.

Another option would be to use the number of the element from 
which the anonymous node occurs. In this case the number would 
be 2, as the <rdf:Description> is the second element in the 
document.

This seems to give the best of both worlds.

Thoughts?

--
       "Aaron Swartz"      |           Blogspace
  <mailto:me@aaronsw.com>  |  <http://blogspace.com/about/>
<http://www.aaronsw.com/> |     weaving the two-way web
Received on Saturday, 21 July 2001 23:27:12 EDT

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 09:38:13 EDT