如何使用SPARQL区分事物和无生命对象 [英] How to differentiate between a Thing and an inanimate object with SPARQL

查看:114
本文介绍了如何使用SPARQL区分事物和无生命对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用SPARQL,我可以很容易地获得某些资源的所有相关信息,但是我很难弄清楚如何真正区分事物和事物-其中事物是所有类的超类,是无生命的东西,例如杯子,勺子,铅笔等。

Using SPARQL, I can get all related info about some resource quite easily, but I'm having a hard time figuring out how to actually differentiate between things and things -- in which Thing is the super class of all classes, and things that are inanimate objects, like a cup, spoon, pencil, etc.

例如,以下是DBPedia中的一些无生命对象:

For example, here are a few innanimate objects in DBPedia:

  • Fork: http://dbpedia.org/page/Fork
  • Jar: http://dbpedia.org/page/Jar
  • Envelope: http://dbpedia.org/page/Envelope
  • Baseball glove: http://dbpedia.org/page/Baseball_glove
  • Screwdriver: http://dbpedia.org/page/Screwdriver

这就是问题-我知道很多本体都没有一种很容易实现的特定类型使您能够查询对象,但是,也许有一种方法可以确定某事物是否为事物,因为它没有子类,或者它的类型的属性路径可以用于区分某些事物

Here's the thing -- I know that a lot of ontologies don't have a specific type that would easily give you the ability to query for objects, however, perhaps theres a way to tell if something is a thing because it has no subclasses, or maybe the property path of its types can be used to differentiate in some roundabout way.

但是,总的来说,我想知道是否可以区分事物和使用SPARQL查询的事物

But, in general, I'd like to know if it is possible to differentiate between Things and things using a SPARQL query? and if so, how?

推荐答案

您可以浏览 DBpedia本体类在线。在 owl:Thing 下,有许多顶级类。尽管它不是完美的匹配,但由于它包含一些集体实体,因此看起来像Agent类及其补语可能与动画对象和非动画对象相当吻合。您可能还需要考虑动物类或物种类下的其他事项。您还应该考虑一些非DBpedia类,例如foaf:Person。无论如何,这里的主要方法是选择该层次结构中您认为代表动画和无动画的类,然后使用它来确定实例。

You can browse the DBpedia ontology classes online. Under owl:Thing, there are a number of toplevel classes. While it's not a perfect match, because it includes some collective entities, it looks like the Agent class and its complement probably correspond fairly well to animate and inanimate objects. You might also need to consider the Animal class as well, or some other things under the Species class. There are also some non-DBpedia classes, e.g., foaf:Person that you should probably consider, too. At any rate, the big approach here would be to select what classes in that hierarchy you consider to represent animate and inanimate things, and then use that to decide about instances.

例如,您可以使用这样的查询来查找动画对象(如果我们将动画对象定义为特工和动物):

E.g., you could use a query like this to find animate things (if we define animate things as Agents and Animals):

select ?x where { 
  ?x a owl:Thing 
  filter exists {
    ?x a ?type .
    filter( ?type in ( dbpedia-owl:Agent, dbpedia-owl:Animal ) )
  }
}
limit 100 

SPARQL结果

这篇关于如何使用SPARQL区分事物和无生命对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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