Vocabularies with terms from other ontologies

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Vocabularies with terms from other ontologies

Stephen Ficklin-2
Hi All,

We're working on an OWL parser for Tripal.  Specifically we are trying
to load the new Relationship Ontology (RO).   This ontology includes
terms from other ontologies.  There's no problem importing these
dependent ontologies.   But, Chado does not have a direct way to include
terms from one vocabulary in another.   Here are some options I came up
with:

1) Make note of the inclusion in the cvtermprop table
2) Create a new custom cvterm_cv table to associate terms from one
vocabulary with another
3) Duplicate the term in both vocabularies.

There are issues with all 3 methods.  I don't care for option 1 as the
association isn't really a property of the term.  I also don't like
option 3 because if the term is updated in the parent vocabulary the
changes are not reflected in the copy.  My favorite option is 2 but the
fill_cvtermpath() function will not create a complete representation of
the vocabulary in the cvtermpath table. We could replace this function
with a version that can use a new cvterm_cv table.

Are there any objections to using option2?  Does anyone have other ideas
that may work?

Thanks,
Stephen

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Gmod-schema mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-schema
Reply | Threaded
Open this post in threaded view
|

Re: Vocabularies with terms from other ontologies

valentin.guignon-2
Hi Stephen and the list,



Solution 3) does not require any change in the existing schema
(cvterm_relationship table could be used for the link) but as you
mentionned, vocabulary updates may rise some issues. However, we can
think of a table trigger that could automatically propagate such an
update of the relationship between those terms when its type is 'copy
of' (or whatever you want to name that relation type).
Here is my idea of such a trigger (not tested):
----------
CREATE OR REPLACE FUNCTION cvterm_multicv_update() RETURNS TRIGGER AS
$code$
   DECLARE
     copy_cvterm RECORD;
   BEGIN
     UPDATE cvterm cvt
       SET name = NEW.name
       FROM cvterm_relationship cr
         JOIN cvterm rtype ON rtype.cvterm_id = cr.type_id AND
rtype.name = 'copy of'
       WHERE cvt.name != NEW.name
         AND ((cr.subject_id = NEW.cvterm_id AND cr.object_id =
cvt.cvterm_id)
              OR (cr.subject_id = cvt.cvterm_id AND cr.object_id =
NEW.cvterm_id))
       ;
     RETURN NEW;
   END
$code$
LANGUAGE plpgsql SECURITY DEFINER;

CREATE TRIGGER cvterm_multicv_update_u
   AFTER UPDATE ON cvterm
   FOR EACH ROW
   EXECUTE PROCEDURE cvterm_multicv_update();
----------
But this would not solve other issues like the redundancy of the term in
the database and when you want to check if a feature is tagged with a
term of a given cv through feature_cvterm, you won't find feature that
are tagged with a copy of terms of that cv. You would have to use a more
tricky query that would include copies...


About solution 2), I don't like to have a field cv_id in the
cvterm_table then. It would be confusing: is the member "cv_id" means
there is a "main" CV for a cvterm and other CV associated with cvterm_cv
are just "secondaries" CV? What if you would like to update such a
secondary CV? How would it work/how would it deal with the cvterm_cv table?
IMNSHO, I'm ok with solution 2 if we remove the field cv_id from the
cvterm table. But it would mean we loose backward compatibility.



Another solution could be to change the cvterm field "cv_id" type from
integer to integer[]. Once again, we loose backward compatibility and
people who do not know how to deal with PostgreSQL arrays would have to
learn it! http://www.postgresql.org/docs/9.3/static/arrays.html



As discussed at PAG2016, I think Chado schema needs a global rethinking.
Chado v2.0? ;-p



    Val


Le 12/04/2016 17:48, Stephen Ficklin a écrit :

