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: Wed, 14 Apr 2010 14:58:00 +1200

Morgan Taschuk wrote:
> Hi Andrew,
>
>
>> The RDF containers library for the CellML API has now been pushed to
>> the sourceforge repository, and in addition, I have now implemented a
>> Java wrapper around the functionality for adding controlled vocabulary
>> terms. I have aimed to make the wrapper as similar to the one from
>> libSBML.
>
> Thank you very much for writing this! I've been attempting to integrate
> them into Saint for the past few days.
>
>>
>> The RDF containers library has proper unit tests. The CVTerm
>> implementation does not - it may or may not actually work as it has
>> never been tested (I expect it will change in response to feedback
>> from Morgan and Allyson anyway).
>
> Unfortunately, the CVTerm class crashes the JRE when it is instantiated.
> I've narrowed the crash to the call to findOrMakeContainer in the lowest
> level constructor, so it's a problem with the RDF containers library. A
> test project is attached in Maven build format. Please note the direct
> links in src/test/java/cellml_api/CVTermTest.java - you'll have to
> modify them appropriately. The files are located at /src/test/resources .

I found the problem - it was just a missing .class file that the
automatically generated wrapped code assumed was present (it wasn't
being added to the .jar due to an out of date build script). Now that I
have fixed this, the tests pass.

> Aside from the error, everything for adding annotation looks good. I've
> written most of the code for that now and it's only a matter of debugging.
>
> However, although we can add annotation to CellML files now, we have no
> way of querying what existing annotation exists on the model or element.
> We would need this when loading in models that have already been
> partially annotated, or for adding more annotation to previously
> annotated models. If you want to stick with this CVTerm being outside
> the API, we would suggest a method with a signature along the following
> lines:
>
> public static List<CVTerm> getCVTerms(CellMLElement element);

I've added something like this, and added a test for it. I identified a
few other problems when I did this (like the fact that changes never
actually get saved back from the datasource, making annotating with them
useless), which have now been fixed. The updated CVTerm.java is included
in the attached zip file.

>
> where it will query the RDF in the model for the CellMLElement and
> return a list consisting of new (read-only) CVTerms. I hope that won't
> be too difficult?

I didn't do anything to make it read-only - but there is no need to make
any change to the CVTerms. The code as it is now will actually
re-serialise the XML even when no actual changes were made, but I don't
think this matters - there is no need to save the result if it is
unwanted, and the reserialised version will contain exactly the same
triples - but perhaps formatted differently as RDF/XML.

Best wishes,
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CVTermTest.zip
Type: application/zip
Size: 46164 bytes
Desc: not available
URL:
<http://www.cellml.org/pipermail/cellml-tools-developers/attachments/20100414/7a9cee1e/attachment-0001.zip>




Archive powered by MHonArc 2.6.18.

Top of page