2

我已将我的 RDF 文件更改为 N3,并在 C# 中使用 dotNetRDF。我可以解析和查询这个 N3 文件。我的问题是如何在我的 N3 文件中添加和删除语句。这是一个示例 N3 语句,我需要在我的 N3 文件中添加和删除这样的语句。

###  http://example.org/Sample#A

:A rdf:type owl:Class ;
   rdfs:subClassOF :B.

这些语句构成了我的层次结构,因此通过添加或删除语句,这些语句应该在正确的位置。

4

1 回答 1

1

The Working with Graphs documentation covers the basics of doing this just via API calls as opposed to using full blown SPARQL Update.

Specifically you will be interested in the Assert() method of an IGraph implementation which is used to add new triples to a graph, the counterpart Retract() method removes triples from a graph.

If you are new to dotNetRDF I would suggest reading through the basic tutorial in our User Guide which starts with the Library Overview

于 2013-08-13T19:03:41.883 回答