Hi,
I created an rdf:list with named list entries, but when I call Model.write
("Turtle") it seems to ignore the names and generates the simple "( ... )"
list syntax. Here's a test program that illustrates the problem:
Model model = ModelFactory.createDefaultModel();
Resource data1 = model.createResource();
data1.addProperty(model.createProperty("http://property"),
"test1");
Resource data2 = model.createResource();
data2.addProperty(model.createProperty("http://property"),
"test2");
Resource listEntry1 = model.createResource("http://test/1");
model.add(listEntry1, RDF.first, data1);
model.add(listEntry1, RDF.rest, RDF.nil);
Resource listEntry2 = model.createResource("http://test/2");
model.add(listEntry2, RDF.first, data2);
model.add(listEntry2, RDF.rest, listEntry1);
Resource root = model.createResource("http://root");
root.addProperty(model.createProperty("http://list"),
listEntry2);
model.write(System.out, "N-TRIPLE");
model.write(System.out, "Turtle");
The output looks like this:
_:AX2dX96d4dd4X3aX12eda6ae213X3aXX2dX7fff <http://property> "test1" .
<http://root> <http://list> <http://test/2> .
<http://test/2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest>
<http://test/1> .
<http://test/2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first>
_:AX2dX96d4dd4X3aX12eda6ae213X3aXX2dX7ffe .
_:AX2dX96d4dd4X3aX12eda6ae213X3aXX2dX7ffe <http://property> "test2" .
<http://test/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
<http://test/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first>
_:AX2dX96d4dd4X3aX12eda6ae213X3aXX2dX7fff .
<http://root>
<http://list> ([ <http://property> "test2"
] [ <http://property> "test1"
]) .
The "N-TRIPLE" output is as expected, but the "Turtle" output has discarded
the entry URIs.
Is this a bug?
Thanks,
Frank