> Hi All,
>
> We're working on an OWL parser for Tripal.  Specifically we are trying
> to load the new Relationship Ontology (RO).   This ontology includes
> terms from other ontologies.  There's no problem importing these
> dependent ontologies.   But, Chado does not have a direct way to include
> terms from one vocabulary in another.   Here are some options I came up
> with:
>
> 1) Make note of the inclusion in the cvtermprop table
> 2) Create a new custom cvterm_cv table to associate terms from one
> vocabulary with another
> 3) Duplicate the term in both vocabularies.
>
> There are issues with all 3 methods.  I don't care for option 1 as the
> association isn't really a property of the term.  I also don't like
> option 3 because if the term is updated in the parent vocabulary the
> changes are not reflected in the copy.  My favorite option is 2 but the
> fill_cvtermpath() function will not create a complete representation of
> the vocabulary in the cvtermpath table. We could replace this function
> with a version that can use a new cvterm_cv table.
>
> Are there any objections to using option2?  Does anyone have other ideas
> that may work?
>
> Thanks,
> Stephen
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> Gmod-schema mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-schema
>

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Gmod-schema mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-schema
Reply | Threaded
Open this post in threaded view
|

Re: Vocabularies with terms from other ontologies

Chris Mungall
In reply to this post by Stephen Ficklin-2
Hi Stephen,

A couple of pointers to OWL parsers:

  - don't target the XML, this is 2 levels of abstraction too low. I can
guarantee anything you write here will likely break
  - targeting the RDF level of abstraction is better and there are RDF
parsers for every language. Still, it can be a low level way to view OWL
and there are many gotchas
  - using an OWL API is best. Unfortunately there is only the java
OWLAPI, so if you aren't in a JVM language this is harder

We may have a standard JSON/YAML that is OWL-complete in the future that
would be a better target. Having said that, a JVM language is a good
choice for a Chado ontology loader due to access to reasoners (e.g.
cvtermpath).

With the syntactic issues aside, there is still the issue of how to map
different kinds of OWL axioms to relationships. I recommend following
the same mapping we do for graph databases documented here:
https://github.com/SciCrunch/SciGraph/wiki/

As for RO, there is always the solution of tailoring the RO release for
Chado, thanks for contributing to the discussion here:
https://github.com/oborel/obo-relations/issues/68

For your solutions below, I like 2 best.

On 12 Apr 2016, at 8:48, Stephen Ficklin wrote:

> Hi All,
>
> We're working on an OWL parser for Tripal.  Specifically we are trying
> to load the new Relationship Ontology (RO).   This ontology includes
> terms from other ontologies.  There's no problem importing these
> dependent ontologies.   But, Chado does not have a direct way to
> include
> terms from one vocabulary in another.   Here are some options I came
> up
> with:
>
> 1) Make note of the inclusion in the cvtermprop table
> 2) Create a new custom cvterm_cv table to associate terms from one
> vocabulary with another
> 3) Duplicate the term in both vocabularies.
>
> There are issues with all 3 methods.  I don't care for option 1 as the
> association isn't really a property of the term.  I also don't like
> option 3 because if the term is updated in the parent vocabulary the
> changes are not reflected in the copy.  My favorite option is 2 but
> the
> fill_cvtermpath() function will not create a complete representation
> of
> the vocabulary in the cvtermpath table. We could replace this function
> with a version that can use a new cvterm_cv table.
>
> Are there any objections to using option2?  Does anyone have other
> ideas
> that may work?
>
> Thanks,
> Stephen
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications
> Manager
> Applications Manager provides deep performance insights into multiple
> tiers of
> your business applications. It resolves application problems quickly
> and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> Gmod-schema mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-schema

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Gmod-schema mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-schema
Reply | Threaded
Open this post in threaded view
|

Re: Vocabularies with terms from other ontologies

Siddhartha Basu
Hi Stephen,
For my solution,
As discussed in the github issue mentioned below
https://github.com/oborel/obo-relations/issues/68
I took a much low key approach(standing on shoulder of giant) by try to
solve it on the file level. Using owltools,  the makefile here
https://github.com/oborel/obo-relations/pull/95/commits/966f0826cf139396766f48c7ea51754dd09915cf 
serializes(import/merge etc) all terms to *ro* namespace along with
removing cross ontology terms. The resultant obo file is loadable in
in current chado. I did some minor modifications in my fork for the time
being until the piece get merged in master.
Now to understand your direct owl based approach i wonder what are
key differences ....
* ro.owl gets terms from bfo.owl(defined in core.owl). Which namespace
  you are using for that, *ro* or something else. owltools merge process brings
  everything to a unified *ro* namespace.
* Are you filtering or keeping the cross-ontology terms(GO/PATO). If you
  are keeping them what advantages does it provide or in other words
  what am i going to miss if i don't have them loaded with *ro*.
  I am asking this because in my process,  owltools filter them out.
And frankly, your approach(particularly 2) is interesting for me and
which in turn actually touches a broader problem. As lot of the
ontologies are switching to a semantic owl path(obo is just for compatibility),
how much of it we really need to represent them in chado.
* Cross importing of other ontology in owl. How do i know which ontology
  is needed for data representation in chado(need to load) and which
  one in needed for ontology development(need to discard).
* If we somehow figure that out, how do i solve the dependencies at
  runtime.
* Last but not least, what kind of tools/lib support we have for
  managing this. From the top of my head, json-ld is a good
  representation of rdf that has multiple language bindings, but i don't
  how much of it help it could provide in case of handling owl.

thanks,
-siddhartha


 
 




On Tue, 12 Apr 2016, Chris Mungall wrote:

> Hi Stephen,
>
> A couple of pointers to OWL parsers:
>
>   - don't target the XML, this is 2 levels of abstraction too low. I can
> guarantee anything you write here will likely break
>   - targeting the RDF level of abstraction is better and there are RDF
> parsers for every language. Still, it can be a low level way to view OWL
> and there are many gotchas
>   - using an OWL API is best. Unfortunately there is only the java
> OWLAPI, so if you aren't in a JVM language this is harder
>
> We may have a standard JSON/YAML that is OWL-complete in the future that
> would be a better target. Having said that, a JVM language is a good
> choice for a Chado ontology loader due to access to reasoners (e.g.
> cvtermpath).
>
> With the syntactic issues aside, there is still the issue of how to map
> different kinds of OWL axioms to relationships. I recommend following
> the same mapping we do for graph databases documented here:
> https://github.com/SciCrunch/SciGraph/wiki/
>
> As for RO, there is always the solution of tailoring the RO release for
> Chado, thanks for contributing to the discussion here:
> https://github.com/oborel/obo-relations/issues/68
>
> For your solutions below, I like 2 best.
>
> On 12 Apr 2016, at 8:48, Stephen Ficklin wrote:
>
> > Hi All,
> >
> > We're working on an OWL parser for Tripal.  Specifically we are trying
> > to load the new Relationship Ontology (RO).   This ontology includes
> > terms from other ontologies.  There's no problem importing these
> > dependent ontologies.   But, Chado does not have a direct way to
> > include
> > terms from one vocabulary in another.   Here are some options I came
> > up
> > with:
> >
> > 1) Make note of the inclusion in the cvtermprop table
> > 2) Create a new custom cvterm_cv table to associate terms from one
> > vocabulary with another
> > 3) Duplicate the term in both vocabularies.
> >
> > There are issues with all 3 methods.  I don't care for option 1 as the
> > association isn't really a property of the term.  I also don't like
> > option 3 because if the term is updated in the parent vocabulary the
> > changes are not reflected in the copy.  My favorite option is 2 but
> > the
> > fill_cvtermpath() function will not create a complete representation
> > of
> > the vocabulary in the cvtermpath table. We could replace this function
> > with a version that can use a new cvterm_cv table.
> >
> > Are there any objections to using option2?  Does anyone have other
> > ideas
> > that may work?
> >
> > Thanks,
> > Stephen
> >
> > ------------------------------------------------------------------------------
> > Find and fix application performance issues faster with Applications
> > Manager
> > Applications Manager provides deep performance insights into multiple
> > tiers of
> > your business applications. It resolves application problems quickly
> > and
> > reduces your MTTR. Get your free trial!
> > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> > _______________________________________________
> > Gmod-schema mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gmod-schema
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> Gmod-schema mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-schema

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Gmod-schema mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-schema