Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » sbml-interoperability » question about CVTerms
Show: Today's Posts  :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
AuthorTopic
Allyson Lister


Posts: 88
Registered:
December 2007
question about CVTerms 09 Sep '09 03:00 Go to next message

Hi all,

I've had some odd behaviour with my CVTerms, and was wondering if someone
could tell me what I was doing wrong. :)

(Jaunty, libsbml4.0.0, Java version of libsbml)

Basically, I'm trying to create some new CVTerms and add them to the model
element. However, I'm in a method that only knows that model element is an
SBase object.

// retrieveCVTerm adds qualifiertype and either modelqualifiertype or
biologicalqualifiertype, depending.
// In this case it adds a modelqualifiertype as described by the second
argument
// It then sends back the cvTerm created. While it uses the sBase object, it
DOES NOT modify it.
CVTerm cvTerm = retrieveCVTerm( sBase,
libsbmlConstants.MODEL_QUALIFIER, key );
// add uri to cvTerm
cvTerm.addResource( bqm );
System.err.println( "cvTerm.getNumResources() m = " +
cvTerm.getNumResources() );
int returnvalue = sBase.addCVTerm( cvTerm );
System.err.println( "sBase.getNumCVTerms() m : " +
sBase.getNumCVTerms() );
System.err.println( "Return value: " + returnvalue );
if ( returnvalue ==
libsbmlConstants.LIBSBML_OPERATION_SUCCESS ) {
System.err.println( "return value OK." );
} else if ( returnvalue ==
libsbmlConstants.LIBSBML_OPERATION_FAILED ) {
System.err.println( "addition failed." );
} else {
System.err.println( "Unknown error value" );
}

However, no matter how I run this, the CVTerm simply isn't getting added to
the sBase object, as evidenced by the output:

cvTerm.getNumResources() m = 1
sBase.getNumCVTerms() m : 0

When I try to load model qualifiers, the error value is odd:
Return value: -2
Unknown error value

When I try to use the same code, but for biological qualifiers, the error
value is OK, *but* the CVTerm still isn't added to the sBase object:
Return value: 0
return value OK.


And the resulting SBML file does not have any MIRIAM annotations. The cvTerm
object is created, then added to sBase, but somehow the addition is failing.

The docs (
http://sbml.org/Software/libSBML/docs/cpp-api/class_c_v_term.html#567c2728d8b1a9d7ee2b34ffc00a7f67)
say the only possible return values are
libsbmlConstants.LIBSBML_OPERATION_FAILED or
libsbmlConstants.LIBSBML_OPERATION_SUCCESS, but from the message above, it
looks like neither values are returned.

Any help would be most appreciated!

Thanks!

--
Allyson Lister
http://themindwobbles.wordpress.com

CISBAN, http://www.cisban.ac.uk
Newcastle University
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Sarah Keating


Posts: 417
Registered:
May 2004
Re: question about CVTerms 09 Sep '09 04:46 Go to previous messageGo to next message

Hi Allyson

I think we have a break down in documentation :-)

The return value -2 will be returned if the object on which you are
attempting to set the CVTerm has no metaid value. The annotation is
required to refer to the metaid and thus it doesn't make sense to add
the CVTerm if the object has no metaid set.

Sarah

Allyson Lister wrote:
> Hi all,
>
> I've had some odd behaviour with my CVTerms, and was wondering if someone
> could tell me what I was doing wrong. :)
>
> (Jaunty, libsbml4.0.0, Java version of libsbml)
>
> Basically, I'm trying to create some new CVTerms and add them to the model
> element. However, I'm in a method that only knows that model element is an
> SBase object.
>
> // retrieveCVTerm adds qualifiertype and either modelqualifiertype or
> biologicalqualifiertype, depending.
> // In this case it adds a modelqualifiertype as described by the second
> argument
> // It then sends back the cvTerm created. While it uses the sBase object, it
> DOES NOT modify it.
> CVTerm cvTerm = retrieveCVTerm( sBase,
> libsbmlConstants.MODEL_QUALIFIER, key );
> // add uri to cvTerm
> cvTerm.addResource( bqm );
> System.err.println( "cvTerm.getNumResources() m = " +
> cvTerm.getNumResources() );
> int returnvalue = sBase.addCVTerm( cvTerm );
> System.err.println( "sBase.getNumCVTerms() m : " +
> sBase.getNumCVTerms() );
> System.err.println( "Return value: " + returnvalue );
> if ( returnvalue ==
> libsbmlConstants.LIBSBML_OPERATION_SUCCESS ) {
> System.err.println( "return value OK." );
> } else if ( returnvalue ==
> libsbmlConstants.LIBSBML_OPERATION_FAILED ) {
> System.err.println( "addition failed." );
> } else {
> System.err.println( "Unknown error value" );
> }
>
> However, no matter how I run this, the CVTerm simply isn't getting added to
> the sBase object, as evidenced by the output:
>
> cvTerm.getNumResources() m = 1
> sBase.getNumCVTerms() m : 0
>
> When I try to load model qualifiers, the error value is odd:
> Return value: -2
> Unknown error value
>
> When I try to use the same code, but for biological qualifiers, the error
> value is OK, *but* the CVTerm still isn't added to the sBase object:
> Return value: 0
> return value OK.
>
>
> And the resulting SBML file does not have any MIRIAM annotations. The cvTerm
> object is created, then added to sBase, but somehow the addition is failing.
>
> The docs (
> http://sbml.org/Software/libSBML/docs/cpp-api/class_c_v_term.html#567c2728d8b1a9d7ee2b34ffc00a7f67)
> say the only possible return values are
> libsbmlConstants.LIBSBML_OPERATION_FAILED or
> libsbmlConstants.LIBSBML_OPERATION_SUCCESS, but from the message above, it
> looks like neither values are returned.
>
> Any help would be most appreciated!
>
> Thanks!
>

____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Allyson Lister


Posts: 88
Registered:
December 2007
Re: question about CVTerms 09 Sep '09 05:10 Go to previous messageGo to next message

Hi Sarah,

Thanks a lot for the tip - I completely forgot about the metaid! And it's
good to know the -2 is valid and what it means, even if it's not yet in the
docs.

Thanks! :)

2009/9/9 Sarah Keating <skeating@caltech.edu>

> Hi Allyson
>
> I think we have a break down in documentation :-)
>
> The return value -2 will be returned if the object on which you are
> attempting to set the CVTerm has no metaid value. The annotation is
> required to refer to the metaid and thus it doesn't make sense to add
> the CVTerm if the object has no metaid set.
>
> Sarah
>
> Allyson Lister wrote:
> > Hi all,
> >
> > I've had some odd behaviour with my CVTerms, and was wondering if someone
> > could tell me what I was doing wrong. :)
> >
> > (Jaunty, libsbml4.0.0, Java version of libsbml)
> >
> > Basically, I'm trying to create some new CVTerms and add them to the
> model
> > element. However, I'm in a method that only knows that model element is
> an
> > SBase object.
> >
> > // retrieveCVTerm adds qualifiertype and either modelqualifiertype or
> > biologicalqualifiertype, depending.
> > // In this case it adds a modelqualifiertype as described by the second
> > argument
> > // It then sends back the cvTerm created. While it uses the sBase object,
> it
> > DOES NOT modify it.
> > CVTerm cvTerm = retrieveCVTerm( sBase,
> > libsbmlConstants.MODEL_QUALIFIER, key );
> > // add uri to cvTerm
> > cvTerm.addResource( bqm );
> > System.err.println( "cvTerm.getNumResources() m = " +
> > cvTerm.getNumResources() );
> > int returnvalue = sBase.addCVTerm( cvTerm );
> > System.err.println( "sBase.getNumCVTerms() m : " +
> > sBase.getNumCVTerms() );
> > System.err.println( "Return value: " + returnvalue );
> > if ( returnvalue ==
> > libsbmlConstants.LIBSBML_OPERATION_SUCCESS ) {
> > System.err.println( "return value OK." );
> > } else if ( returnvalue ==
> > libsbmlConstants.LIBSBML_OPERATION_FAILED ) {
> > System.err.println( "addition failed." );
> > } else {
> > System.err.println( "Unknown error value" );
> > }
> >
> > However, no matter how I run this, the CVTerm simply isn't getting added
> to
> > the sBase object, as evidenced by the output:
> >
> > cvTerm.getNumResources() m = 1
> > sBase.getNumCVTerms() m : 0
> >
> > When I try to load model qualifiers, the error value is odd:
> > Return value: -2
> > Unknown error value
> >
> > When I try to use the same code, but for biological qualifiers, the error
> > value is OK, *but* the CVTerm still isn't added to the sBase object:
> > Return value: 0
> > return value OK.
> >
> >
> > And the resulting SBML file does not have any MIRIAM annotations. The
> cvTerm
> > object is created, then added to sBase, but somehow the addition is
> failing.
> >
> > The docs (
> >
> http://sbml.org/Software/libSBML/docs/cpp-api/class_c_v_term.html#567c2728d8b1a9d7ee2b34ffc00a7f67
> )
> > say the only possible return values are
> > libsbmlConstants.LIBSBML_OPERATION_FAILED or
> > libsbmlConstants.LIBSBML_OPERATION_SUCCESS, but from the message above,
> it
> > looks like neither values are returned.
> >
> > Any help would be most appreciated!
> >
> > Thanks!
> >
>
> ____________________________________________________________
> To manage your sbml-interoperability list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
>
> For a web interface to the sbml-interoperability mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the sbml-interoperability list,
> contact sbml-team@caltech.edu
>



