CellML Discussion List

Text archives Help


[cellml-discussion] Graphing metadata


Chronological Thread 
  • From: david.nickerson at nus.edu.sg (David Nickerson)
  • Subject: [cellml-discussion] Graphing metadata
  • Date: Tue, 31 Oct 2006 11:29:25 +0800

Thanks Andrew, cleared a few things up. So now for some more
ideas/questions...

When defining a graph outside the scope of a single model or when
combining results from multiple model's, does it still make sense to use
the about="modelid" ?

I have been looking at how to define my graph externally and came up
with this:

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
xmlns:cs="http://www.cellml.org/metadata/simulation/1.0#";
xmlns:cg="http://www.cellml.org/metadata/graphs/1.0#";>
<rdf:Description>
<cg:graph rdf:parseType="Resource">
<cg:traces rdf:parseType="Collection">
<rdf:Description>
<cg:type
rdf:resource="http://www.cellml.org/metadata/graphs/1.0#line"/>
<cg:colour>#ff0000</cg:colour>
<cg:x-variable xml:base="parabola.xml" rdf:parseType="Resource">
<cg:simulation rdf:resource="#parabola_simulation"/>
<cg:variable rdf:resource="#time"/>
</cg:x-variable>
<cg:y-variable xml:base="parabola.xml" rdf:parseType="Resource">
<cg:simulation rdf:resource="#parabola_simulation"/>
<cg:variable rdf:resource="#y"/>
</cg:y-variable>
</rdf:Description>
<rdf:Description>
<cg:type
rdf:resource="http://www.cellml.org/metadata/graphs/1.0#scatter"/>
<cg:colour>#0000ff</cg:colour>
<cg:glyph
rdf:resource="http://www.cellml.org/metadata/graphs/1.0#circles"/>
<cg:x-variable xml:base="parabola.xml" rdf:parseType="Resource">
<cg:simulation
rdf:resource="#parabola_simulation_large_maxDT"/>
<cg:variable rdf:resource="#time"/>
</cg:x-variable>
<cg:y-variable xml:base="parabola.xml" rdf:parseType="Resource">
<cg:simulation
rdf:resource="#parabola_simulation_large_maxDT"/>
<cg:variable rdf:resource="#y"/>
</cg:y-variable>
</rdf:Description>
</cg:traces>
</cg:graph>
</rdf:Description>
</rdf:RDF>

In this example, all the xml-base attributes are the same so I could
just specify it once on the top element, but potentially they could all
be different. The rdf:resource's for the cg:variable reference
cmeta:id's defined on the variable's from the simulation's model (as
defined in the spec) but the cg:simulation references the cs:simulation
via the rdf:ID on the cs:simulation, eg,

<cs:simulation rdf:ID="parabola_simulation_large_maxDT"
rdf:parseType="Resource">
<cs:simulationName>parabola_large_maxDT</cs:simulationName>
...
</cs:simulation>

I have used the validator tool Andrew mentioned, and the graph I get out
looks like what I want for this graph metadata, and if I mangle
simulation metadata into the RDF I paste into the validator everything
seems to point to the right places....but given Andrew's description
below I'm guessing I shouldn't be using rdf:ID's in this way?

And I agree that it would be good to be able to define a graph
externally for any simulation, so maybe we need something to say that
while the blank node approach is valid it is more useful not to use
them? Or do we actually want to define this as part of the specification?


David.


