1

I want to query an ontology which contains implicit properties hold by owl:equivalentclass objects. How can I achieve this?

The ontology holds triples like this:

<plantURI> rdf:type <http://purl.obolibrary.org/obo/FLOPO_0004148>.

The class <http://purl.obolibrary.org/obo/FLOPO_0004148> has the following definition:

    <owl:Class rdf:about="http://purl.obolibrary.org/obo/FLOPO_0004148">
        <owl:equivalentClass>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000051"/>
                <owl:someValuesFrom>
                    <owl:Class>
                        <owl:intersectionOf rdf:parseType="Collection">
                            <rdf:Description rdf:about="http://purl.obolibrary.org/obo/PO_0009046"/>
                            <owl:Restriction>
                                <owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/RO_0000053"/>
                                <owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/PATO_0000320"/>
                            </owl:Restriction>
                        </owl:intersectionOf>
                    </owl:Class>
                </owl:someValuesFrom>
            </owl:Restriction>
        </owl:equivalentClass>
        <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">flower green</rdfs:label>
    </owl:Class>

However, I don't want to query simply for the URI like this:

SELECT * { ?s rdf:type <http://purl.obolibrary.org/obo/FLOPO_0004148> }

but I want to query sometimes only for one of its implicit properties, for example the property <http://purl.obolibrary.org/obo/PATO_0000320> ("green") - searching for all plants that are green in any way.

So, the best query would look like this:

SELECT * {
?s ?p <http://purl.obolibrary.org/obo/PATO_0000320>
}

Which gives me the object, because implicitly the object holds this property.

This probably involves reasoning in Virtuoso. However, after some hours I cannot come up with any solution how to do this in SPARQL.

TallTed
  • 9,069
  • 2
  • 22
  • 37
Adrian
  • 591
  • 4
  • 12
  • 1
    short answer: not possible with Virtuoso Open Source 7.x as it needs the OWL RL reasoning profile which afaik isn't available in that version. Maybe in Virtuoso 8 - I don't know - but there is no open source version for Virtuoso 8 – UninformedUser Aug 19 '19 at 13:55
  • 1
    I would suggest raising this to the [OpenLink Community Forum](https://community.openlinksw.com). I believe @AKSW is correct, that you will need the advanced reasoning features of Virtuoso 8, which remains commercial-only (i.e., no Open Source Edition) -- but perhaps more detail of what you're doing would reveal another option. – TallTed Aug 19 '19 at 14:57
  • I feared so! Thank you both for your answer! – Adrian Aug 20 '19 at 05:27

1 Answers1

0

Virtuoso provides reasoning and inference in two forms. 1. Built-in -- this is based on canned rules covering the relations semantics for owl:equivalentClass, owl:equivalentProperty, owl:inverseOf, owl:sameAs, owl:InverseFunctionalProperty, owl:SymmetricProperty, rdfs:subClassOf, rdfs:subPropertyOf (this is supported in both open source and commercial editions)

  1. Custom -- this is based on custom rules crafted using SPARQL and the Rules Language, courtesy of terms from the SPIN Ontology (this is a commercial edition only feature).

You appear right now to simply require owl:equivalentClass reasoning, so you can look at the following built-in inference and reasoning examples:

Equivalent Class Reasoning Enabled

DEFINE input:inference 'urn:owl:equivalent:class:inference:rules'

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bmo: <http://purl.org/bmo/ns#> 
PREFIX fibo: <https://spec.edmcouncil.org/fibo/ontology/FND/AgentsAndPeople/People/Person>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>


SELECT DISTINCT ?s
WHERE {
        ?s a fibo:person .

      }
LIMIT 20

Live Query Results Page (solution is produced based on effects of reasoning and inference)

Equivalent Class Reasoning Disabled (notice DEFINE input:inference pragma commented out)

# DEFINE input:inference 'urn:owl:equivalent:class:inference:rules'

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bmo: <http://purl.org/bmo/ns#> 
PREFIX fibo: <https://spec.edmcouncil.org/fibo/ontology/FND/AgentsAndPeople/People/Person>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>


SELECT DISTINCT ?s
WHERE {
        ?s a fibo:person .

      }
LIMIT 20

Live Query Results Page (should be empty)

Example source code document from our Github Repository.