--
Allyson Lister
http://themindwobbles.wordpress.com

CISBAN, http://www.cisban.ac.uk
Newcastle University
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Allyson Lister


Posts: 88
Registered:
December 2007
Re: question about CVTerms 17 Sep '09 01:06 Go to previous messageGo to next message

Hi all,

I have another question about CVTerms that is very similar to this one,
which is why I am replying to this thread.

I've created the attached test class (with two test methods), and every time
I add a CVTerm, it doesn't actually get added. The return value of the
addCVTerm() always comes back good, in both methods, but the assertion that
the number of CVTerms is 4 doesn't work - it always says its 1.

I'm trying to reproduce the style of annotation we find in BioModels, where
the ultimate annotation should look like:

<bqbiol:isVersionOf>
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.1"/>
</rdf:bag>
</bqbiol:isVersionOf>
<bqbiol:isVersionOf>
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.2"/>
</rdf:bag>
</bqbiol:isVersionOf>
<bqbiol:isVersionOf>
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.3"/>
</rdf:bag>
</bqbiol:isVersionOf>
<bqbiol:isVersionOf>
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.4"/>
</rdf:bag>
</bqbiol:isVersionOf>

Yes, that is virtually the same annotation repeated 4 times, but conceivably
this could happen. Why is only one CVTerm getting added in both test
methods?

thanks :)
Allyson

2009/9/9 Allyson Lister <allyson.lurena@googlemail.com>

> Hi Sarah,
>
> Thanks a lot for the tip - I completely forgot about the metaid! And it's
> good to know the -2 is valid and what it means, even if it's not yet in the
> docs.
>
> Thanks! :)
>
> 2009/9/9 Sarah Keating <skeating@caltech.edu>
>
> Hi Allyson
>>
>> I think we have a break down in documentation :-)
>>
>> The return value -2 will be returned if the object on which you are
>> attempting to set the CVTerm has no metaid value. The annotation is
>> required to refer to the metaid and thus it doesn't make sense to add
>> the CVTerm if the object has no metaid set.
>>
>> Sarah
>>
>> Allyson Lister wrote:
>> > Hi all,
>> >
>> > I've had some odd behaviour with my CVTerms, and was wondering if
>> someone
>> > could tell me what I was doing wrong. :)
>> >
>> > (Jaunty, libsbml4.0.0, Java version of libsbml)
>> >
>> > Basically, I'm trying to create some new CVTerms and add them to the
>> model
>> > element. However, I'm in a method that only knows that model element is
>> an
>> > SBase object.
>> >
>> > // retrieveCVTerm adds qualifiertype and either modelqualifiertype or
>> > biologicalqualifiertype, depending.
>> > // In this case it adds a modelqualifiertype as described by the second
>> > argument
>> > // It then sends back the cvTerm created. While it uses the sBase
>> object, it
>> > DOES NOT modify it.
>> > CVTerm cvTerm = retrieveCVTerm( sBase,
>> > libsbmlConstants.MODEL_QUALIFIER, key );
>> > // add uri to cvTerm
>> > cvTerm.addResource( bqm );
>> > System.err.println( "cvTerm.getNumResources() m = "
>> +
>> > cvTerm.getNumResources() );
>> > int returnvalue = sBase.addCVTerm( cvTerm );
>> > System.err.println( "sBase.getNumCVTerms() m : " +
>> > sBase.getNumCVTerms() );
>> > System.err.println( "Return value: " + returnvalue
>> );
>> > if ( returnvalue ==
>> > libsbmlConstants.LIBSBML_OPERATION_SUCCESS ) {
>> > System.err.println( "return value OK." );
>> > } else if ( returnvalue ==
>> > libsbmlConstants.LIBSBML_OPERATION_FAILED ) {
>> > System.err.println( "addition failed." );
>> > } else {
>> > System.err.println( "Unknown error value" );
>> > }
>> >
>> > However, no matter how I run this, the CVTerm simply isn't getting added
>> to
>> > the sBase object, as evidenced by the output:
>> >
>> > cvTerm.getNumResources() m = 1
>> > sBase.getNumCVTerms() m : 0
>> >
>> > When I try to load model qualifiers, the error value is odd:
>> > Return value: -2
>> > Unknown error value
>> >
>> > When I try to use the same code, but for biological qualifiers, the
>> error
>> > value is OK, *but* the CVTerm still isn't added to the sBase object:
>> > Return value: 0
>> > return value OK.
>> >
>> >
>> > And the resulting SBML file does not have any MIRIAM annotations. The
>> cvTerm
>> > object is created, then added to sBase, but somehow the addition is
>> failing.
>> >
>> > The docs (
>> >
>> http://sbml.org/Software/libSBML/docs/cpp-api/class_c_v_term.html#567c2728d8b1a9d7ee2b34ffc00a7f67
>> )
>> > say the only possible return values are
>> > libsbmlConstants.LIBSBML_OPERATION_FAILED or
>> > libsbmlConstants.LIBSBML_OPERATION_SUCCESS, but from the message above,
>> it
>> > looks like neither values are returned.
>> >
>> > Any help would be most appreciated!
>> >
>> > Thanks!
>> >
>>
>> ____________________________________________________________
>> To manage your sbml-interoperability list subscription, visit
>> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
>>
>> For a web interface to the sbml-interoperability mailing list, visit
>> http://sbml.org/Forums/
>>
>> For questions or feedback about the sbml-interoperability list,
>> contact sbml-team@caltech.edu
>>
>
>
>
> --
> Allyson Lister
> http://themindwobbles.wordpress.com
>
> CISBAN, http://www.cisban.ac.uk
> Newcastle University
>



--
Allyson Lister
http://themindwobbles.wordpress.com

CISBAN, http://www.cisban.ac.uk
Newcastle University

Attachment: AddCVTermsTest.java
(Size: 3.13KB, Downloaded 185 time(s))
      
Sarah Keating


Posts: 417
Registered:
May 2004
Re: question about CVTerms 17 Sep '09 02:09 Go to previous messageGo to next message

Hi Allyson

When you add a CVTerm libSBML tries to be clever and if there is a
annotation of that type already it will add the resource. So you are getting

<bqbiol:isVersionOf>
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.1"/>
<rdf:li rdf:resource="http://some.uri.thing.2"/>
<rdf:li rdf:resource="http://some.uri.thing.3"/>
<rdf:li rdf:resource="http://some.uri.thing.4"/>
</rdf:bag>
</bqbiol:isVersionOf>

which is 1 CVTerm with 4 resources :-)

