简体   繁体   English

DBpedia SPARQL 和谓词连接

[英]DBpedia SPARQL and predicate connection

I've got a problem with the DBpedia SPARQL endpoint because the properties of the properties like the label of rdf:type are not stocked in the endpoint.我遇到了 DBpedia SPARQL 端点的问题,因为端点中没有存储诸如rdf:type的 label 之类的属性的属性。 So when I run this query:所以当我运行这个查询时:

SELECT * 
WHERE{
  <http://dbpedia.org/ontology/Place> ?predicat ?object .
  OPTIONAL{?predicat rdfs:label ?label}
}

I've got nothing for?label.我什么都没有?label。

If someone got any idea to solve this problem it would be very helpful.如果有人有任何想法来解决这个问题,那将非常有帮助。

You can't get the real labels from DBpedia because the SPARQL endpoint doesn't have them.您无法从 DBpedia 获得真正的标签,因为 SPARQL 端点没有它们。 But you can take the local name of the property URI.但是您可以使用属性 URI 的本地名称。 So, for rdfs:subClassOf you'd get "subClassOf".所以,对于 rdfs:subClassOf 你会得到“subClassOf”。 That's better than nothing.那总比没有好。 This can be done using Virtuoso's (non-standard) bif:regexp_replace function.这可以使用 Virtuoso 的(非标准) bif:regexp_replace function 来完成。

SELECT DISTINCT (bif:regexp_replace(STR(?p), "^.*[/#]", "") AS ?label) WHERE {
   <http://dbpedia.org/ontology/Place> ?p ?o .
}

I don't think there's a SPARQL solution.我认为没有 SPARQL 解决方案。 Dbpedia doesn't have the data you want, and I couldn't easily find a SPARQL endpoint for that RDF at W3C. Dbpedia 没有您想要的数据,而且我无法在 W3C 上轻松找到该 RDF 的 SPARQL 端点。 And I don't think the Virtuoso dbpedia endpoint supports federation yet, even if we did find a SPARQL endpoint for W3C.而且我认为 Virtuoso dbpedia 端点还不支持联合,即使我们确实为 W3C 找到了 SPARQL 端点。

Happy to be proven wrong on any of those points.很高兴在这些方面被证明是错误的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM