Looking for Taxa that exhibit specific Entity Quality combinations in OBD

1 view
Skip to first unread message

car...@nescent.org

unread,
Sep 25, 2008, 4:24:24 PM9/25/08
to obd-dev
Hello,

One of the queries that I have developed for the Phenoscape project
involves looking for taxa that exhibit specific Entity Quality
combinations. An example: Find all the taxa that exhibit (or encode)
increased thickening of premaxilla. At present, this is being done by
pulling out every statement from the shard, and then examining the
target node of each statement to see if it contains the Entity Quality
combination being searched for. As can be imagined, this method takes
an inordinately long time to execute although the results are
correct.

Some of the other options that I have tried:

a) Create a compositional description and use it like so:

OBDSQLShard obdsql;

CompositionalDescription cd = new
CompositionalDescription(Predicate.INTERSECTION);
cd.addArgument(quality);
cd.addArgument(relationVocabulary.inheres_in(), entity);

CompositionalDescriptionQueryTerm cdqt = new
CompositionalDescriptionQueryTerm(cd);

Collection<Statements> stmts = obdsql.getStatementsByQuery(cdqt);

RESULT: Returns nothing

b) OBDSQLShard obdsql;

CompositionalDescription cd = new
CompositionalDescription(relationVocabulary.inheres_in());
cd.addArgument(quality);
cd.addArgument(entity);

CompositionalDescriptionQueryTerm cdqt = new
CompositionalDescriptionQueryTerm(cd);

Collection<Statements> stmts = obdsql.getStatementsByQuery(cdqt);

RESULT: Returns statements of the form "Entity^inheres_in(Quality^....)
[^towards...]" but none of the statements mention the taxon which
encodes this combination

Is there an easier way to search for taxon nodes that are the sources
of "encodes" edges pointing to specific target nodes (which may or may
not be a compositional description)?

Thanks and regards,

Cartik

Chris Mungall

unread,
Sep 25, 2008, 4:50:08 PM9/25/08
to obd...@googlegroups.com

this is fetching all statements about the CD - you want annotations to
the CD

try this:

Collection<Statements> stmts = obdsql.getStatementsByQuery(new
AnnotationLinkQueryTerm(cdqt));

see:
http://www.berkeleybop.org/obd/docs/org/obd/query/AnnotationLinkQueryTerm.html

Can you add a junit for your desired behavior?

car...@nescent.org

unread,
Sep 25, 2008, 6:15:05 PM9/25/08
to obd-dev
Chris.

Given a statement from OBD Phenocape looks like

<Taxon> encodes (<Quality> inheres_in <Entity>)

I want to run a query like

?x encodes (<Quality> inheres_in <Entity>)

that returns values for ?x.

When I run the getStatementsByQuery method on the OBDSQLShard
instance, I suspect I'm running the
query

(<Quality> inheres_in <Entity>) ?R ?y

which is not really what I'm looking for.
> see:http://www.berkeleybop.org/obd/docs/org/obd/query/AnnotationLinkQuery...

Chris Mungall

unread,
Sep 25, 2008, 7:10:06 PM9/25/08
to obd...@googlegroups.com

On Sep 25, 2008, at 3:15 PM, car...@nescent.org wrote:

>
> Chris.
>
> Given a statement from OBD Phenocape looks like
>
> <Taxon> encodes (<Quality> inheres_in <Entity>)
>
> I want to run a query like
>
> ?x encodes (<Quality> inheres_in <Entity>)
>
> that returns values for ?x.
>
> When I run the getStatementsByQuery method on the OBDSQLShard
> instance, I suspect I'm running the
> query
>
> (<Quality> inheres_in <Entity>) ?R ?y
>
> which is not really what I'm looking for.

Yes, this is correct, your original query was doing this. The query I
suggest below should give you what you need

Reply all
Reply to author
Forward
0 new messages