Sarah

Allyson Lister wrote:
> Hi all,
>
> I have another question about CVTerms that is very similar to this one,
> which is why I am replying to this thread.
>
> I've created the attached test class (with two test methods), and every time
> I add a CVTerm, it doesn't actually get added. The return value of the
> addCVTerm() always comes back good, in both methods, but the assertion that
> the number of CVTerms is 4 doesn't work - it always says its 1.
>
> I'm trying to reproduce the style of annotation we find in BioModels, where
> the ultimate annotation should look like:
>
> <bqbiol:isVersionOf>
> <rdf:bag>
> <rdf:li rdf:resource="http://some.uri.thing.1"/>
> </rdf:bag>
> </bqbiol:isVersionOf>
> <bqbiol:isVersionOf>
> <rdf:bag>
> <rdf:li rdf:resource="http://some.uri.thing.2"/>
> </rdf:bag>
> </bqbiol:isVersionOf>
> <bqbiol:isVersionOf>
> <rdf:bag>
> <rdf:li rdf:resource="http://some.uri.thing.3"/>
> </rdf:bag>
> </bqbiol:isVersionOf>
> <bqbiol:isVersionOf>
> <rdf:bag>
> <rdf:li rdf:resource="http://some.uri.thing.4"/>
> </rdf:bag>
> </bqbiol:isVersionOf>
>
> Yes, that is virtually the same annotation repeated 4 times, but conceivably
> this could happen. Why is only one CVTerm getting added in both test
> methods?
>
> thanks :)
> Allyson
>
> 2009/9/9 Allyson Lister <allyson.lurena@googlemail.com>
>
>> Hi Sarah,
>>
>> Thanks a lot for the tip - I completely forgot about the metaid! And it's
>> good to know the -2 is valid and what it means, even if it's not yet in the
>> docs.
>>
>> Thanks! :)
>>
>> 2009/9/9 Sarah Keating <skeating@caltech.edu>
>>
>> Hi Allyson
>>> I think we have a break down in documentation :-)
>>>
>>> The return value -2 will be returned if the object on which you are
>>> attempting to set the CVTerm has no metaid value. The annotation is
>>> required to refer to the metaid and thus it doesn't make sense to add
>>> the CVTerm if the object has no metaid set.
>>>
>>> Sarah
>>>
>>> Allyson Lister wrote:
>>>> Hi all,
>>>>
>>>> I've had some odd behaviour with my CVTerms, and was wondering if
>>> someone
>>>> could tell me what I was doing wrong. :)
>>>>
>>>> (Jaunty, libsbml4.0.0, Java version of libsbml)
>>>>
>>>> Basically, I'm trying to create some new CVTerms and add them to the
>>> model
>>>> element. However, I'm in a method that only knows that model element is
>>> an
>>>> SBase object.
>>>>
>>>> // retrieveCVTerm adds qualifiertype and either modelqualifiertype or
>>>> biologicalqualifiertype, depending.
>>>> // In this case it adds a modelqualifiertype as described by the second
>>>> argument
>>>> // It then sends back the cvTerm created. While it uses the sBase
>>> object, it
>>>> DOES NOT modify it.
>>>> CVTerm cvTerm = retrieveCVTerm( sBase,
>>>> libsbmlConstants.MODEL_QUALIFIER, key );
>>>> // add uri to cvTerm
>>>> cvTerm.addResource( bqm );
>>>> System.err.println( "cvTerm.getNumResources() m = "
>>> +
>>>> cvTerm.getNumResources() );
>>>> int returnvalue = sBase.addCVTerm( cvTerm );
>>>> System.err.println( "sBase.getNumCVTerms() m : " +
>>>> sBase.getNumCVTerms() );
>>>> System.err.println( "Return value: " + returnvalue
>>> );
>>>> if ( returnvalue ==
>>>> libsbmlConstants.LIBSBML_OPERATION_SUCCESS ) {
>>>> System.err.println( "return value OK." );
>>>> } else if ( returnvalue ==
>>>> libsbmlConstants.LIBSBML_OPERATION_FAILED ) {
>>>> System.err.println( "addition failed." );
>>>> } else {
>>>> System.err.println( "Unknown error value" );
>>>> }
>>>>
>>>> However, no matter how I run this, the CVTerm simply isn't getting added
>>> to
>>>> the sBase object, as evidenced by the output:
>>>>
>>>> cvTerm.getNumResources() m = 1
>>>> sBase.getNumCVTerms() m : 0
>>>>
>>>> When I try to load model qualifiers, the error value is odd:
>>>> Return value: -2
>>>> Unknown error value
>>>>
>>>> When I try to use the same code, but for biological qualifiers, the
>>> error
>>>> value is OK, *but* the CVTerm still isn't added to the sBase object:
>>>> Return value: 0
>>>> return value OK.
>>>>
>>>>
>>>> And the resulting SBML file does not have any MIRIAM annotations. The
>>> cvTerm
>>>> object is created, then added to sBase, but somehow the addition is
>>> failing.
>>>> The docs (
>>>>
>>> http://sbml.org/Software/libSBML/docs/cpp-api/class_c_v_term.html#567c2728d8b1a9d7ee2b34ffc00a7f67
>>> )
>>>> say the only possible return values are
>>>> libsbmlConstants.LIBSBML_OPERATION_FAILED or
>>>> libsbmlConstants.LIBSBML_OPERATION_SUCCESS, but from the message above,
>>> it
>>>> looks like neither values are returned.
>>>>
>>>> Any help would be most appreciated!
>>>>
>>>> Thanks!
>>>>
>>> ____________________________________________________________
>>> To manage your sbml-interoperability list subscription, visit
>>> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
>>>
>>> For a web interface to the sbml-interoperability mailing list, visit
>>> http://sbml.org/Forums/
>>>
>>> For questions or feedback about the sbml-interoperability list,
>>> contact sbml-team@caltech.edu
>>>
>>
>>
>> --
>> Allyson Lister
>> http://themindwobbles.wordpress.com
>>
>> CISBAN, http://www.cisban.ac.uk
>> Newcastle University
>>
>
>
>
>
> ------------------------------------------------------------------------
>
> ____________________________________________________________
> To manage your sbml-interoperability list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
>
> For a web interface to the sbml-interoperability mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the sbml-interoperability list,
> contact sbml-team@caltech.edu

____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Allyson Lister


Posts: 88
Registered:
December 2007
Re: question about CVTerms 17 Sep '09 02:19 Go to previous messageGo to next message

Hi Sarah,

This is great, and up until this week this is exactly the behavior I
expected and wanted. :) However....

