也许,我只能掌握一些基本思想,而这里却提出了我的问题。 我试图从卢旺达国防军的储存中提取三倍(使用4个仓库,但也尝试过XMLKnife)和SPARQL的盘问,明确了前线,取得了空洞的结果。
当然,我不像卢旺达国防军的辛塔克斯一号那样做任何事情,而是使用“和解”生成的数据(其范围被缩小到一个适合实例的规模)。
<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF
xml:base = "http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl"
xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:ub="univ-bench.owl#"
>
<owl:DatatypeProperty rdf:ID="name">
<rdfs:label>name</rdfs:label>
</owl:DatatypeProperty>
<owl:Class rdf:ID="Organization">
<rdfs:label>organization</rdfs:label>
</owl:Class>
<owl:Class rdf:ID="University">
<rdfs:label>university</rdfs:label>
<rdfs:subClassOf rdf:resource="#Organization" />
</owl:Class>
<ub:University rdf:about="http://www.University0.edu">
<ub:name>University0</ub:name>
</ub:University>
</rdf:RDF>
然后,我问,在进口后,我数据库实际包含的三倍:
SELECT * WHERE {?s ?p ?o} ORDERBY ?s
结果是:
<http://www.University0.edu> <univ-bench.owl#name> "University0"
<http://www.University0.edu> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <univ-bench.owl#University>
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Organization> <http://www.w3.org/2000/01/rdf-schema#label> "organization"
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Organization> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class>
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#University> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Organization>
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#University> <http://www.w3.org/2000/01/rdf-schema#label> "university"
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#University> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class>
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#name> <http://www.w3.org/2000/01/rdf-schema#label> "name"
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#name> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#DatatypeProperty>
显而易见的是,我有<代码><univ-bench.owl#name>作为头三者的一部分。
Nevertheless following query returns no results:
SELECT * WHERE {?s <univ-bench.owl#name> ?o}
I ve tried dozens of combinations, with namespaces and without, but can t make it work. Can anyone explain why RDF engine doesn t find a predicate that s obviously there?
BTW, extracting the same triple with OBJECT="University0" works OK.