HCLS/OWLQueryNotes

From W3C Wiki

This page is intended to record and compile the notes on the use cases of querying OWL data source, which were found to be difficult or verbose to describe.

We will see the class-level relation could help us, but the central question here is: is there any universal semantics and logic foundation underlying all of these usecases?

owl:someValueFrom

Here is the simplest case where we need class-level relation to make the query description to be less verbose. We simply add a class-level relation between the class Inner_Ear and the class Cochlea / Vestibular_Organ of the owl:someValuesFrom restrictions. See original note about this issue at http://esw.w3.org/topic/HCLS/HCLSIG_Demo_QueryScratch


<owl:Class rdf:ID="Inner_Ear">
  <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Inner ear</rdfs:label> 
- <rdfs:subClassOf>
-     <owl:Restriction>
        <owl:onProperty rdf:resource="http://www.obofoundry.org/ro/ro.owl#has_part" /> 
-       <owl:someValuesFrom>
         <owl:Class rdf:ID="Cochlea" /> 
        </owl:someValuesFrom>
      </owl:Restriction>
  </rdfs:subClassOf>
- <rdfs:subClassOf>
-     <owl:Restriction>
-       <owl:someValuesFrom>
          <owl:Class rdf:ID="Vestibular_Organ" /> 
        </owl:someValuesFrom>
        <owl:onProperty rdf:resource="http://www.obofoundry.org/ro/ro.owl#has_part" /> 
       </owl:Restriction>
  </rdfs:subClassOf>
- <rdfs:subClassOf>
      <owl:Class rdf:ID="BrainRegion" /> 
  </rdfs:subClassOf>
</owl:Class>

The queries with class level relations.

PREFIX scdef: <http://purl.org/science/owl/sciencecommons/>
PREFIX neurondb: <http://neuroweb.med.yale.edu/senselab/neuron_ontology.owl#>
SELECT *
WHERE {
  ?a rdfs:subClassOf neurondb:BrainRegion.
  ?a <http://www.obofoundry.org/ro/ro.owl#has_part?> ?c.
}


owl:intersectionOf + owl:someValuesFrom

This case is more complicated. There is a owl:someValuesFrom in the outer layer, and there is another owl:someValueFrom in the inner layer. An owl:class defined by an owl:intersectionOf description connencts these two someValuesFrom restriction.


 <owl:Class rdf:about="#Olfactory_cortex_pyramidal_neuron_with_I_A_current_in_Soma">
   <rdfs:subClassOf rdf:resource="#Olfactory_cortex_pyramidal_neuron" /> 
    - <rdfs:subClassOf>
    - <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.obofoundry.org/ro/ro.owl#has_part" /> 
    - <owl:someValuesFrom>
    - <owl:Class>
        - <owl:intersectionOf rdf:parseType="Collection">
              <owl:Class rdf:about="#Soma" /> 
            - <owl:Restriction>
                  <owl:onProperty rdf:resource="#has_Current" /> 
                - <owl:someValuesFrom>
                  <owl:Class rdf:about="#I_A" /> 
                  </owl:someValuesFrom>
              </owl:Restriction>
          </owl:intersectionOf>
      </owl:Class>
      </owl:someValuesFrom>
  </owl:Restriction>
  </rdfs:subClassOf>
  </owl:Class>


Without any class level relations, the query looks like the follows. And we found the only way to query the intersection part is to consider it as a list, and iterate over the list to retrieve the content we want. But we also discovered that this type of query had taken a very long time to run (unbearable). Further looking into it revealed that the ineffiency was caused by the way of parsing RDF list by general RDF parser. Maybe we can found out an more efficient tool to query the list, but the verbosity of query make us tend to consider the class level relation.

Note: here we need to create a class level relation between the unnamed owl:class and the inner someValuesFrom Restriction.


    PREFIX owl: <http://www.w3.org/2002/07/owl#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX scdef: <http://purl.org/science/owl/sciencecommons/>
    PREFIX neurondb: <http://neuroweb.med.yale.edu/senselab/neuron_ontology.owl#>
 
    SELECT * WHERE  {
      ?a rdfs:subClassOf ?neuron.
      ?a scdef:has_supporting_evidence ?evidence . 
      ?a rdfs:subClassOf ?b.
      ?b rdf:type owl:Restriction.
      ?b owl:onProperty <http://www.obofoundry.org/ro/ro.owl#has_part>.
      ?b owl:someValuesFrom ?c.
      ?c owl:intersectionOf ?d.
      ?d rdf:first ?e.
    }


owl:hasValue

In this case, we need to create class-to-individual relation, instead of class-level relation.

The question here is: what does it actually mean to define a relation between a class and a individual (note:it is not membership relation). Is there a logic foundation underlying the class-to-individual relation?


<owl:Class rdf:ID="AT2">
    - <owl:equivalentClass>
        - <owl:Restriction>
        -    <owl:onProperty>
               <owl:ObjectProperty      rdf:about="http://purl.org/science/owl/sciencecommons/has_peptide_sequence_described_by" /> 
             </owl:onProperty>
    -       <owl:hasValue>
              <sciencecommons:protein_record rdf:about="http://purl.org/commons/record/uniprotkb/P50052" /> 
             </owl:hasValue>
        </owl:Restriction>
  </owl:equivalentClass>
  </owl:Class>


owl:unionOf

owl:allValuesFrom

owl:complementOf

I am not sure if SPARQL spec. supports this at all, so how do we query those neuron receptors that are not present in the compartments? We have had this type of data, but we do not know how to query them yet.


<owl:Class rdf:about="#CA3_pyramidal_neuron_not_with_I_Na_t_current_in_Dap">

  <rdfs:subClassOf rdf:resource="#CA3_pyramidal_neuron" /> 
-    <rdfs:subClassOf>
-      <owl:Restriction>
          <owl:onProperty rdf:resource="http://www.obofoundry.org/ro/ro.owl#has_part" /> 
-         <owl:someValuesFrom>
-           <owl:Class>
-             <owl:intersectionOf rdf:parseType="Collection">
                <owl:Class rdf:about="#Dap" /> 
-                 <owl:Class>
-                    <owl:complementOf>
-                       <owl:Restriction>
                          <owl:onProperty rdf:resource="#has_Current" /> 
-                         <owl:someValuesFrom>
                            <owl:Class rdf:about="#I_Na_t" /> 
                          </owl:someValuesFrom>
                         </owl:Restriction>
                     </owl:complementOf>
                  </owl:Class>
               </owl:intersectionOf>
            </owl:Class>
           </owl:someValuesFrom>
         </owl:Restriction>
     </rdfs:subClassOf>
  </owl:Class>