... due to what Nicolas has been saying lately about the possibility of
having the 4 separate CVTerms written deliberately by a curator (see
http://sourceforge.net/mailarchive/forum.php?thread_name=841ae00909160500l1c438726ic939853425c1c9ca%40mail.gmail.com&forum_name=biomodels-net-discuss,
if that link works) , I need to be able to explictly state that they're
separate... Sort of frustrating, but there you are. It's in 6.5 of the spec
and in the guidelines for biomodels annotators (
http://www.ebi.ac.uk/biomodels-main/annotationtips), and I'm trying to do
that with libsbml...

Is there a way to let libSBML know that I don't want it to be clever? :)

Thanks!
Allyson

2009/9/17 Sarah Keating <skeating@caltech.edu>

> Hi Allyson
>
> When you add a CVTerm libSBML tries to be clever and if there is a
> annotation of that type already it will add the resource. So you are
> getting
>
> <bqbiol:isVersionOf>
> <rdf:bag>
> <rdf:li rdf:resource="http://some.uri.thing.1"/>
> <rdf:li rdf:resource="http://some.uri.thing.2"/>
> <rdf:li rdf:resource="http://some.uri.thing.3"/>
> <rdf:li rdf:resource="http://some.uri.thing.4"/>
> </rdf:bag>
> </bqbiol:isVersionOf>
>
> which is 1 CVTerm with 4 resources :-)
>
> Sarah
>
> Allyson Lister wrote:
> > Hi all,
> >
> > I have another question about CVTerms that is very similar to this one,
> > which is why I am replying to this thread.
> >
> > I've created the attached test class (with two test methods), and every
> time
> > I add a CVTerm, it doesn't actually get added. The return value of the
> > addCVTerm() always comes back good, in both methods, but the assertion
> that
> > the number of CVTerms is 4 doesn't work - it always says its 1.
> >
> > I'm trying to reproduce the style of annotation we find in BioModels,
> where
> > the ultimate annotation should look like:
> >
> > <bqbiol:isVersionOf>
> > <rdf:bag>
> > <rdf:li rdf:resource="http://some.uri.thing.1"/>
> > </rdf:bag>
> > </bqbiol:isVersionOf>
> > <bqbiol:isVersionOf>
> > <rdf:bag>
> > <rdf:li rdf:resource="http://some.uri.thing.2"/>
> > </rdf:bag>
> > </bqbiol:isVersionOf>
> > <bqbiol:isVersionOf>
> > <rdf:bag>
> > <rdf:li rdf:resource="http://some.uri.thing.3"/>
> > </rdf:bag>
> > </bqbiol:isVersionOf>
> > <bqbiol:isVersionOf>
> > <rdf:bag>
> > <rdf:li rdf:resource="http://some.uri.thing.4"/>
> > </rdf:bag>
> > </bqbiol:isVersionOf>
> >
> > Yes, that is virtually the same annotation repeated 4 times, but
> conceivably
> > this could happen. Why is only one CVTerm getting added in both test
> > methods?
> >
> > thanks :)
> > Allyson
> >
> > 2009/9/9 Allyson Lister <allyson.lurena@googlemail.com>
> >
> >> Hi Sarah,
> >>
> >> Thanks a lot for the tip - I completely forgot about the metaid! And
> it's
> >> good to know the -2 is valid and what it means, even if it's not yet in
> the
> >> docs.
> >>
> >> Thanks! :)
> >>
> >> 2009/9/9 Sarah Keating <skeating@caltech.edu>
> >>
> >> Hi Allyson
> >>> I think we have a break down in documentation :-)
> >>>
> >>> The return value -2 will be returned if the object on which you are
> >>> attempting to set the CVTerm has no metaid value. The annotation is
> >>> required to refer to the metaid and thus it doesn't make sense to add
> >>> the CVTerm if the object has no metaid set.
> >>>
> >>> Sarah
> >>>
> >>> Allyson Lister wrote:
> >>>> Hi all,
> >>>>
> >>>> I've had some odd behaviour with my CVTerms, and was wondering if
> >>> someone
> >>>> could tell me what I was doing wrong. :)
> >>>>
> >>>> (Jaunty, libsbml4.0.0, Java version of libsbml)
> >>>>
> >>>> Basically, I'm trying to create some new CVTerms and add them to the
> >>> model
> >>>> element. However, I'm in a method that only knows that model element
> is
> >>> an
> >>>> SBase object.
> >>>>
> >>>> // retrieveCVTerm adds qualifiertype and either modelqualifiertype or
> >>>> biologicalqualifiertype, depending.
> >>>> // In this case it adds a modelqualifiertype as described by the
> second
> >>>> argument
> >>>> // It then sends back the cvTerm created. While it uses the sBase
> >>> object, it
> >>>> DOES NOT modify it.
> >>>> CVTerm cvTerm = retrieveCVTerm( sBase,
> >>>> libsbmlConstants.MODEL_QUALIFIER, key );
> >>>> // add uri to cvTerm
> >>>> cvTerm.addResource( bqm );
> >>>> System.err.println( "cvTerm.getNumResources() m =
> "
> >>> +
> >>>> cvTerm.getNumResources() );
> >>>> int returnvalue = sBase.addCVTerm( cvTerm );
> >>>> System.err.println( "sBase.getNumCVTerms() m : " +
> >>>> sBase.getNumCVTerms() );
> >>>> System.err.println( "Return value: " + returnvalue
> >>> );
> >>>> if ( returnvalue ==
> >>>> libsbmlConstants.LIBSBML_OPERATION_SUCCESS ) {
> >>>> System.err.println( "return value OK." );
> >>>> } else if ( returnvalue ==
> >>>> libsbmlConstants.LIBSBML_OPERATION_FAILED ) {
> >>>> System.err.println( "addition failed." );
> >>>> } else {
> >>>> System.err.println( "Unknown error value" );
> >>>> }
> >>>>
> >>>> However, no matter how I run this, the CVTerm simply isn't getting
> added
> >>> to
> >>>> the sBase object, as evidenced by the output:
> >>>>
> >>>> cvTerm.getNumResources() m = 1
> >>>> sBase.getNumCVTerms() m : 0
> >>>>
> >>>> When I try to load model qualifiers, the error value is odd:
> >>>> Return value: -2
> >>>> Unknown error value
> >>>>
> >>>> When I try to use the same code, but for biological qualifiers, the
> >>> error
> >>>> value is OK, *but* the CVTerm still isn't added to the sBase object:
> >>>> Return value: 0
> >>>> return value OK.
> >>>>
> >>>>
> >>>> And the resulting SBML file does not have any MIRIAM annotations. The
> >>> cvTerm
> >>>> object is created, then added to sBase, but somehow the addition is
> >>> failing.
> >>>> The docs (
> >>>>
> >>>
> http://sbml.org/Software/libSBML/docs/cpp-api/class_c_v_term.html#567c2728d8b1a9d7ee2b34ffc00a7f67
> >>> )
> >>>> say the only possible return values are
> >>>> libsbmlConstants.LIBSBML_OPERATION_FAILED or
> >>>> libsbmlConstants.LIBSBML_OPERATION_SUCCESS, but from the message
> above,
> >>> it
> >>>> looks like neither values are returned.
> >>>>
> >>>> Any help would be most appreciated!
> >>>>
> >>>> Thanks!
> >>>>
> >>> ____________________________________________________________
> >>> To manage your sbml-interoperability list subscription, visit
> >>> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
> >>>
> >>> For a web interface to the sbml-interoperability mailing list, visit
> >>> http://sbml.org/Forums/
> >>>
> >>> For questions or feedback about the sbml-interoperability list,
> >>> contact sbml-team@caltech.edu
> >>>
> >>
> >>
> >> --
> >> Allyson Lister
> >> http://themindwobbles.wordpress.com
> >>
> >> CISBAN, http://www.cisban.ac.uk
> >> Newcastle University
> >>
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > ____________________________________________________________
> > To manage your sbml-interoperability list subscription, visit
> > https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
> >
> > For a web interface to the sbml-interoperability mailing list, visit
> > http://sbml.org/Forums/
> >
> > For questions or feedback about the sbml-interoperability list,
> > contact sbml-team@caltech.edu
>
> ____________________________________________________________
> To manage your sbml-interoperability list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
>
> For a web interface to the sbml-interoperability mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the sbml-interoperability list,
> contact sbml-team@caltech.edu
>



--
Allyson Lister
http://themindwobbles.wordpress.com

CISBAN, http://www.cisban.ac.uk
Newcastle University
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Sarah Keating


Posts: 417
Registered:
May 2004
Re: question about CVTerms 17 Sep '09 04:13 Go to previous messageGo to next message

> Is there a way to let libSBML know that I don't want it to be clever? :)

Unfortunately not.

We will add a flag to the addCVTerm function that will allow you to
choose whether the term is added to an existing bag or not :-)

Sarah
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Allyson Lister


Posts: 88
Registered:
December 2007
Re: question about CVTerms 17 Sep '09 04:21 Go to previous messageGo to next message

Hi Sarah,

That's great news - thanks very much.

Thanks again for the quick reply!

:) allyson

2009/9/17 Sarah Keating <skeating@caltech.edu>

> > Is there a way to let libSBML know that I don't want it to be clever? :)
>
> Unfortunately not.
>
> We will add a flag to the addCVTerm function that will allow you to
> choose whether the term is added to an existing bag or not :-)
>
> Sarah
> ____________________________________________________________
> To manage your sbml-interoperability list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
>
> For a web interface to the sbml-interoperability mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the sbml-interoperability list,
> contact sbml-team@caltech.edu
>



