The goal is simple: infer class membership (using rdfs:subClassOf and rdf:type predicates). Don't do it with a property path or something. You must let the reasoner do it.
I've tried to do this with a few reasoners. All unsuccessful.
- Apache Jena wasn't able to do it with 12GB of RAM.
- Stardog wasn't able to do it with 12GB of RAM.
- REQUIEM wasn't able to do it with 12GB of RAM.
In this zip file you'll find tbox.ttl
and abox.ttl
.
This is the query that should return 79 results:
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ex: <http://example.com/>
SELECT *
WHERE
{ ex:condition0 a ?type
}
Without reasoning it yields 1 result:
type |
---|
http://www\.wikidata\.org/entity/Q32552 |
But with RDFS reasoning enabled there should be 79 results.
e.g.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ex: <http://example.com/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT *
WHERE
{ ex:condition0 rdf:type/(rdfs:subClassOf)* ?type }
Yields:
Hi @justin2004,
I followed the goal proposal: we have an API for finding the classes of a given individual in an ontology. Internally it subsumes rdfs:subClassOf taxonomy starting from known rdf:type classes of the individual. The only configuration I did was to disable awareness of owl:equivalentClass (which we support by default) because not stated by the goal.
Strictly speaking in terms of reasoner we don't have a monolithic engine which reads n3 rules and produces answers: we are a library, so we rather expose high-level usable APIs to applications for dealing with ontologies. I built a simple consolle application like this:
Regards,
Marco