- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在一篇文档中我读到一条信息如下:
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:
但是我尝试在 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/
我是一名优秀的程序员,十分优秀!