A list for the developers of CellML tools

Text archives Help


Re: [[cellml-dev] ] libCellML handling of non-valid CellML - discussion request


Chronological Thread 
  • From: Randall Britten <r.britten AT auckland.ac.nz>
  • To: cellml-tools-developers Mailing List <cellml-tools-developers AT lists.cellml.org>
  • Subject: Re: [[cellml-dev] ] libCellML handling of non-valid CellML - discussion request
  • Date: Thu, 15 Jan 2015 23:22:00 +0000
  • Accept-language: en-NZ, en-US

Hi Alan

I’ve pasted Andre’s e-mail below this response (hopefully it helps with
threading in this conversation). I think it addresses why connections would
be hidden.

Your understanding of what I mean by invalid models, and how that relates to
partially constructed models is exactly correct, and I see validation the
same way you do.

To answer your questions regarding the options:

1. Phantom Variables, Phantom Units etc, would basically be a way of
handling partially constructed models. The design that I’ve been working
with so far: a variable object always has a reference to a units object,
enforced by only providing a constructor that requires a units object. We
could use null pointers to perform the same role. Explicitly inserting
PhantomX type objects might appeal because we can aim to never have null
pointers, and then if we find null pointers, we know we have a bug.
2. Was answered by Andre
3. 80/20 rule: http://en.wikipedia.org/wiki/Pareto_principle. I mean that
if we forge ahead on the assumption that we won’t support partially
constructed models and invalid models for now, and then later come back and
add this feature (i.e. support for incomplete and invalid models), then we
gain 80% of the functionality we need. In practice, it would mean that at
first, editing software that used libCellML would force the user to first
define the unit U before allowing a variable V with units U to be defined.

And "still under consruction, pa” was meant to be "still under consruction,
partially constructed”, my bad.

Cheers,
Randall


On 16/01/15 11:48 am, "David Nickerson"
<david.nickerson AT gmail.com<mailto:david.nickerson AT gmail.com>>
wrote:

Hi Alan,

Just to address part of your email. In my view, the libCellML API
should only expose objects and methods that are of use to application
developers for working with CellML models and not be restricted to the
current XML serialisation. In this instance, a connection element is
just the serialisation of the relationship between variables in two
components. I don't see a need for a special object in the API that
represents this as such information is just a property of the
respective variables.

In my view an API that simply exposes the primary data in a CellML
model - components, variables, units, and math - provides a much
cleaner, more intuitive, and flexible interface for application
developers than one similar to the current CellML API which simply
exposes a DOM-based view of the XML serialisation format. Obviously,
this is why discussion on the proposed object model and API for
libCellML would have been more valuable to have prior to getting into
these implementation details.


Cheers,
Andre.


From: Alan Garny
<alan.garny AT inria.fr<mailto:alan.garny AT inria.fr>>
Reply-To:
"cellml-tools-developers AT lists.cellml.org<mailto:cellml-tools-developers AT lists.cellml.org>"

<cellml-tools-developers AT lists.cellml.org<mailto:cellml-tools-developers AT lists.cellml.org>>
Date: Friday, 16 January 2015 11:25 am
To:
"cellml-tools-developers AT lists.cellml.org<mailto:cellml-tools-developers AT lists.cellml.org>"

<cellml-tools-developers AT lists.cellml.org<mailto:cellml-tools-developers AT lists.cellml.org>>
Cc:
"cellml-tools-developers AT cellml.org<mailto:cellml-tools-developers AT cellml.org>"

<cellml-tools-developers AT cellml.org<mailto:cellml-tools-developers AT cellml.org>>
Subject: Re: [[cellml-dev] ] libCellML handling of non-valid CellML -
discussion request

Hi Randall,

I am not sure I fully understand the issue at hand. What do you mean exactly
by non-valid CellML models? Using libCellML, I would expect to be able to
create a model with a component C. Within that component, I would expect to
be able to create a variable V with units U, and stop here if I want. The
model would clearly be incomplete, yet I would still expect to be able to
save it and load it back without any problem. However, if if I was then to
ask libCellML to validate the model, then I would expect libCellML to tell me
that the unit U hasn't been defined, as well as probably tell me that there
is no equation that uses the variable V. More generally, when it comes to
validation, I would expect libCellML to implement all the rules that are in
the CellML specification, as well as Jonathan Cooper's algorithm for checking
units consistency.

About connections, I imagine I am once again missing something. Why would you
hide them? What if, for some reason or another, a CellML-capable software
needs to know about the connections? As an API, I would expect libCellML to
give me access to everything that is part of the CellML language.

Regarding your options:
1) I am clearly missing something. In other words, I don't see the need for
this.
2) Independent of whether a model is valid or not, I would in any case have a
"connection" class and make it accessible to libCellML users.
3) 80/20 rule?

Otherwise, "pa" (in "still under consruction, pa")?

Alan

________________________________
From: "Randall Britten"
<r.britten AT auckland.ac.nz<mailto:r.britten AT auckland.ac.nz>>
To:
cellml-tools-developers AT cellml.org<mailto:cellml-tools-developers AT cellml.org>
Sent: Thursday, 15 January, 2015 9:46:47 PM
Subject: [[cellml-dev] ] libCellML handling of non-valid CellML - discussion
request

Hi all

Firstly, Happy New Year, hope you have a great 2015!

I had some conversations yesterday around the ABI about how libCellML should
handle non-valid CellML models. We are especially envisaging model-editing
software that uses libCellML, progressively building and modifying models,
meaning that as the model is worked on step-by-step, there will often be
steps that are part of a group of steps, and only once the group of steps is
complete is the model in a valid state. Another likely scenario is using
software that uses libCellML to load models that were created independently
of libCellML, and it would be necessary to handle the case where the loaded
model might be invalid (e.g. still under construction, or pa).

Within reason, we’d like libCellML to support the corresponding use cases,
although it might make sense to defer them till later.

An example that has arisen is how connections are represented. While the XML
has a “connection” element that is a child of the “model” element, the design
that I’ve followed so far aimed to hide that, treating it as an
implementation detail, so that variables would simply allow for a query
regarding which other variables they are connected to.

Some options considered so far:
1)Phantom Variables (and similarly for other situations, e.g. Phantom Units),
which serve as place-holders.
2)Reinstate “connection” class in the object model to handle the case where
the connection is not valid (e.g. refers to variables or components that
don’t exist in the model).
3)Defer consideration of partially defined and invalid models (80/20 rule).

Please provide feedback on this. I’ll be responding to feedback received
today and next week on the same day it is received (within reason).

Thanks in advance.

Regards,
Randall





Archive powered by MHonArc 2.6.18.

Top of page