--
Allyson Lister
http://themindwobbles.wordpress.com

CISBAN, http://www.cisban.ac.uk
Newcastle University
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Stefan.Hoops


Posts: 170
Registered:
December 2006
Re: question about CVTerms 17 Sep '09 05:31 Go to previous messageGo to next message

Hello Sarah,

On Thu, 17 Sep 2009 10:09:11 +0100
Sarah Keating <skeating@caltech.edu> wrote:

> Hi Allyson
>
> When you add a CVTerm libSBML tries to be clever and if there is a
> annotation of that type already it will add the resource. So you are
> getting
>
> <bqbiol:isVersionOf>
> <rdf:bag>
> <rdf:li rdf:resource="http://some.uri.thing.1"/>
> <rdf:li rdf:resource="http://some.uri.thing.2"/>
> <rdf:li rdf:resource="http://some.uri.thing.3"/>
> <rdf:li rdf:resource="http://some.uri.thing.4"/>
> </rdf:bag>
> </bqbiol:isVersionOf>
>
> which is 1 CVTerm with 4 resources :-)
>

Actually :(

because from the standpoint from RDF we have for triplets:
subject: ???, predicate: bqbiol:isVersionOf, resource: ...1
subject: ???, predicate: bqbiol:isVersionOf, resource: ...2
subject: ???, predicate: bqbiol:isVersionOf, resource: ...3
subject: ???, predicate: bqbiol:isVersionOf, resource: ...4

Therfore I would expect the count of stements to be 4. The tags bag and
li are just used for convenience/human readability. They do not change
the datamodel.

Thanks,
Stefan


--
Stefan Hoops, Ph.D.
Senior Project Associate
Virginia Bioinformatics Institute - 0477
Virginia Tech
Bioinformatics Facility II
Blacksburg, Va 24061, USA

Phone: (540) 231-1799
Fax: (540) 231-2606
Email: shoops@vbi.vt.edu
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Stefan.Hoops


Posts: 170
Registered:
December 2006
Re: question about CVTerms 17 Sep '09 07:54 Go to previous messageGo to next message

Hello Sarah,

On Thu, 17 Sep 2009 12:13:51 +0100
Sarah Keating <skeating@caltech.edu> wrote:

> > Is there a way to let libSBML know that I don't want it to be
> > clever? :)
>
> Unfortunately not.
>
> We will add a flag to the addCVTerm function that will allow you to
> choose whether the term is added to an existing bag or not :-)

This is the wrong aproach. It is about formating and not about
contents. There is no difference in the meaning between the two and
libsbml MUST NOT differentiate. This is similar to not carrying about
the order of species etc.

Thanks,
Stefan


--
Stefan Hoops, Ph.D.
Senior Project Associate
Virginia Bioinformatics Institute - 0477
Virginia Tech
Bioinformatics Facility II
Blacksburg, Va 24061, USA

Phone: (540) 231-1799
Fax: (540) 231-2606
Email: shoops@vbi.vt.edu
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Allyson Lister


Posts: 88
Registered:
December 2007
Re: question about CVTerms 17 Sep '09 08:06 Go to previous messageGo to next message

Hi Stefan,

I'm confused. Nicolas tells me that there is a significant difference
between the two, and as a programmer I must be able to write things either
way. LibSBML can't do this right now.

Personally, I would rather have the two ways of writing things mean the same
thing so they are interchangeable, but I'm told by the specification and by
Nicolas that this isn't so.

Help! I'm confused :)

Thanks,
Allyson

2009/9/17 shoops <shoops@vbi.vt.edu>

> Hello Sarah,
>
> On Thu, 17 Sep 2009 12:13:51 +0100
> Sarah Keating <skeating@caltech.edu> wrote:
>
> > > Is there a way to let libSBML know that I don't want it to be
> > > clever? :)
> >
> > Unfortunately not.
> >
> > We will add a flag to the addCVTerm function that will allow you to
> > choose whether the term is added to an existing bag or not :-)
>
> This is the wrong aproach. It is about formating and not about
> contents. There is no difference in the meaning between the two and
> libsbml MUST NOT differentiate. This is similar to not carrying about
> the order of species etc.
>
> Thanks,
> Stefan
>
>
> --
> Stefan Hoops, Ph.D.
> Senior Project Associate
> Virginia Bioinformatics Institute - 0477
> Virginia Tech
> Bioinformatics Facility II
> Blacksburg, Va 24061, USA
>
> Phone: (540) 231-1799
> Fax: (540) 231-2606
> Email: shoops@vbi.vt.edu
> ____________________________________________________________
> To manage your sbml-interoperability list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
>
> For a web interface to the sbml-interoperability mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the sbml-interoperability list,
> contact sbml-team@caltech.edu
>



--
Allyson Lister
http://themindwobbles.wordpress.com

CISBAN, http://www.cisban.ac.uk
Newcastle University
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Sarah Keating


Posts: 417
Registered:
May 2004
Re: question about CVTerms 17 Sep '09 08:10 Go to previous messageGo to next message

Hi Stefan

shoops wrote:
>> We will add a flag to the addCVTerm function that will allow you to
>> choose whether the term is added to an existing bag or not :-)
>
> This is the wrong aproach. It is about formating and not about
> contents. There is no difference in the meaning between the two and
> libsbml MUST NOT differentiate

But surely if people want the option of either producing

A)

<bqbiol:hasPart >
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.1"/>
<rdf:li rdf:resource="http://some.uri.thing.2"/>
</rdf:bag>
</bqbiol:hasPart >

Or B)

<bqbiol:hasPart >
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.1"/>
</rdf:bag>
</bqbiol:hasPart >
<bqbiol:hasPart >
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.2"/>
</rdf:bag>
</bqbiol:hasPart >

it is not a problem for libSBML to offer the option ?

The SBML Spec says

"Several relation elements with a given tag, enclosed in the same SBML
element, each represent an alternative
annotation to the SBML element. For example two bqbiol:hasPart elements
within a Species SBML
element represent two different sets of references to the parts making
up the the chemical entity represented
by the species. (The species is not made up of all the entities
represented by all the references combined)."

So in fact A and B above do represent different semantics; so we would
want libSBML to support this. It doesn't actually at present :-(

Sarah
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
curoli


Posts: 97
Registered:
November 2006
Re: question about CVTerms 17 Sep '09 08:40 Go to previous messageGo to next message

Hello Stefan, All,

