Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python RDFlib';在磁盘上';商店_Python_Rdf_Rdflib - Fatal编程技术网

Python RDFlib';在磁盘上';商店

Python RDFlib';在磁盘上';商店,python,rdf,rdflib,Python,Rdf,Rdflib,经过两天的研究,我(一个新手)仍然无法确定RDFFlib 3.1.0中有哪些“磁盘上”存储。如果你有一个工作的例子,这将是很高兴看到。。。 对于我的应用程序,我更喜欢SQLite。我不需要访问在线RDF商店,我想在RDF中存储有关组织内部关系的信息。 谢谢这里有一个使用MySQL的例子。我认为rdflib3不适用于SQLite import rdflib from rdflib.Graph import ConjunctiveGraph as Graph from rdf

经过两天的研究,我(一个新手)仍然无法确定RDFFlib 3.1.0中有哪些“磁盘上”存储。如果你有一个工作的例子,这将是很高兴看到。。。 对于我的应用程序,我更喜欢SQLite。我不需要访问在线RDF商店,我想在RDF中存储有关组织内部关系的信息。
谢谢

这里有一个使用MySQL的例子。我认为
rdflib3
不适用于SQLite

    import rdflib
    from rdflib.Graph import ConjunctiveGraph as Graph
    from rdflib import plugin
    from rdflib.store import Store, NO_STORE, VALID_STORE

    configString = "host=localhost,user=root,password=,db=db_name"
    rt = store.open(configString,create=False)
    assert rt == VALID_STORE,"The store is corrupted"
    print "load store success"
    graph = Graph(store)
    g.parse("some.rdf")
    g.commit()
我会避免在磁盘存储上使用rdflib,因为它们看起来不太可靠,扩展性也不太好。正如您所注意到的,文档也不是很好


如果您正在做一些严肃的工作,那么可以使用三重存储,如Virtuoso或,并使用SPARQL访问数据。使用Python可以访问许多库。

多亏了Fernando Tapia Rico的工作和帮助,我的“磁盘上”存储才得以运行。尽我所能看一看,“商店”在任何地方都没有定义?