我一直在使用OpenLink Virtuoso作为RDF存储一段时间虽然它对于大数据很好,但我对使用SPARQL的图形遍历性能不满意.最近我听说过Neo4j的遍历性能,并认为值得一试.因此,为了拥有一个具有良好遍历性能的大型RDF存储,切换到Neo4j会更好吗?
我不知道Neo4j的大数据性能,Neo4j的RDF/SPARQL部分看起来并不成熟.谢谢你的时间.
我需要编写一个程序以将三元组添加到Virtuoso三元组中,我正在使用Python和RDFLib。我已经安装了Virtuoso插件并尝试了连接,如http://pythonhosted.org/virtuoso/rdflib.html#virtuoso-storage所示。我有:
from rdflib.graph import ConjunctiveGraph as Graph
from rdflib.store import Store
from rdflib.plugin import get as plugin
from rdflib.term import URIRef, Literal
Virtuoso = plugin("Virtuoso", Store)
store = Virtuoso("DSN=VOS;UID=dba;PWD=dba;WideAsUTF16=Y")
Run Code Online (Sandbox Code Playgroud)
看来没有问题,问题是:现在呢?如何添加新的三元组?我试过了:
default_graph_uri = "http://llisa.dlsi.uji.es/productset/"
graph = Graph(store,identifier = URIRef(default_graph_uri))
graph.add((URIRef("http://llisa.dlsi.uji.es/productset#0g9x91t"),URIRef("http://xmlns.com/foaf/0.1/nick"),Literal("The Car")))
store.commit()
print graph.serialize(format='pretty-xml')
Run Code Online (Sandbox Code Playgroud)
产生以下错误:
File "/usr/local/lib/python2.7/dist-packages/virtuoso-0.12-py2.7.egg/virtuoso/vstore.py", line 345, in resolve
(value, dvtype, dttype, flag, lang, dtype) = args
ValueError: need more than 4 values to unpack
Run Code Online (Sandbox Code Playgroud)
问题是这有什么问题?以及如何正确添加三元组?谢谢。
抛出以下查询 Virtuoso 37000 Error SP030: SPARQL compiler, line 0: Bad character '%' (0x25) in SPARQL expression at '%'
PREFIX res: <http://dbpedia.org/resource/>
PREFIX yago: <http://dbpedia.org/class/yago/>
SELECT * WHERE {
res:Reykjav%C3%ADk rdf:type yago:CapitalsInEurope ;
rdfs:label ?label ;
rdfs:comment ?abstract.
FILTER (lang(?label) = "en" && lang(?abstract) = "en")
}
Run Code Online (Sandbox Code Playgroud)
虽然这个(原谅双关语)语义上相同的查询没有
PREFIX yago: <http://dbpedia.org/class/yago/>
SELECT * WHERE {
<http://dbpedia.org/resource/Reykjav%C3%ADk> rdf:type yago:CapitalsInEurope ;
rdfs:label ?label ;
rdfs:comment ?abstract.
FILTER (lang(?label) = "en" && lang(?abstract) = "en")
}
Run Code Online (Sandbox Code Playgroud)
为什么在带前缀的标识符中不允许使用URL转义字符,但是在提供完整的IRI时呢?
我收到以下错误.
Virtuoso 22007 Error DT006: Cannot convert -0359 to datetime : Incorrect month field length
SPARQL query:
define sql:big-data-const 0
#output-format:text/html
define sql:signal-void-variables 1 select ?item bif:year(xsd:dateTime( str(?dob))) as ?m{
?item <h://f.cm/ns/common/topic/notable_types> <h://f.cm/ns/people/person> .
?item <h://f.cm/ns/people/person/date_of_birth> ?dob
} limit 675
Run Code Online (Sandbox Code Playgroud)
如果我将限制更改为674,则可以.
我怀疑是某个日期时间字段在某处错误并打印出来?dob,这表明其中一个值是-0359.
解决方案是在应用bif函数之前验证值.
但是,我们如何在SPARQL中验证日期时间?
通过DBpedia SPARQL端点运行此查询会获得许多结果(institution填充列):
select ?person ?field ?institution where
{
?person a dbpedia-owl:Agent .
OPTIONAL { ?person dbpprop:workInstitution ?institution . }
OPTIONAL { ?person dbpprop:workInstitutions ?institution .}
?person dbpprop:field ?field .
}
Run Code Online (Sandbox Code Playgroud)
但是,添加该行会FILTER(BOUND(?institution))返回一个空结果集:
select ?person ?field ?institution where
{
?person a dbpedia-owl:Agent .
OPTIONAL { ?person dbpprop:workInstitution ?institution . }
OPTIONAL { ?person dbpprop:workInstitutions ?institution .}
?person dbpprop:field ?field .
FILTER(BOUND(?institution))
}
Run Code Online (Sandbox Code Playgroud)
为什么是这样?我希望第一个查询中institution显示结果的所有结果都显示出来,但没有任何结果.
我正在尝试运行以下SPARQL查询,但它一直在返回SR171: Transaction timed out.
SELECT ?isBusAvailable WHERE {
SELECT DISTINCT IF (
(
SELECT ?value2 WHERE {
GRAPH data: { ?obsValueID2 ontology:value ?value2 }
GRAPH data: { ?obsValueID2 rdf:label "Availability" }
GRAPH data: { ?obsValueID2 ontology:isObservedValueOf ?obsID2}
GRAPH data: { ?obsID2 ssn:observationResultTime ?time2 }
GRAPH data: { ?obsID2 ssn:observedBy ?id2 }
GRAPH meta: { ?id2 rdf:label "MyBusService" }
} ORDER BY DESC (?time2) LIMIT 1) > 1, "Take Bus", (
SELECT ?isBikeAvailable WHERE {
SELECT DISTINCT IF ( …Run Code Online (Sandbox Code Playgroud) 在isql-vt(Virtuoso的Ubuntu名称isql)中,我试图导入测试.ttl文件,但得到错误"无法统计文件":
SQL> DB.DBA.TTLP(file_to_string_output('./scratch/ttl/granule.ttl'),'','http://origin.mytest.org/');
*** Error 42000: [Virtuoso Driver][Virtuoso Server]FA112: Can't stat file './scratch/ttl/granule.ttl', error (2) : No such file or directory
Run Code Online (Sandbox Code Playgroud)
但是,文件肯定存在; 我甚至cat可以:
SQL> !cat ./scratch/ttl/granule.ttl;
@prefix datacite: <http://purl.org/spar/datacite/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
<http://0.0.0.0:3000/granule/MOD09.A2016278.0110.006.2016279074214.hdf>
datacite:identifier "MOD09.A2016278.0110.006.2016279074214.hdf";
prov:wasGeneratedBy <http://0.0.0.0:3000/run/MODAPS_456056327>;
a prov:entity .
SQL>
Run Code Online (Sandbox Code Playgroud)
为什么DB.DBA.TTLP命令说不能统计它?
我有一个带Ubuntu OS的远程服务器.我putty用来在服务器上运行命令.我在上面安装了OpenLink开源Virtuoso.
现在,当我使用以下命令启动服务器时:
要启动服务器,您需要执行两个步骤
- 去
cd /usr/local/virtuoso-opensource/var/lib/virtuoso/db- 然后键入
/usr/local/virtuoso-opensource/bin/virtuoso-t -f &
服务器启动成功,我可以访问指挥和东西,但一旦我关闭我的putty会话,Virtuoso服务器也关闭.我也跑tomcat,并LAMP在该计算机上.这两个仍然继续运行但奇怪的是Virtuoso关闭了.
即使我断开putty会话,如何保持运行?
我们将使用Virtuoso来存储RDF,一开始的三位数将是1亿。我需要知道什么是典型的RAM,CPU,磁盘等。查询将使用SPARQL,并且会有一些复杂的查询。
请提供您的输入。
我有一个关于使用 SPARQL 从三元组存储(在我的例子中是 Virtuoso)中删除元素的问题。我已将以下元素存储在图表中:
@prefix xy: <http://purl.oclc.org/xy/xy#> .
@prefix ssn: <http://purl.oclc.org/NET/ssnx/ssn#> .
<point> a xy:Point ;
xy:value "10" ;
ssn:observationResultTime <Rs_b8d4ae44-6083-4140-b4e3-11fcf38a53c8> ;
ssn:observationSamplingTime <St_b8d4ae44-6083-4140-b4e3-11fcf38a53c8> ;
ssn:observedBy <SensorID-b8d4ae44-6083-4140-b4e3-11fcf38a53c8> .
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,我有一个 xy:Point,它具有一些属性。在我的数据库中,我存储了数十个这样的点。现在我的问题是:如何删除一个点及其所有属性(甚至是观察采样时间、观察结果时间可能链接的子属性)?有什么简单的解决办法吗?现在,我通过给出所有精确关系来删除该点及其属性,例如:
@prefix xy: <http://purl.oclc.org/xy/xy#> .
@prefix ssn: <http://purl.oclc.org/NET/ssnx/ssn#>
delete {
?observation a xy:Point .
?observation xy:value ?value .
?observation ssn:observationResultTime ?resultTime .
?observation ssn:observationSamplingTime ?samplingTime .
?observation ssn:observedBy ?sensor .
}
WHERE {
?observation xy:value ?value .
?observation ssn:observationResultTime ?resultTime .
?observation ssn:observationSamplingTime ?samplingTime .
?observation ssn:observedBy ?sensor .
}
Run Code Online (Sandbox Code Playgroud)
我想做的是“删除?观察 …
virtuoso ×10
sparql ×6
rdf ×5
dbpedia ×2
cpu ×1
file-access ×1
freebase ×1
neo4j ×1
performance ×1
putty ×1
python ×1
ram ×1
rdflib ×1
triplestore ×1
ubuntu ×1