Frage

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.

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

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.

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?

War es hilfreich?

Lösung 2

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 results

Andere Tipps

It depends on the ontology you use. It cannot be decided in general without additional information. It is quite possible that your ontology doesn't even try to make such a distinction.

With respect to DBpedia, it's worth looking at DbPedia Classifications, currently they provide three:

  • Wikipedia Categories: represented using the SKOS vocabulary and DCMI terms
  • YAGO Classification: derived from the Wikipedia category system using Word Net
  • Word Net Synset Links: generated by manually relating Wikipedia Infobox templates and Word Net synsets, should be more precise than Wikipedia categories

You can try to use also these categorizations to to distinguish animate and inanimate objects.

However, to use categories, you would probably have to traverse the skos:broader hierarchy in which case you should be careful because it contains loops, see http://wikiloopr.com/

It might be the best to start with what Joshua suggests in his answer and complement it with categorizations if it's not enough.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top