A list for the developers of CellML tools

Text archives Help


[cellml-dev] Java CVTerm implementation


Chronological Thread 
  • From: ak.miller at auckland.ac.nz (Andrew Miller)
  • Subject: [cellml-dev] Java CVTerm implementation
  • Date: Fri, 16 Apr 2010 10:15:55 +1200

Morgan Taschuk wrote:
> Hi Andrew,
>
>> Also, I fixed one of your tests which was not testing the correct
>> thing; it applies to a few of them, but removeResource was the only
>> one where they failed. Checking the length of getCVTerms(model) is not
>> sufficient - there can be empty CVTerms (this means the bag exists but
>> it has no contents), so I instead changed the tests to test for the
>> size of the first bag. For example, removeResource does not cause the
>> bag to be deleted, only the contents of the bag to be removed.
>
> Thanks, I've applied the same idea to the rest of my tests. All of the
> tests pass now and I'll be using it in Saint hopefully before the day is
> done.
>
> There's a few things that I'm curious about. I notice in the file that's
> produced, all of the RDF is in a single block with no newlines. It's not
> supposed to be human-readable anyway, I guess, but it makes it a little
> bit difficult to test to see if the URIs actually made it into the file.

This is standard behaviour of our RDF serialiser at present; it does not
add any extra 'unnecessary' whitespace. We do have code in OpenCell
which can format CellML models by adding in additional whitespace, and
we suggest the use of such an approach if the XML needs to be examined
by eye.

>
> Also, you annotate the model in the following way:
>
>
> <rdf:Description rdf:about="#aguda_1999">
> <is xmlns="http://biomodels.net/model-qualifiers/";>
> <rdf:Description rdf:nodeID="n2"/>
> </is>
> </rdf:Description>
> ...
> <rdf:Description rdf:nodeID="n2">
> <rdf:type>
> <rdf:Description
> rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag"/>
> </rdf:type>
> <rdf:_1>
> <rdf:Description rdf:about="http://www.example.com/"/>
> </rdf:_1>
> </rdf:Description>

Both are equally standard and valid according to the W3C RDF
specification. RDF semantics (including container semantics) are
determined in terms of triples. The RDF/XML standard describes how to
translate to and from triples to an XML representation - but there is
more than one way to represent the same triples.

In this case, the representation you gave below is more succinct (and
uses the syntactic sugar RDF/XML provides for producing containers).

While the current output is correct (fully standards compliant), it
could be shorter - so making the serialiser able to detect when it can
use <rdf:li> and also avoid writing out <rdf:type> would mean that the
RDF/XML produced was more compact (at the cost of making it more
complex, however).

Best wishes,
Andrew

>
>
> I thought the standard way to use Bags was like this:
>
> <rdf:Description rdf:about="#aguda_1999">
> <is xmlns="http://biomodels.net/model-qualifiers/";>
> <rdf:Bag>
> <rdf:li rdf:resource="http://www.example.com/"/>
> </rdf:Bag>
> </is>
> </rdf:Description>
>
>
> Or to keep to the same format:
>
> <rdf:Description rdf:about="#aguda_1999">
> <is xmlns="http://biomodels.net/model-qualifiers/";>
> <rdf:Description rdf:nodeID="n2"/>
> </is>
> </rdf:Description>
> ...
> <rdf:Description rdf:nodeId="n2">
> <rdf:Bag>
> <rdf:li rdf:resource="http://www.example.com/"/>
> </rdf:Bag>
> </rdf:Description>
>
>
> It doesn't really make a difference to us as long as the API and CVTerm
> can parse it, but I was wondering if the way you did it was better for
> re-use or was conforming to CellML specification.
>
> Thanks for all of your help on this. We really appreciate the time
> you've taken to write this class and the extensions to the CellML API.
>
>
> Cheers,
> Morgan





Archive powered by MHonArc 2.6.18.

Top of page