Re: [cellml-discussion] Graphing metadata

2006-10-31 Thread Andrew Miller
David Nickerson wrote:

 Therefore, you have to be aware of the relationship between RDF/XML and 
 the RDF data model, and make sure you put your rdf:ID in the right place 
 (as with any other attribute in RDF).
 

 ok - I think something just dropped into place. So in this case what I 
 would do is define my simulation like

 cs:simulation
rdf:Description rdf:ID=simulation-ID
  cs:simulationNamecool_name/cs:simulationName
  ...
/rdf:Description
 /cs:simulation

 and then I can use that ID to reference the simulation. Is that making 
 sense now? Probably a good thing that this discussion is starting to 
 make me work out how RDF actually works :-)
   
Yes, that will do what you want (I am assuming, of course, that 
cs:simulation is a propertyElt of some sort).
   
 BTW the specification is supposed to describe what the RDF graph will 
 look like, and not constrain the RDF/XML that you can use. The RDF/XML 
 is merely provided to give a non-normative example of RDF/XML which 
 results in a valid RDF graph. Perhaps this needs to be made clearer in 
 the specification?
 

 Possibly it could be clearer, but that is certainly the way I understand 
 it. I'm just using the RDF/XML as a way that I almost understand to 
 illustrate the RDF...

   
 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?
   
   
 I don't think we should be constraining the RDF/XML that can be used to 
 encode the RDF, because this is supposed to be an RDF level 
 specification. Because anonymous nodes are convenience feature of 
 RDF/XML, rather than part of RDF proper, it wouldn't really make sense 
 to put a normative constraint at this level (after all, people could be 
 using languages other than RDF/XML to represent the data anyway). Simply 
 putting the document through a parse / serialise cycle on any of the 
 existing RDF software would remove anonymous nodes anyway, since most 
 parsers assign the nodes a URL, and the serialisers just spit this out 
 again.
 

 agreed.

   
 I wouldn't be opposed, however, to adding a style guideline recommending 
 that graph nodes be given an explicit URL (we actually say that they 
 would normally be an anonymous node at the moment), so they can be 
 referenced. The only disadvantages of this is that the resulting RDF/XML 
 is longer and more deeply nested, and that people could be tempted to 
 perform open-world extensions to existing simulations, rather than 
 making a copy at a new URL.
 

   
 do you really mean graph nodes, or do you mean cs:simulation nodes? If 
   
Sorry, it should be simulation nodes at least (although perhaps 
commenting on graphs would also be useful, for example, graph 
http://www.cellml.org/models/myModel/download#mygraph demonstrates that 
(reified statement node) could be useful metadata for knowledge 
management systems, as could access to almost any node in the RDF 
graph). Suggesting that anonymous nodes not be used could be one 
approach, although it would result in harder to read metadata in the 
hand-coded case (the model repository will mess up nicely hand-optimised 
RDF/XML anyway, though).
 you do mean graph nodes then I'm even more confused than I thought...

 To me it makes sense that simulation(s) are defined within a model, and 
 in some cases it makes sense to also define graphs within a model. 
 However, there are also many cases where you want to plot graphs using 
 data from multiple models. So this means either having graph metadata 
 external to the models and simulations or creating a single super model 
 that imports all the models of interest and using that. I can see cases 
 where both of these approaches will useful.


 Thanks,
 David
___
cellml-discussion mailing list
cellml-discussion@cellml.org
http://www.cellml.org/mailman/listinfo/cellml-discussion


[cellml-discussion] Graphing metadata

2006-10-30 Thread David Nickerson
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:variablerdf: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:variablerdf: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

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?


Thanks,
David.

-- 
David Nickerson, PhD
Research Fellow
Division of Bioengineering
Faculty of Engineering
National University of Singapore
Email: [EMAIL PROTECTED]
___
cellml-discussion mailing list
cellml-discussion@cellml.org
http://www.cellml.org/mailman/listinfo/cellml-discussion


Re: [cellml-discussion] Graphing metadata

2006-10-30 Thread Andrew Miller
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:variablerdf: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:variablerdf: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#0; /
  /cg:simulation
/rdf:Description
rdf:Description rdf:about=#mainsim
  rdf:subjectrdf:Description rdf:about=#mymodel//rdf:subject
  rdf:predicaterdf:Description 
rdf:about=http://www.cellml.org/metadata/graphs/1.0#simulation//rdf:predicate
  rdf:objectrdf:Description 
rdf:about=http://www.example.org/generated-anonymous-node-URL#0//rdf:object
  rdf:typerdf: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@cellml.org
http://www.cellml.org/mailman/listinfo/cellml-discussion


Re: [cellml-discussion] Graphing metadata

2006-10-30 Thread David Nickerson
Andrew Miller wrote:
 David Nickerson wrote:
 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#ff/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#ff/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.
 I presume you are aware that absolute URLs are allowed in rdf:about as 
 well as relative ones? If you are going to use xml:base, you need to 
 give a suitable absolute URL, as only one base URL is used to resolve 
 relative URLs (i.e. it will not resolve against each base URL until it 
 gets an absolute URL). Refer to section 5.2 of rfc2396.txt:
 Note that only the scheme component is required to be present in the 
 base URI; the other components may be empty or undefined.
 So you need at least an http: or file: on your base URI (and obviously, 
 a path as well if you are not going to give it in your relative URIs).

hmmm...my example above seems to resolve the URIs as I expect when I put 
it through the RDF validator, and I can change the parabola.xml to 
something else for some of them and it'll resolve the relative URLs ok 
as well - but maybe that is processor dependent and may not always work?

Are you just suggesting that it would be better to simply have 
rdf:resource=parabola.xml#parabola_simulation rather than use the 
xml:base attribute? Not sure why I didn't do that originally, makes more 
sense.

 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:simulationNameparabola_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 placesbut given Andrew's description 
 below I'm guessing I shouldn't be using rdf:ID's in this way?
   
 You can use rdf:ID, but you have to be careful where you put it, because 
 not all elements are treated equally in RDF/XML. In terms of the parser 
 rules specified in the RDF/XML specification:
 
 Section 7.2.11 (for nodeElt) says: If there is an attribute /a/ with 
 /a/.URI 
 http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/#eventterm-attribute-URI
  
 == |rdf:ID|, then /e/.subject 
 http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/#eventterm-element-subject
  
 := uri(identifier 
 http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/#eventterm-identifier-identifier
  
 := resolve(/e/, concat(#, /a/.string-value 
 http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/#eventterm-attribute-string-value))).
 So if you are putting the rdf:ID on a nodeElt, you are setting the 
 subject of the node element, which is what you want.
 
 However, if you put the rdf:ID on a resourcePropertyElt,