On Thu, Sep 17, 2009 at 8:31 AM, shoops <shoops@vbi.vt.edu> wrote:
>> <bqbiol:isVersionOf>
>> <rdf:bag>
>> <rdf:li rdf:resource="http://some.uri.thing.1"/>
>> <rdf:li rdf:resource="http://some.uri.thing.2"/>
>> <rdf:li rdf:resource="http://some.uri.thing.3"/>
>> <rdf:li rdf:resource="http://some.uri.thing.4"/>
>> </rdf:bag>
>> </bqbiol:isVersionOf>
>>
>> which is 1 CVTerm with 4 resources :-)
>>
>
> Actually :(
>
> because from the standpoint from RDF we have for triplets:
> subject: ???, predicate: bqbiol:isVersionOf, resource: ...1
> subject: ???, predicate: bqbiol:isVersionOf, resource: ...2
> subject: ???, predicate: bqbiol:isVersionOf, resource: ...3
> subject: ???, predicate: bqbiol:isVersionOf, resource: ...4
>
> Therfore I would expect the count of stements to be 4. The tags bag and
> li are just used for convenience/human readability. They do not change
> the datamodel.

Maybe it is equvalent for SBML/MIRIAM purposes, but in terms of RDF,
a bag is not a convenience notation for similar statements. A bag is
an object that represents a set, and the resulting statements are
different. For example, to say that Obama has two daughters, without
bags, you would say (in N3 notation):

ex:Obama ex:hasChild ex:Malia .
ex:Obama ex:hasChild ex:Sasha .

with a bag, the equivalent to above situation would be:

ex:Obama ex:hasChildren _:b0 .
_:b0 rdf:type rdf:bag .
_:b0 rdf:li ex:Malia .
_:b0 rdf:li ex:Sasha .

where _:b0 is a blank node. Instead of a blank node, you could also
use a named node, such as:

ex:Obama ex:hasChildren ex:ObamaChildren .
ex:ObamaChildren rdf:type rdf:bag .
ex:ObamaChildren rdf:li ex:Malia .
ex:ObamaChildren rdf:li ex:Sasha .

In any case, that makes one statement involving ex:Obama, but four
statements total.

Take care
Oliver

--
Oliver Ruebenacker, Computational Cell Biologist
BioPAX Integration at Virtual Cell (http://vcell.org/biopax)
Center for Cell Analysis and Modeling
http://www.oliver.curiousworld.org
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Stefan.Hoops


Posts: 170
Registered:
December 2006
Re: question about CVTerms 17 Sep '09 11:03 Go to previous messageGo to next message

Hello Oliver,

On Thu, 17 Sep 2009 11:40:00 -0400
Oliver Ruebenacker <curoli@gmail.com> wrote:

> Hello Stefan, All,
>
> On Thu, Sep 17, 2009 at 8:31 AM, shoops <shoops@vbi.vt.edu> wrote:
> >> <bqbiol:isVersionOf>
> >> <rdf:bag>
> >> <rdf:li rdf:resource="http://some.uri.thing.1"/>
> >> <rdf:li rdf:resource="http://some.uri.thing.2"/>
> >> <rdf:li rdf:resource="http://some.uri.thing.3"/>
> >> <rdf:li rdf:resource="http://some.uri.thing.4"/>
> >> </rdf:bag>
> >> </bqbiol:isVersionOf>
> >>
> >> which is 1 CVTerm with 4 resources :-)
> >>
> >
> > Actually :(
> >
> > because from the standpoint from RDF we have for triplets:
> > subject: ???, predicate: bqbiol:isVersionOf, resource: ...1
> > subject: ???, predicate: bqbiol:isVersionOf, resource: ...2
> > subject: ???, predicate: bqbiol:isVersionOf, resource: ...3
> > subject: ???, predicate: bqbiol:isVersionOf, resource: ...4
> >
> > Therfore I would expect the count of stements to be 4. The tags bag
> > and li are just used for convenience/human readability. They do not
> > change the datamodel.
>
> Maybe it is equvalent for SBML/MIRIAM purposes, but in terms of RDF,
> a bag is not a convenience notation for similar statements. A bag is
> an object that represents a set, and the resulting statements are
> different. For example, to say that Obama has two daughters, without
> bags, you would say (in N3 notation):
>
> ex:Obama ex:hasChild ex:Malia .
> ex:Obama ex:hasChild ex:Sasha .
>
> with a bag, the equivalent to above situation would be:
>
> ex:Obama ex:hasChildren _:b0 .
> _:b0 rdf:type rdf:bag .
> _:b0 rdf:li ex:Malia .
> _:b0 rdf:li ex:Sasha .
>
> where _:b0 is a blank node. Instead of a blank node, you could also
> use a named node, such as:
>
> ex:Obama ex:hasChildren ex:ObamaChildren .
> ex:ObamaChildren rdf:type rdf:bag .
> ex:ObamaChildren rdf:li ex:Malia .
> ex:ObamaChildren rdf:li ex:Sasha .
>
> In any case, that makes one statement involving ex:Obama, but four
> statements total.
>
> Take care
> Oliver
>

Your example differs from the SBML example. You use 2 different
predicates:
ex:hasChild and ex:hasChildren
therfore it does not apply since in SBML we use just bqbiol:isVersionOf
which means that

<bqbiol:isVersionOf>
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.1"/>
<rdf:li rdf:resource="http://some.uri.thing.2"/>
<rdf:li rdf:resource="http://some.uri.thing.3"/>
<rdf:li rdf:resource="http://some.uri.thing.4"/>
</rdf:bag>
</bqbiol:isVersionOf>

is from the content view equivalent to:

<bqbiol:isVersionOf rdf:resource="http://some.uri.thing.1"/>
<bqbiol:isVersionOf rdf:resource="http://some.uri.thing.2"/>
<bqbiol:isVersionOf rdf:resource="http://some.uri.thing.3"/>
<bqbiol:isVersionOf rdf:resource="http://some.uri.thing.4"/>

If you do not belive me try the raptor library implemented by Dave
Beckett, who is and expert in this field, to generate the triplets and
write them out in a compact versus verbose format.

Thanks,
Stefan


--
Stefan Hoops, Ph.D.
Senior Project Associate
Virginia Bioinformatics Institute - 0477
Virginia Tech
Bioinformatics Facility II
Blacksburg, Va 24061, USA

Phone: (540) 231-1799
Fax: (540) 231-2606
Email: shoops@vbi.vt.edu
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Stefan.Hoops


Posts: 170
Registered:
December 2006
Re: question about CVTerms 17 Sep '09 11:05 Go to previous messageGo to next message

Hello,

On Thu, 17 Sep 2009 16:10:27 +0100
Sarah Keating <skeating@caltech.edu> wrote:

> Hi Stefan
>
> shoops wrote:
> >> We will add a flag to the addCVTerm function that will allow you
> >> to choose whether the term is added to an existing bag or not :-)
> >
> > This is the wrong aproach. It is about formating and not about
> > contents. There is no difference in the meaning between the two and
> > libsbml MUST NOT differentiate
>
> But surely if people want the option of either producing
>
> A)
>
> <bqbiol:hasPart >
> <rdf:bag>
> <rdf:li rdf:resource="http://some.uri.thing.1"/>
> <rdf:li rdf:resource="http://some.uri.thing.2"/>
> </rdf:bag>
> </bqbiol:hasPart >
>
> Or B)
>
> <bqbiol:hasPart >
> <rdf:bag>
> <rdf:li rdf:resource="http://some.uri.thing.1"/>
> </rdf:bag>
> </bqbiol:hasPart >
> <bqbiol:hasPart >
> <rdf:bag>
> <rdf:li rdf:resource="http://some.uri.thing.2"/>
> </rdf:bag>
> </bqbiol:hasPart >
>
> it is not a problem for libSBML to offer the option ?

No, it is not a problem :) But see my comment below.

>
> The SBML Spec says
>
> "Several relation elements with a given tag, enclosed in the same
> SBML element, each represent an alternative
> annotation to the SBML element. For example two bqbiol:hasPart
> elements within a Species SBML
> element represent two different sets of references to the parts
> making up the the chemical entity represented
> by the species. (The species is not made up of all the entities
> represented by all the references combined)."
>
> So in fact A and B above do represent different semantics; so we
> would want libSBML to support this. It doesn't actually at present :-(

Unfortunately we must correct the specs as what the specs says can not
be encoded in RDF at least not in the subset of RDF/XML we allow. I
repeat from the standpoint of the information containt in RDF there is
no difference.

Thanks,
Stefan


--
Stefan Hoops, Ph.D.
Senior Project Associate
Virginia Bioinformatics Institute - 0477
Virginia Tech
Bioinformatics Facility II
Blacksburg, Va 24061, USA

Phone: (540) 231-1799
Fax: (540) 231-2606
Email: shoops@vbi.vt.edu
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
curoli


Posts: 97
Registered:
November 2006
Re: question about CVTerms 17 Sep '09 11:59 Go to previous messageGo to next message

Hello Stefan, All,

On Thu, Sep 17, 2009 at 2:03 PM, shoops <shoops@vbi.vt.edu> wrote:
> Oliver Ruebenacker <curoli@gmail.com> wrote:
> Your example differs from the SBML example. You use 2 different
> predicates:
>  ex:hasChild and ex:hasChildren

OK, then use the same.

