0

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?

4

1 回答 1

1

如果您确实需要显式 ID,则必须使用以下形式的方法:

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

请注意,这并不能保证库不会将其转换为[]N3 输出中的匿名语法,因为这只是一种语法压缩。如果你真的想避免这种语法压缩,你可以Notation3Writer手动创建和配置一个并将CompressionLevel属性设置为低(任何 < 5 都应该停止使用[]

否则,如果您想删除一个匿名的空白节点,您需要制定一些选择标准,以便您找到相关节点,然后基于该节点撤回三元组

于 2011-09-26T08:21:41.353 回答