metadata¶
Metadata of an SBML model as RDF next to the CellML model.
CellML 2.0 has no place for metadata: its elements must be in the CellML or
MathML namespace, and the only thing a model offers to the outside is the
id of an element. The names, notes, SBO terms, annotations (CV terms) and
the history of the SBML elements therefore go into an RDF/XML file next to
the CellML file, with <cellml file>#<id> as the subject of an element, and
sbml2cellml.cellml2sbml reads the file back.
The RDF is the one of SBML annotations: bqbiol and bqmodel qualifiers
with an rdf:Bag of resources, the history as dcterms:creator (vCard 4),
dcterms:created and dcterms:modified. libsbml writes and parses it, from
a scratch element of SBML level 3, so that a level 2 model gives the same
RDF. In addition an element has
dcterms:title: its name,dcterms:description: its notes, the XHTML as an XML literal,- a first
bqbiol:is(bqmodel:isfor the model) with the single resourcehttps://identifiers.org/SBO:...: its SBO term.
Record
dataclass
¶
The metadata of one element.
element_record
¶
The metadata of an SBML element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
SBase
|
the model, a compartment, species, parameter, reaction, ... |
required |
Returns:
| Type | Description |
|---|---|
Record
|
The record, which is false when the element has no metadata. |
collect_metadata
¶
The records of the elements which have metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
elements
|
dict[str, SBase]
|
SBML element by the id of its CellML element. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Record]
|
The record by the id of the CellML element, in the order of |
write_metadata
¶
Write the records as RDF/XML.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
records
|
dict[str, Record]
|
record by the id of the CellML element. |
required |
cellml_name
|
str
|
file name of the CellML model, the subjects are
|
required |
path
|
Path
|
path of the RDF file. |
required |
read_metadata
¶
Read the records of a CellML model from an RDF/XML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
path of the RDF file, as |
required |
cellml_name
|
str
|
file name of the CellML model; the subjects of other files are ignored. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Record]
|
The record by the id of the CellML element. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if the file is not XML. |