> therfore it does not apply since in SBML we use just bqbiol:isVersionOf
> which means that
>
> <bqbiol:isVersionOf>
>  <rdf:bag>
>  <rdf:li rdf:resource="http://some.uri.thing.1"/>
>  <rdf:li rdf:resource="http://some.uri.thing.2"/>
>  <rdf:li rdf:resource="http://some.uri.thing.3"/>
>  <rdf:li rdf:resource="http://some.uri.thing.4"/>
>  </rdf:bag>
> </bqbiol:isVersionOf>
>
> is from the content view equivalent to:
>
> <bqbiol:isVersionOf rdf:resource="http://some.uri.thing.1"/>
> <bqbiol:isVersionOf rdf:resource="http://some.uri.thing.2"/>
> <bqbiol:isVersionOf rdf:resource="http://some.uri.thing.3"/>
> <bqbiol:isVersionOf rdf:resource="http://some.uri.thing.4"/>
>
> If you do not belive me try the raptor library implemented by Dave
> Beckett, who is and expert in this field, to generate the triplets and
> write them out in a compact versus verbose format.

I believe the RDF specification [1].

You can choose between the two representations, you can consider
them equivalent, but they do not generate the same statements. I tried
with Jena time ago, and the result looks different.

What do you mean by compact versus verbose? Are you claiming that
the same RDF data can be represented by different sets of statements?
Or that the same statements are sometimes a bag and sometimes not? Or
what exactly are you claiming?

Take care
Oliver

[1] http://www.w3.org/TR/REC-rdf-syntax/

--
Oliver Ruebenacker, Computational Cell Biologist
BioPAX Integration at Virtual Cell (http://vcell.org/biopax)
Center for Cell Analysis and Modeling
http://www.oliver.curiousworld.org
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
curoli


Posts: 97
Registered:
November 2006
Re: question about CVTerms 17 Sep '09 12:19 Go to previous messageGo to next message

Hello Stefan, All,

A sample Java code, using Jena, will illustrate the difference
between duplicated properties and bags:

==========
package org.vcell.sybil.rdf.smelt;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.vocabulary.RDF;

public class TestRDFBag {

public static void main(String[] args) {
Model model = ModelFactory.createDefaultModel();
String ns = "http://example.org/";
Resource r1 = model.createResource(ns + "r1");
Resource r2 = model.createResource(ns + "r2");
Resource r3 = model.createResource(ns + "r3");
Resource r4 = model.createResource(ns + "r4");
Resource c1 = model.createResource(ns + "c1");
Resource c2 = model.createResource(ns + "c2");
Resource b = model.createResource();
Property p = model.createProperty(ns + "p");
model.setNsPrefix("ex", ns);
model.add(r3, RDF.type, c2);
model.add(r4, RDF.type, c2);
model.add(r1, RDF.type, c1);
model.add(r1, p, r3);
model.add(r1, p, r4);
model.add(r2, RDF.type, c2);
model.add(r2, p, b);
model.add(b, RDF.type, RDF.Bag);
model.add(b, RDF.li(1), r3);
model.add(b, RDF.li(2), r4);
model.write(System.out, "RDF/XML-ABBREV");
System.out.println("==========");
model.write(System.out, "N-TRIPLE");
System.out.println("==========");
model.write(System.out, "N3");
}

}

==========

The output of this is as follows:

==========
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/">
<ex:c2 rdf:about="http://example.org/r2">
<ex:p>
<rdf:Bag>
<rdf:li>
<ex:c2 rdf:about="http://example.org/r3"/>
</rdf:li>
<rdf:li>
<ex:c2 rdf:about="http://example.org/r4"/>
</rdf:li>
</rdf:Bag>
</ex:p>
</ex:c2>
<ex:c1 rdf:about="http://example.org/r1">
<ex:p rdf:resource="http://example.org/r4"/>
<ex:p rdf:resource="http://example.org/r3"/>
</ex:c1>
</rdf:RDF>
==========
<http://example.org/r3>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://example.org/c2> .
_:A4a46e254X3aX123c96c9bf3X3aXX2dX8000
<http://www.w3.org/1999/02/22-rdf-syntax-ns#_2>
<http://example.org/r4> .
_:A4a46e254X3aX123c96c9bf3X3aXX2dX8000
<http://www.w3.org/1999/02/22-rdf-syntax-ns#_1>
<http://example.org/r3> .
_:A4a46e254X3aX123c96c9bf3X3aXX2dX8000
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
<http://example.org/r1> <http://example.org/p> <http://example.org/r4> .
<http://example.org/r1> <http://example.org/p> <http://example.org/r3> .
<http://example.org/r1>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://example.org/c1> .
<http://example.org/r4>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://example.org/c2> .
<http://example.org/r2> <http://example.org/p>
_:A4a46e254X3aX123c96c9bf3X3aXX2dX8000 .
<http://example.org/r2>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://example.org/c2> .
==========
@prefix ex: <http://example.org/> .

ex:r2
a ex:c2 ;
ex:p [ a <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> ;
<http://www.w3.org/1999/02/22-rdf-syntax-ns#_1>
ex:r3 ;
<http://www.w3.org/1999/02/22-rdf-syntax-ns#_2>
ex:r4
] .

ex:r4
a ex:c2 .

ex:r1
a ex:c1 ;
ex:p ex:r3 , ex:r4 .

ex:r3
a ex:c2 .

==========

Take care
Oliver

On Thu, Sep 17, 2009 at 2:03 PM, shoops <shoops@vbi.vt.edu> wrote:
> Hello Oliver,
>
> On Thu, 17 Sep 2009 11:40:00 -0400
> Oliver Ruebenacker <curoli@gmail.com> wrote:
>
>>      Hello Stefan, All,
>>
>> On Thu, Sep 17, 2009 at 8:31 AM, shoops <shoops@vbi.vt.edu> wrote:
>> >> <bqbiol:isVersionOf>
>> >> <rdf:bag>
>> >> <rdf:li rdf:resource="http://some.uri.thing.1"/>
>> >> <rdf:li rdf:resource="http://some.uri.thing.2"/>
>> >> <rdf:li rdf:resource="http://some.uri.thing.3"/>
>> >> <rdf:li rdf:resource="http://some.uri.thing.4"/>
>> >> </rdf:bag>
>> >> </bqbiol:isVersionOf>
>> >>
>> >> which is 1 CVTerm with 4 resources :-)
>> >>
>> >
>> > Actually :(
>> >
>> > because from the standpoint from RDF we have for triplets:
>> > subject: ???, predicate: bqbiol:isVersionOf, resource: ...1
>> > subject: ???, predicate: bqbiol:isVersionOf, resource: ...2
>> > subject: ???, predicate: bqbiol:isVersionOf, resource: ...3
>> > subject: ???, predicate: bqbiol:isVersionOf, resource: ...4
>> >
>> > Therfore I would expect the count of stements to be 4. The tags bag
>> > and li are just used for convenience/human readability. They do not
>> > change the datamodel.
>>
>>   Maybe it is equvalent for SBML/MIRIAM purposes, but in terms of RDF,
>> a bag is not a convenience notation for similar statements. A bag is
>> an object that represents a set, and the resulting statements are
>> different. For example, to say that Obama has two daughters, without
>> bags, you would say (in N3 notation):
>>
>> ex:Obama  ex:hasChild ex:Malia .
>> ex:Obama  ex:hasChild ex:Sasha .
>>
>>   with a bag, the equivalent to above situation would be:
>>
>> ex:Obama  ex:hasChildren  _:b0 .
>> _:b0  rdf:type  rdf:bag .
>> _:b0  rdf:li  ex:Malia .
>> _:b0  rdf:li  ex:Sasha .
>>
>>   where _:b0 is a blank node. Instead of a blank node, you could also
>> use a named node, such as:
>>
>> ex:Obama  ex:hasChildren  ex:ObamaChildren .
>> ex:ObamaChildren  rdf:type  rdf:bag .
>> ex:ObamaChildren  rdf:li  ex:Malia .
>> ex:ObamaChildren  rdf:li  ex:Sasha .
>>
>>   In any case, that makes one statement involving ex:Obama, but four
>> statements total.
>>
>>      Take care
>>      Oliver
>>
>
> Your example differs from the SBML example. You use 2 different
> predicates:
>  ex:hasChild and ex:hasChildren
> therfore it does not apply since in SBML we use just bqbiol:isVersionOf
> which means that
>
> <bqbiol:isVersionOf>
>  <rdf:bag>
>  <rdf:li rdf:resource="http://some.uri.thing.1"/>
>  <rdf:li rdf:resource="http://some.uri.thing.2"/>
>  <rdf:li rdf:resource="http://some.uri.thing.3"/>
>  <rdf:li rdf:resource="http://some.uri.thing.4"/>
>  </rdf:bag>
> </bqbiol:isVersionOf>
>
> is from the content view equivalent to:
>
> <bqbiol:isVersionOf rdf:resource="http://some.uri.thing.1"/>
> <bqbiol:isVersionOf rdf:resource="http://some.uri.thing.2"/>
> <bqbiol:isVersionOf rdf:resource="http://some.uri.thing.3"/>
> <bqbiol:isVersionOf rdf:resource="http://some.uri.thing.4"/>
>
> If you do not belive me try the raptor library implemented by Dave
> Beckett, who is and expert in this field, to generate the triplets and
> write them out in a compact versus verbose format.
>
> Thanks,
> Stefan
>
>
> --
> Stefan Hoops, Ph.D.
> Senior Project Associate
> Virginia Bioinformatics Institute - 0477
> Virginia Tech
> Bioinformatics Facility II
> Blacksburg, Va 24061, USA
>
> Phone: (540) 231-1799
> Fax:   (540) 231-2606
> Email: shoops@vbi.vt.edu
> ____________________________________________________________
> To manage your sbml-interoperability list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
>
> For a web interface to the sbml-interoperability mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the sbml-interoperability list,
> contact sbml-team@caltech.edu
>



--
Oliver Ruebenacker, Computational Cell Biologist
BioPAX Integration at Virtual Cell (http://vcell.org/biopax)
Center for Cell Analysis and Modeling
http://www.oliver.curiousworld.org
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
Mike Hucka


Posts: 967
Registered:
October 2003
Re: question about CVTerms 19 Sep '09 19:14 Go to previous messageGo to next message

shoops> Unfortunately we must correct the specs as what
shoops> the specs says can not be encoded in RDF at least
shoops> not in the subset of RDF/XML we allow. I repeat
shoops> from the standpoint of the information containt in
shoops> RDF there is no difference.

Stefan,

I'm sorry, but I disagree. My interpretation of the
following constructs aligns with Nicolas Le Novere's and (I
think) Oliver's:

Case 1:
------

<rdf:description about ...>
qualifier
bag
A
B
</rdf:description>


Case 2:
-------

<rdf:description about ...>
qualifier
bag
A

qualifier
bag
B
</rdf:description>


By "qualifier", I mean the ones such as hasVersion, hasPart,
etc. An RDF bag lists a set of things that are
simultaneously true, but in no particular order. However,
two separate instances of the same qualifier inside an
rdf:description, containing different bags, do not collapse
into a single qualifier-bag combination.

This has been the interpretation for many years -- in fact,
the SBML specification has the following example since L2v2
(2006!):

<bqbiol:hasVersion>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.chebi:CHEBI%3A17345"/>
<rdf:li rdf:resource="urn:miriam:obo.chebi:CHEBI%3A17552"/>
<rdf:li rdf:resource="urn:miriam:obo.chebi:CHEBI%3A17627"/>
</rdf:Bag>
</bqbiol:hasVersion>
<bqbiol:hasVersion>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:kegg.compound:C00035"/>
<rdf:li rdf:resource="urn:miriam:kegg.compound:C00044"/>
<rdf:li rdf:resource="urn:miriam:kegg.compound:C00144"/>
</rdf:Bag>
</bqbiol:hasVersion>

We've been describing it this way for a long time. See, for
example, a presentation I did in 2007 (updated in 2008):

http://www.ebi.ac.uk/compneur-srv/miriam/elements/MIRIAM-qualifiers-summary-2008-09-23.pdf

MH

____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
curoli


Posts: 97
Registered:
November 2006
Re: question about CVTerms 20 Sep '09 16:24 Go to previous message

Hello Mike, All,

On Sat, Sep 19, 2009 at 10:14 PM, Michael Hucka <mhucka@caltech.edu> wrote:
>  shoops> Unfortunately we must correct the specs as what
>  shoops> the specs says can not be encoded in RDF at least
>  shoops> not in the subset of RDF/XML we allow. I repeat
>  shoops> from the standpoint of the information containt in
>  shoops> RDF there is no difference.
>
> Stefan,
>
> I'm sorry, but I disagree.  My interpretation of the
> following constructs aligns with Nicolas Le Novere's and (I
> think) Oliver's:

