Question

I create a blankNode like this code using dotNetRDF

BlankNode ddd = k.CreateBlankNode();

and then assert it in a n3 file but when I open the n3 file by notpad it show this blankNode like []. How can I create a blankNode ID by myself to then delete this?

delete a node or triple using dotenetrdf librery?

Was it helpful?

Solution

If you really need an explicit ID then you must use the following form of the method:

IBlankNode bnode = g.CreateBlankNode("id");

Note that this does not guarantee that the library won't convert it to the anonymous syntax [] in the N3 output as this is simply a syntax compression. If you really want to avoid this syntax compression you can create and configure a Notation3Writer manually and set the CompressionLevel property to be low (anything < 5 should stop the use of [])

Otherwise if you want to delete an anonynmous blank node this you need to formulate some selection criteria that will allow you to locate the relevant node and then retract triples based upon that

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top