为什么 DBpedia 中的同一属性有 2 个不同的词汇表?

发布于 2024-12-21 19:44:18 字数 630 浏览 1 评论 0原文

为什么 DBpedia 对相同的属性使用多个词汇表?
我必须获取所有可能的电影的数据。 对于每部电影,我观察到它都有一个 dbpedia-owl 和一个用于制片人、导演等的 dbpprop 词汇表。我使用以下查询检索属性:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?star_name 
WHERE { 
<http://dbpedia.org/resource/Goal_III:_Taking_on_the_World> dbpedia-owl:starring ?star.
?star foaf:name ?star_name 
}

我将获得每部电影的页面 id,然后我将检索明星和制作人。对于一些我认为 dbpedia-owl 可以工作,对于某些 dbpprop 也可以工作。

我对此很困惑。我必须用 Python 编写代码来为每部电影运行此查询。因此,每次我都必须检查结果是否为空,然后运行其他词汇表的代码。

Why does DBpedia use multiple vocabularies for the same attributes?
I have to get data of all possible movies.
For each movie I have observed that it has a dbpedia-owl and a dbpprop vocabulary for producers, directors and so on.. I retrieve the attribute with the following query:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?star_name 
WHERE { 
<http://dbpedia.org/resource/Goal_III:_Taking_on_the_World> dbpedia-owl:starring ?star.
?star foaf:name ?star_name 
}

I'll have the page id of each movie and then I'll retrieve stars and producers. For some I think
dbpedia-owl works and for some dbpprop works.

I am puzzled about it. I have to write code in Python to run this query for each movie. Hence every time I'll have to check that the result is null and then run the code for the other vocabulary.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晌融 2024-12-28 19:44:18

DBPedia 的数据是使用基于映射的语言从您在相应维基百科页面上看到的信息框中提取的。不同的信息框使用不同的映射,因此两种不同类型的资源可能会完全不同地映射,如果您考虑一下,这是完全合乎逻辑的。

现在您讨论的问题是具有相同数据的相同类型的两个资源映射不同。我怀疑(尽管无法确认,因为您没有给出映射属性不同的两部电影的示例)这里的问题是维基百科中的数据。可能有不止一种方法可以在信息框中表达您感兴趣的信息,并且信息框的映射对于不同的方式进行不同的映射。这并不理想,但 Wikipedia 没有干净的数据,因此您也不应该期望 DBPedia 也有干净的数据。

您可以考虑在 DBPedia 邮件列表上提问:[电子邮件受保护] 尝试找出发生这种情况的原因,因为他们可以更好地为您提供帮助。

DBPedia's data is extracted using a mapping based language from the info boxes you see on the corresponding wikipedia pages. Different mappings are used for different info boxes so two different types of resource may be mapped completely differently which is perfectly logical if you think about it.

Now the problem you are talking about is that two resources of the same type having the same data mapped differently. I suspect (though can't confirm because you didn't give examples of two movies which map properties differently) that the problem here is the data in Wikipedia. It may be that there is more than one way to express the information you are interested in within an info box and that the mapping for the info box maps differently for the different ways. This isn't ideal but Wikipedia does not have lovely clean data so you shouldn't expect DBPedia to have clean data either.

You may consider asking a question on the DBPedia mailing list at [email protected] about this to try and find out why this happens as they will be better placed to help you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文