A list for the developers of CellML tools

Text archives Help


[cellml-dev] RDF hashes


Chronological Thread 
  • From: ak.miller at auckland.ac.nz (Andrew Miller)
  • Subject: [cellml-dev] RDF hashes
  • Date: Wed, 30 Nov 2011 08:51:37 +1300

On 30/11/11 08:06, Lucian Smith wrote:
> So, we're considering trying to parse the RDF in CellML models. However,
> those hash marks look pretty mysterious. What are they, and how do you,
> er, un-hash them?
>
> (And why are they hashed in the first place?)
Hi Lucian,

I'd firstly suggest using either the RDF/XML facilities in the CellML
API, or some other RDF library to parse the RDF/XML - you definitely
want to make sure you do it in a way consistent with the RDF/XML
specification, as there are multiple forms of XML that represent the
same RDF triples.

In RDF, subjects, predicates, and some objects are 'resources', which
are uniquely identified by an absolute URI.

In CellML RDF annotations, any element with a cmeta:id on it has a
corresponding resource, and the absolute URI for that resource is the
absolute URI for the model, followed by #, followed by the cmeta:id
(this is the standard syntax for URIs to elements with a particular
identifier in the model). For example,
http://models.cellml.org/workspace/luo_rudy_1994/@@rawfile/5fd9ef99b7a9ebc1f8e53496a7c69a3876979b2b/luo_rudy_1994.cellml#fast_sodium_current
is the absolute URI for the fast_sodium_current component in the latest
CellML version of the Luo Rudy 1994 model.

In RDF/XML descriptions, however, it is possible to use a relative URI
instead of an absolute URI to refer to the same resource; the relative
URI is expanded using the rules in RFC 3986 relative to the URL of the
document containing the RDF/XML. When the RDF/XML is embedded in the
CellML document, the URIs of resources can therefore be given relative
to the CellML document. Relative URI processing means that a reference
to a resource in the same document can be named simply by using a #
followed by the fragment name; this type of relative URI is widely used
in CellML models.

To find the DOM element referenced by a resource, you should resolve the
URI to an absolute URI (something most RDF libraries will do anyway),
find the document referred to, and then use the DOM getElementById
operation on the document to find the fragment being referred to.

Best wishes,
Andrew

> -Lucian
> _______________________________________________
> cellml-tools-developers mailing list
> cellml-tools-developers at cellml.org
> http://lists.cellml.org/mailman/listinfo/cellml-tools-developers





Archive powered by MHonArc 2.6.18.

Top of page