获取 DBpedia 类的所有属性

发布于 2024-11-28 01:56:01 字数 244 浏览 4 评论 0原文

如何获取特定类的属性列表?考虑类 dbpedia-owl:PersonPerson 类的所有实例都有一些以 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?

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

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

发布评论

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

评论(2

明天过后 2024-12-05 01:56:01

有效的方法是:

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

在此查询中,您要求提供将 dbpedia:Person 作为 rdfs:domain 的所有属性。此查询需要架构定义才能工作,有时数据集并不真正完全遵循架构。对于这些数据集,您将尝试另一个查询。

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

该查询查看绑定从中产生的每个属性的每个人的实例。这比第一个难多了,在 dbpedia 公共实例中你会超时。因此,如果您想使用公共端点,最好使用第一个。

The one that works is:

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

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 . }

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.

勿挽旧人 2024-12-05 01:56:01

要获取所有传递属性,您可以询问此查询。

select distinct ?property where{
{
  ?property rdfs:domain ?class . 
  dbpedia-owl:Person rdfs:subClassOf+ ?class.
} UNION {
  ?property rdfs:domain dbpedia-owl:Person.
}}

“rdfs:subClassOf”中的“+”是一个属性路径表达式 [1],它也获取 Person 的所有超类。
这些属性对于 Person 也有效。

另请注意,不建议使用 dbprop 命名空间,因为数据是原始数据并且未标准化为数据类型。

[1] http://www.w3.org/TR/2010/WD- sparql11-property-paths-20100126/

披露:我是 DBpedia 开发人员

To get all transitive properties you can ask this query

select distinct ?property where{
{
  ?property rdfs:domain ?class . 
  dbpedia-owl:Person rdfs:subClassOf+ ?class.
} UNION {
  ?property rdfs:domain dbpedia-owl:Person.
}}

The '+' in the 'rdfs:subClassOf' is a property path expression [1] that fetches all uperclasses of Person as well.
These properties are also valid for Person.

Also note that the dbprop namespace is not recommended because the data is raw and not normalized to a datatype.

[1] http://www.w3.org/TR/2010/WD-sparql11-property-paths-20100126/

Disclosure: I am a DBpedia developer

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