Hi Dave:

Thank you so much for the very helpful comments, it is now more clear to me
than before.

I totally agree that I need to figure out why I need to use something over
the other.

In my case for example, I have this huge TDB with 16GB that has lots of
biomedical data. I would like for example to find a gene that associated
with at least 3 different phenotype. Therefore,  I can do this with the
following:

1- OWL (pellet)
<owl:Class rdf:about="
https://csel.cs.colorado.edu/~noor/Drug_Disease_ontology/DDID.owl#multiDiseases
">
        <owl:equivalentClass>
            <owl:Restriction>
                <owl:onProperty rdf:resource="
https://csel.cs.colorado.edu/~noor/Drug_Disease_ontology/DDID.owl#gene_associated_with_disease
"/>
                <owl:onClass rdf:resource="
https://csel.cs.colorado.edu/~noor/Drug_Disease_ontology/DDID.owl#Disease"/>
                <owl:minQualifiedCardinality
rdf:datatype="&xsd;nonNegativeInteger">3</owl:minQualifiedCardinality>
            </owl:Restriction>
        </owl:equivalentClass>
        <rdfs:subClassOf rdf:resource="
https://csel.cs.colorado.edu/~noor/Drug_Disease_ontology/DDID.rdf#DDID"/>
    </owl:Class>

2- Construct:

CONSTRUCT {

?s ddids:gene_associated_with_disease ?o .

?s ddids:gene_associated_with_disease ?o1 .

?s ddids:gene_associated_with_disease ?o2 .}

WHERE {

?s ddids:gene_associated_with_disease ?o .

?s ddids:gene_associated_with_disease ?o1 .

?s ddids:gene_associated_with_disease ?o2 .

FILTER (?o != ?o1 )

FILTER (?o != ?o2 )

FILTER (?o1 != ?o2 )

}
and store the result of construct into new TDB and work on it.

3- sparql update

INSERT {
?s ddids:gene_has_multiple_association ?o

WHERE {

?s ddids:gene_associated_with_disease ?o .

?s ddids:gene_associated_with_disease ?o1 .

?s ddids:gene_associated_with_disease ?o2 .

FILTER (?o != ?o1 )

FILTER (?o != ?o2 )

FILTER (?o1 != ?o2 )

}
The three methods will at the end give me the same answer, but the
performance is different. If I want to do this test in owl, it takes around
14 hours to complete, in construct 2 mins, and sparql updates less than a
minute.

What do you think Dave ?




On Thu, Mar 27, 2014 at 2:58 AM, Dave Reynolds <[email protected]>wrote:

> On 27/03/14 04:31, Adeeb Noor wrote:
>
>> Hi All:
>>
>> I have a question about the the differences between a reasoner and
>> sparqlUpdates. Are one better than the other ?
>>
>
> Is a water melon better than a kumquat? Depends on what you want.
>
>
>  Are they functionally
>> different ?
>>
>
> Oh yes.
>
>
>  I feel that everything I need to do with Pellet reasoner, which consumes
>> too much time. is easily and time effective with sparqlUpdates.
>>
>> Please help me with that as I am in the middle and really do not know if I
>> should just get out of the reasoner because of time consuming.
>>
>
> Since you've not said what you want out of reasoning it is hard to be
> specific.
>
> Using something like Sparql Update allows you to deduce one set of triples
> from the existing set. Repeatedly doing this allows you to make further
> deductions. So repeatedly running a set of Sparql Updates until you see no
> further changes is a brute force way to implement a variant of rule based
> inference.
>
> (1) For simple cases (like most of RDFS inference) this is not only
> sufficient but you probably don't have to iterate very many times in
> practice (once may even be sufficient) so it can be better performance than
> more general alternatives. In particular it's more scalable because you are
> keeping no state other than the internal iteration state of the Sparql
> Update.
>
> (2) For some cases then such a rule based inference is sufficient but a
> little more complex. For example OWL has the OWL/RL profile which captures
> most of what OWL inferences can be usefully done using rules. However you
> may have to iterate your rules/updates a lot to get the answers and
> repeated Sparql Updates will redo work on each iteration. For cases where
> one rule triggers another rule then people invented things like RETE which
> keep a lot of state around so one change (either external or the result of
> a rule firing) can trigger the next change directly without have to re-run
> all the queries. For some rule sets and data this can be a *lot* more
> efficient than repeated query-and-update, for some cases it can be less
> efficient or at least not worth the storage overhead.
>
> (3) Complete OWL inference can't be done with such rules. There are
> consequences of the OWL semantics that can't be found that way. You can
> express interesting logic problems in OWL ranging from sudoku to serious
> medical diagnosis tasks. Hence the need for specialist reasons like DL
> reasoners as implemented by Pellet.
>
> The questions you have to answer for yourself are:  why do you want to use
> a reasoner, what effect are you trying to achieve, what is the most
> appropriate way to achieve that?
>
> If you want to see a few simple deductions like domain/range or direct
> sub-class inference, and if your data is largely static then Sparql Update
> will be fine.
>
> If you need slightly more complex inference and/or you'll be adding new
> triples to your data and want to efficiently compute the consequences
> incrementally then consider using a rule system.
>
> If you are working with OWL and you need completeness, you need to
> guarantee that all inferences are made and that all contradictions are
> detected then you need something like Pellet. Ontology checking would be a
> good example of this.
>
> Dave
>
>
>


-- 
Adeeb Noor
Ph.D. Candidate
Dept of Computer Science
University of Colorado at Boulder
Cell: 571-484-3303
Email: [email protected]

Reply via email to