dotNetRdf中是否有任何类可将本体上传到远程服务器中?

问题描述 投票:0回答:1

我正在开发.Net API,并在dotNetRdf库的帮助下将其与RDF Triple Store连接。我能够从远程服务成功加载数据并查询rdf数据。 dotNetRdf是否支持将ttl文件加载到远程服务中?我正在尝试实时更新本体,而无需手动进行。

.net rdf triplestore dotnetrdf
1个回答
0
投票

取决于所连接的商店,您应该能够使用dotNetRDF's Triple Store integration更新远程服务器。特别是,您应该能够使用UpdateGraph方法在TTL文件中添加三元组(或者,如果您想完全覆盖服务器上的数据,则可以使用SaveGraph方法请谨慎!) 。

您可以看到受支持的三元商店集成here的列表。请注意,它包含一个支持SPARQL Graph Store Protocol的集成,即使未明确列出,该集成也可能覆盖正在连接的服务器。

顺便说一句,如果您决定使用UpdateGraph方法,则不必像示例中所示那样手动创建图形,而是可以将TTL文件加载到图形中,然后使用来更新远程服务器。编写类似这样的代码:

// Create a Graph and fill it with data we want to save
Graph g = new Graph();
g.LoadFromFile("data.ttl");

// Write triples from IGraph instance g into the named graph 
// http://example.org/graph on the remote store
remoteStore.UpdateGraph("http://example.org/graph", g.Triples, null);
© www.soinside.com 2019 - 2024. All rights reserved.