Andrew Miller wrote:
> David Nickerson wrote:
>> Hi all,
>>
>> I have just been looking through the graphing metadata specification
>> (http://www.cellml.org/specifications/metadata/graphs) and have a couple
>> of questions (pretty much due to my continuing RDF ignorance). This
>> specification seems to have dropped behind the simulation specification
>> a bit, so I'm using the simulation spec rather than the example given in
>> the graphing spec.
>>
>> In the fragment
>>
>> <cg:x-variable rdf:parseType="Resource">
>> <cg:simulation rdf:nodeID="mainsim"/>
>> <cg:variable><rdf:Description rdf:about="#time"/></cg:variable>
>> </cg:x-variable>
>>
>> (and similar for the y-variable and the text states the use of
>> cg:simulation but the example contains cs:simulation) I can see how the
>> use of the rdf:nodeID on the cg:simulation works when the simulation and
>> the graph metadata are contained in the same graph. But what I want to
>> do is have my graph metadata independent of the simulation (and model)
>> metadata. For example, I want to specify a graph which plots variables
>> from different models each specified in a different model at different
>> URIs. So my question is whether the following RDF is the equivalent of
>> the above fragment for the case where the graph metadata is in a
>> different RDF graph to the simulation:
>>
>> <cg:x-variable rdf:parseType="Resource">
>> <cg:simulation
>> rdf:resource="file:///example/models/swing.xml#mainsim"/>
>> <cg:variable><rdf:Description rdf:about="#time"/></cg:variable>
>> </cg:x-variable>
>>
>> given the cs:simulation is defined
>>
>> <cs:simulation rdf:ID="mainsim" rdf:parseType="Resource">
>> ...
>> </cs:simulation>
>>
> The fragment you have given reifies the anonymous node generated by
> parseTypeResourcePropertyElement, as per .
>
> http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/#parseTypeLiteralPropertyElt
>
> i.e. what you have is equivalent to (I am assuming that the above
> fragment is in <rdf:Description rdf:about="#mymodel"> ), and writing out
> very
> long hand, unoptimised RDF:
> <rdf:Description rdf:about="#mymodel">
> <cg:simulation>
> <rdf:Description
> rdf:about="http://www.example.org/generated-anonymous-node-URL#00000"; />
> </cg:simulation>
> </rdf:Description>
> <rdf:Description rdf:about="#mainsim">
> <rdf:subject><rdf:Description rdf:about="#mymodel"/></rdf:subject>
> <rdf:predicate><rdf:Description
> rdf:about="http://www.cellml.org/metadata/graphs/1.0#simulation"/></rdf:predicate>
> <rdf:object><rdf:Description
> rdf:about="http://www.example.org/generated-anonymous-node-URL#00000"/></rdf:object>
> <rdf:type><rdf:Description
> rdf:about="|http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement|"/></rdf:type>
> </rdf:Description>
>
> This is clearly not what you want. You can't use
> rdf:parseType="Resource" to get this, because that always generates an
> anonymous node. Instead, you need to explictly add an rdf:Description
> like this:
> <rdf:Description rdf:about="#mymodel">
> <cg:simulation>
> <rdf:Description rdf:ID="mainsim">
> ...
> </rdf:Description>
> </cg:simulation>
> </rdf:Description>
>> in the file at the URI file:///example/models/swing.xml ??
>>
>> And if this is the case, is it then valid to also define a rdf:nodeID on
>> the same simulation node for use in graphs within simulation's graph? or
>> in such a case is it better to just always use the rdf:ID?
>>
> Nodes can only have one URL. If it is an anonymous node, the RDF parser
> will generate a URL for it (unless it has an rdf:nodeID which matches an
> existing rdf:nodeID, in which case it will use the existing URL
> instead). Since you don't know what URL is generated, you cannot refer
> to an anonymous node outside of the document. If you use an rdf:ID, you
> explicitly set the URL to xml:base "#" rdf:ID.
>
> In summary:
> * You can have rdf:nodeID, or rdf:ID, but not both.
> * Use anonymous nodes if it would never make sense to access the node
> from outside the document.
> * Assign an explicit URL with rdf:ID or rdf:about if it would make sense
> to access the node from outside the document.
>
> Of course, it could be argued that it should be possible to define a
> graph externally for any simulation, and that would suggest that we
> should never use anonymous nodes to describe simulations.
>
> BTW if you are unsure what RDF graph gets generated from RDF/XML, the
> W3C RDF validator has a feature to visualise this. See
> http://www.w3.org/RDF/Validator/
>
> Best regards,
> Andrew
>
> _______________________________________________
> cellml-discussion mailing list
> cellml-discussion at cellml.org
> http://www.cellml.org/mailman/listinfo/cellml-discussion

--
David Nickerson, PhD
Research Fellow
Division of Bioengineering
Faculty of Engineering
National University of Singapore
Email: david.nickerson at nus.edu.sg




Archive powered by MHonArc 2.6.18.

Top of page