我尝试按照dotnetrdf
文档将数据存储在Virtuoso Server中。
这是我所做的:
public void LoadGraph()
{
//Create our Storage Provider - this example uses Virtuoso Universal Server
VirtuosoManager virtuoso = new VirtuosoManager("creativeartefact.org", 1111, "DB", "user", "password");
//Load the Graph into an ordinary graph instance first
Graph g = new Graph();
virtuoso.LoadGraph(g, new Uri("http://creativeartefact.org/"));
//Then place the Graph into a wrapper
StoreGraphPersistenceWrapper wrapper = new StoreGraphPersistenceWrapper(virtuoso, g);
//Now make changes to this Graph as desired...
g.Assert(g.CreateUriNode(new Uri("http://creativeartefact.org/testB/123")), g.CreateUriNode("rdf:Type"), g.CreateUriNode(new Uri("http://creativeartefact.org/ontology/Artist")));
wrapper.Flush(); // mandatory, but doesn't help either
//Remember to call Dispose() to ensure changes get persisted when you are done
wrapper.Dispose();
}
但是 - 没有数据被保存,也没有抛出异常。插入三元组后,三元组计数按预期增加 1,但不会进入数据库。当我重新运行代码时,三重计数又回到了旧值。用户帐户具有write
权限。
知道我缺少什么吗?
提前致谢,
弗兰克