Yes, it aligns. So far, I only commented on the meaning of the RDF,
because I was not sure whether SBML/MIRIAM specifications were as I
would expect. Thanks to your example, I can see they are exactly as I
would expect based on the meaning of the underlying RDF.

> Case 1:
> ------
>
> <rdf:description about ...>
>  qualifier
>    bag
>      A
>      B
> </rdf:description>
>
>
> Case 2:
> -------
>
> <rdf:description about ...>
>  qualifier
>    bag
>      A
>
>  qualifier
>    bag
>      B
> </rdf:description>
>
>
> By "qualifier", I mean the ones such as hasVersion, hasPart,
> etc.  An RDF bag lists a set of things that are
> simultaneously true, but in no particular order.  However,
> two separate instances of the same qualifier inside an
> rdf:description, containing different bags, do not collapse
> into a single qualifier-bag combination.
>
> This has been the interpretation for many years -- in fact,
> the SBML specification has the following example since L2v2
> (2006!):
>
>   <bqbiol:hasVersion>
>     <rdf:Bag>
>       <rdf:li rdf:resource="urn:miriam:obo.chebi:CHEBI%3A17345"/>
>       <rdf:li rdf:resource="urn:miriam:obo.chebi:CHEBI%3A17552"/>
>       <rdf:li rdf:resource="urn:miriam:obo.chebi:CHEBI%3A17627"/>
>     </rdf:Bag>
>   </bqbiol:hasVersion>
>   <bqbiol:hasVersion>
>     <rdf:Bag>
>       <rdf:li rdf:resource="urn:miriam:kegg.compound:C00035"/>
>       <rdf:li rdf:resource="urn:miriam:kegg.compound:C00044"/>
>       <rdf:li rdf:resource="urn:miriam:kegg.compound:C00144"/>
>     </rdf:Bag>
>   </bqbiol:hasVersion>
>
> We've been describing it this way for a long time.  See, for
> example, a presentation I did in 2007 (updated in 2008):
>
> http://www.ebi.ac.uk/compneur-srv/miriam/elements/MIRIAM-qualifiers-summary-2008-09-23.pdf

Yes, which would be in N3 something like:

:myMetaID bqbiol:hasVersion _:b1 .
_:b1 rdf:type rdf:bag .
_:b1 rdf:li <urn:miriam:obo.chebi:CHEBI%3A17345> .
_:b1 rdf:li <urn:miriam:obo.chebi:CHEBI%3A17552> .
_:b1 rdf:li <urn:miriam:obo.chebi:CHEBI%3A17627> .
:myMetaID bqbiol:hasVersion _:b2 .
_:b2 rdf:type rdf:bag .
_:b2 rdf:li <urn:miriam:kegg.compound:C00035> .
_:b2 rdf:li <urn:miriam:kegg.compound:C00044> .
_:b2 rdf:li <urn:miriam:kegg.compound:C00144> .

where :myMetaID is the meta id and b1 and b2 are two arbitrary
labels each for a blank node.

Take care
Oliver

--
Oliver Ruebenacker, Computational Cell Biologist
BioPAX Integration at Virtual Cell (http://vcell.org/biopax)
Center for Cell Analysis and Modeling
http://www.oliver.curiousworld.org
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic:Extracting All SBase objects
Next Topic:removal of CV terms from annotation
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.