每个DBpedia资源的入站链接数 [英] Number of incoming link fo each DBpedia resource
问题描述
我在下面有SPARQL DBpedia查询:
I have the SPARQL DBpedia Query below:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX vrank:<http://purl.org/voc/vrank#>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
SELECT distinct ?Nom ?resource ?url (count( (?o) as ?nb))
WHERE{
?resource rdfs:label ?Nom.
?resource foaf:isPrimaryTopicOf ?url.
?resource dbpedia-owl:wikiPageWikiLink ?o
?Nom <bif:contains> "Apple".
FILTER ( langMatches( lang(?Nom), "EN" )).
MINUS {?resource dbo:wikiPageRedirects|dbo:wikiPageDisambiguates ?dis}
}
Group By ?Nom ?resource ?url
我想获取维基百科中每个实体的传入链接数。我该如何进行?
谢谢
I want to get the number of incoming links of each entitie within wikipedia. How can I proceed? Thanks
推荐答案
首先使用语法:
您在?o,
之后缺少点,它也应该是bif:contains,而不是< bif:contains>
。
下一步:
我运行了以下简单查询:
i ran this simpler query:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX vrank:<http://purl.org/voc/vrank#>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
SELECT distinct ?Nom ?resource
WHERE{
?resource rdfs:label ?Nom.
?Nom bif:contains "Apple".
}
这产生了很多结果...。
现在我添加此三元组:
which produced a lot of results.... now i added this triple:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX vrank:<http://purl.org/voc/vrank#>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
SELECT distinct ?Nom ?resource
WHERE{
?resource rdfs:label ?Nom.
?resource dbpedia-owl:wikiPageWikiLink ?o.
?Nom bif:contains "Apple".
}
未返回任何结果。
这意味着在对象常量中没有包含苹果的三元组,在该对象的整个端点中都有一个WikiPageWikiLink。
this means there is no triple containing apple in its object literal, where the subject has a wikiPageWikiLink in the whole endpoint.
如果存在此属性,则其属性实例不包含在官方端点中,因为没有包含该属性的三元组(我检查过)。这可能是由于以下事实:官方端点没有保存每个dbpedia数据集,或者它已被弃用。
If this property does exist, its instances are not included in the official endpoint since there is no triple containing this property (I checked). This is probably due to the fact, that the official endpoint does not hold every dbpedia dataset, or it might be deprecated.
这篇关于每个DBpedia资源的入站链接数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!