ModellingWebLab / cellmlmanip

CellML loading and model equation manipulation
Other
3 stars 1 forks source link

Parse RDF in external files #261

Open MichaelClerx opened 4 years ago

MichaelClerx commented 4 years ago

And coordinate with PMR so that the format is similar?

MichaelClerx commented 4 years ago

What format would we want, @jonc125 ? Everything in a centralised triple store? A separate file per model?

jonc125 commented 4 years ago

A file per model, primarily. If they're packaged up in a COMBINE Archive (or a Git repo with equivalent content) you'd also want the separate file listed in the manifest for that model.

MichaelClerx commented 4 years ago

Would that give us something like

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <rdf:Description rdf:about="./model-file.cellml#some_variables_id">

?

jonc125 commented 4 years ago

Yep, that's the kind of thing. (Though the "./" isn't strictly necessary, and shouldn't be assumed!)

MichaelClerx commented 4 years ago

Cross-posting from https://github.com/ModellingWebLab/project_issues/issues/75 (thanks @skeating )

https://drive.google.com/file/d/1AngoIjQovM7DpCwR0W6TP0admMloGa9k/view

The draft has is and isVersionOf and while a full implementation might have some complications creating something that reads the bits we like and ignores the rest should be fairly staightforward, I think

(Instead of waiting for a full implementation that we can interface with)

MichaelClerx commented 4 years ago

E.g.

  1. Load model:
    • If it's a cellml model then parse it as before
    • If it's anything else then assume a zip file or a directory, look inside for a manifest file and treat it as a combine archive, then look for a meta data file and continue pretty much as before
MichaelClerx commented 4 years ago

Would that make sense @jonc125 @skeating ? And who wants to have a first go at implementing something?

MichaelClerx commented 4 years ago

We'll have to discuss with @nickerso if that would make us compatible with PMR in the short run :D

jonc125 commented 4 years ago

That seems reasonable to me. So the load model function can take any of:

  1. CellML file - current implementation
  2. Directory or Zip file - treat as (maybe unpacked) Combine Archive, look for the manifest.xml file, error if not found
  3. manifest.xml file directly?

When reading the manifest.xml, it looks for the entry with master='true' and checks it's a format="http://identifiers.org/combine.specifications/cellml" (or sub-version 1.0 thereof).

What format would we allow for metadata files? http://identifiers.org/combine.specifications/omex-metadata at least I'm guessing, maybe a generic RDF mimetype, maybe also .ttl or anything rdflib can read?