Hi all, The CellML API currently provides two ways to access RDF for the model: 1) As a single serialised chunk, or 2) As a DOM node for the RDF:Description
Neither of these approaches are very good, because RDF/XML can be spread throughout the model, and so you don't know that you have put all the triples you want into a local RDF library if you need to perform any manipulations on it. They also make it very hard to change the RDF/XML in the model (removing it and putting it back through DOM operations might not be easy if the structure of the XML has changed). There is currently no widely accepted standard API, so I propose that we adopt our own, taking into consideration the designs used in Mozilla (http://lxr.mozilla.org/seamonkey/source/rdf/base/idl/) and Jena (and also the other RDF libraries available). At this stage, I think that supporting query languages would add too much complexity, so we should probably stick to basic operations like: 1) Given a subject and predicate, fetching the object. Also fetching the subject from object and predicate. 2) Given a subject, fetch all known predicates. Likewise for object. 3) Given a predicate, fetch all known subject / object pairs (perhaps. This might be expensive in some implementations). 4) Given a subject, predicate, and object, make an assertion. 5) Given a subject, predicate, and object, revoke an assertion. 6) Create new wrapper objects for resources, literals, and so on. 7) Fetch values, types, and so on out of literals. We should also probably build some convenience tools on top of the core operations above, and make them available too: a) Bags, sequences, etc..., and also containers: append, get at index, get next, insert and delete with/without renumbering, etc... b) Reification utilities (although we don't use this much for any CellML specifications, so this is dubious). c) Convenience support for cmeta (including Dublin core and vcard), simulation metadata, graph metadata. Any opinions on this would be welcomed. As a side note for those following the progress of PCEnv: PCEnv currently puts serialised RDF/XML into the Mozilla framework, and then uses Mozilla's frameworks to process this and extract information from it. This will work, but only if all the required information is nested under the RDF:Description for the model. Unfortunately, this means that PCEnv won't be able to change any metadata, because the serialiser in Mozilla produces output which isn't compatible with this. It also means that metadata from models in the repository won't be accessible, since 4Suite doesn't nest resources in serialised RDF, but instead puts shallow XML for the triples directly into the RDF:RDF tag. Of course, we could kludge this by getting the document from an RDF representation, and then searching for all Description elements in the whole model, but it seems wrong that we have to do this. Best regards, Andrew Miller _______________________________________________ cellml-discussion mailing list [email protected] http://www.cellml.org/mailman/listinfo/cellml-discussion
