Search code examples
rdfsesameblank-nodes

Blank nodes with Sesame RDF API


I wonder if it is possible to generate unnamed blank nodes with the Sesame framework. The kind of nodes I am interested in are following (when written as Turtle):

ex:Example 
  ex:somePredicate [
    ex:somePredicate ex:someValue 
  ] .

By using Bnode someBlankNode = factory.createBNode(); I get a blank node with an identifier when I write it out as Turtle (e.g. _:node1amdd67vhx7).

I know there is no other difference between these two kinds than the syntax output. What I really am asking is that is the syntax with [] for Turtle possible with Sesame, or do I have to run it through Jena?


Solution

  • This is not something that's currently supported in Sesame's Turtle writer.

    The reason being that this is almost impossible to do in a streaming writer, especially when there is no guaranteed order in which the statements are presented.

    I'm sure an extension is possible that imposes the necessary ordering and pretty-prints things when it can, but it would break the streaming character of the writer, and it's never been very high-priority (especially since it's just syntactic sugar).