获取DBpedia类的所有属性 [英] Get all properties for a DBpedia class

查看:114
本文介绍了获取DBpedia类的所有属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取特定类的属性列表?考虑类 dbpedia-owl:Person Person 类的所有实例都有一些前缀为 dbpprop:的属性。如何获得所有 Person 类实例的 dbpprop:属性?

How to get a list of properties for a specific class? Consider the class dbpedia-owl:Person. All instances of the Person class have some properties prefixed with dbpprop:. How can I get all the dbpprop: properties that we may find for all the instance of the Person class?

推荐答案

有效的方法是:

select distinct ?property where { 
   ?property <http://www.w3.org/2000/01/rdf-schema#domain> 
                             <http://dbpedia.org/ontology/Person> . }

在此查询中,您要查询具有 dbpedia的所有属性: Person 作为 rdfs:domain 。此查询需要一个模式定义才能起作用,并且有时数据集实际上并不能完全遵循这些模式。对于这些数据集,您可以尝试其他查询

In this query you are asking for all the properties that have dbpedia:Person as rdfs:domain. This query requires a schema definition to work and sometime datasets don't really follow perfectly the schemas. For those datasets you would try this other query

select distinct ?property where {
         ?instance a <http://dbpedia.org/ontology/Person> . 
         ?instance ?property ?obj . }

此查询查看绑定每个属性的人的每个实例。它比第一个要难得多,在dbpedia公共实例中,您会超时。因此,如果要使用公共端点,最好使用第一个。

This query looks at every instance of person binding every property that comes out of it. It is much harder than the first one, and in the dbpedia public instance you will get a time out. So you are better off with the first one if you want to use the public endpoint.

这篇关于获取DBpedia类的所有属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