gpt4 book ai didi

SPARQL获取DBpedia中资源URI uri1和uri2的维基百科链接

转载 作者:行者123 更新时间:2023-12-02 10:44:27 25 4
gpt4 key购买 nike

在一篇文档中我读到一条信息如下:

Ranker does not use only external information sources but exploits also further information from the original DBpedia dataset. In fact, we also consider Wikipedia hypertextual links mapped in DBpedia by the property dbpedia-owl:wikiPageWikiLink. Whenever in a Wikipedia document w1 there is a hypertextual link to another Wikipedia document w2, in DBpedia there is a dbpedia-owl:wikiPageWikiLink from uri1 to uri2. Hence, if there is a dbpedia-owl:wikiPageWikiLink from uri1 to uri2 and/or vice versa, we assume a stronger relation between the two resources. We evaluate the strength of the connection as follow:

WikiS(uri1, uri2) Algorithm

但是我尝试在 dbpedia 上搜索属性 wikilink 但没有结果。我尝试了以下查询:

Query 1: 
prefix dbpedia-owl: <http://dbpedia.org/ontology/>
prefix dbpprop: <http://www.w3.org/2006/03/wn/wn20/instances/synset-movie-noun-1>
select count(?s)
where{
?s ?p ?o .
FILTER(?p, dbpprop:wikilink)
}

Query 2:
prefix dbpedia-owl: <http://dbpedia.org/ontology/>
prefix dbpprop: <http://www.w3.org/2006/03/wn/wn20/instances/synset-movie-noun-1>
select count(?s)
where{
?s ?p ?o .
FILTER(?p = dbpedia-owl:wikiPageWikiLink)
}

Query 3:
select *
where{
?s ?p ?o .
FILTER regex(?p, "link")
}

但没有结果。

如何在我的程序中安装算法 WikiS(uri1、uri2)。

非常感谢。

最佳答案

获取其 URI 中包含标记“link”的所有对象属性:

SELECT DISTINCT ?p WHERE {
?p a <http://www.w3.org/2002/07/owl#ObjectProperty>
FILTER regex(?p, "link", "i")
}

返回

+-------------------------------------------------------+
| p |
+-------------------------------------------------------+
| http://dbpedia.org/ontology/linkedTo |
| http://dbpedia.org/ontology/provinceLink |
| http://dbpedia.org/ontology/wikiPageEditLink |
| http://dbpedia.org/ontology/wikiPageHistoryLink |
| http://dbpedia.org/ontology/wikiPageInterLanguageLink |
| http://dbpedia.org/ontology/wikiPageRevisionLink |
| http://dbpedia.org/ontology/wikiPageWikiLinkText |
| http://dbpedia.org/ontology/wikiPageWikiLink |
| http://dbpedia.org/ontology/wikiPageExternalLink |
+-------------------------------------------------------+

相同,但频率不同:

SELECT  ?p (count(*) AS ?cnt)
WHERE
{ { SELECT DISTINCT ?p
WHERE
{ ?p a <http://www.w3.org/2002/07/owl#ObjectProperty>
FILTER regex(?p, "link", "i")
}
}
?s ?p ?o
}
GROUP BY ?p

关于SPARQL获取DBpedia中资源URI uri1和uri2的维基百科链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41364482/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com