biosimulators_utils.omex_meta package¶
Submodules¶
biosimulators_utils.omex_meta.data_model module¶
Data model for working with OMEX Metadata
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-06-23
- Copyright
2021, Center for Reproducible Biomedical Modeling
- License
MIT
- class biosimulators_utils.omex_meta.data_model.OmexMetaInputFormat(value)[source]¶
Bases:
str
,enum.Enum
An format for reading an OMEX Metadata file
- class biosimulators_utils.omex_meta.data_model.OmexMetaOutputFormat(value)[source]¶
Bases:
str
,enum.Enum
An format for writing an OMEX Metadata file
- class biosimulators_utils.omex_meta.data_model.OmexMetaSchema(value)[source]¶
Bases:
str
,enum.Enum
Schema for OMEX Metadata documents
biosimulators_utils.omex_meta.io module¶
Methods for reading and writing OMEX Metadata files
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-06-23
- Copyright
2021, Center for Reproducible Biomedical Modeling
- License
MIT
- class biosimulators_utils.omex_meta.io.BiosimulationsOmexMetaReader[source]¶
Bases:
biosimulators_utils.omex_meta.io.OmexMetaReader
Utility for reading the metadata about a COMBINE/OMEX archive in an OMEX Metadata file into a dictionary with BioSimulations schema
- classmethod get_combine_archive_uri(triples)[source]¶
Get the URI used to the describe the COMBINE/OMEX archive in a list of RDF triples
- Parameters
triples (
list
ofdict
) – representation of the OMEX Metadata file as list of triples- Returns
URI used to the describe the COMBINE/OMEX archive in the list of triples
- Return type
str
- classmethod parse_triples_to_schema(triples, root_uri)[source]¶
Convert a graph of RDF triples into BioSimulations’ metadata schema
- Parameters
triples (
list
ofdict
) – representation of the OMEX Meta file as list of triplesroot_uri (
str
) – URI used to the describe the COMBINE/OMEX archive in the list of triples
- Returns
representation of the triples in BioSimulations’ metadata schema
- Return type
list
ofobject
- run(filename, format=OmexMetaInputFormat.rdfxml, archive=None, working_dir=None)[source]¶
- Read the metadata about a COMBINE/OMEX archive in an OMEX Metadata file into a dictionary
with BioSimulations schema
- Parameters
filename (
str
) – path to OMEX Metadata fileformat (
OmexMetaInputFormat
, optional) – format forfilename
archive (
CombineArchive
, optional) – parent COMBINE archiveworking_dir (
str
, optional) – working directory (e.g., directory of the parent COMBINE/OMEX archive)
- Returns
dict
: representation of the metadata about a COMBINE/OMEXarchive in an OMEX Metadata file as a dictionary with BioSimulations schema
nested
list
ofstr
: nested list of errors with the OMEX Metadata filenested
list
ofstr
: nested list of warnings with the OMEX Metadata file
- Return type
tuple
- class biosimulators_utils.omex_meta.io.BiosimulationsOmexMetaWriter[source]¶
Bases:
biosimulators_utils.omex_meta.io.OmexMetaWriter
Utility for writing the metadata about a COMBINE/OMEX archive to an OMEX Metadata file
- run(el_metadatas, filename, format=OmexMetaOutputFormat.rdfxml_abbrev)[source]¶
Write an OMEX Metadata file
- Parameters
el_metadatas (
list
ofdict
) – representation of the metadata about the elements in a COMBINE/OMEX archive in an OMEX Metadata filefilename (
str
) – path to save OMEX Metadata fileformat (
OmexMetaOutputFormat
, optional) – format forfilename
- class biosimulators_utils.omex_meta.io.TriplesOmexMetaReader[source]¶
Bases:
biosimulators_utils.omex_meta.io.OmexMetaReader
Utility for reading an OMEX Metadata file into a list of triples
- run(filename, format=OmexMetaInputFormat.rdfxml, archive=None, working_dir=None)[source]¶
Read an OMEX Metadata file into a list of triples
- Parameters
filename (
str
) – path to OMEX Metadata fileformat (
OmexMetaInputFormat
, optional) – format forfilename
archive (
CombineArchive
, optional) – parent COMBINE archiveworking_dir (
str
, optional) – working directory (e.g., directory of the parent COMBINE/OMEX archive)
- Returns
list
ofdict
: representation of the OMEX Metadata file as list of triplesnested
list
ofstr
: nested list of errors with the OMEX Metadata filenested
list
ofstr
: nested list of warnings with the OMEX Metadata file
- Return type
tuple
- class biosimulators_utils.omex_meta.io.TriplesOmexMetaWriter[source]¶
Bases:
biosimulators_utils.omex_meta.io.OmexMetaWriter
Utility for writing a list of triples to an OMEX Metadata file
- run(triples, filename, namespaces=None, format=OmexMetaOutputFormat.rdfxml)[source]¶
Write a list of triples to an OMEX Metadata file
- Parameters
triples (
list
ofTriple
) – representation of the OMEX Metadata file as list of triplesfilename (
str
) – path to OMEX Metadata fileformat (
OmexMetaOutputFormat
, optional) – format forfilename
- biosimulators_utils.omex_meta.io.read_omex_meta_file(filename, schema, format=OmexMetaInputFormat.rdfxml, archive=None, working_dir=None)[source]¶
Read an OMEX Metadata file
- Parameters
filename (
str
) – path to OMEX Metadata fileschema (
OmexMetaSchema
) – schema to parsefilename
intoformat (
OmexMetaInputFormat
, optional) – format forfilename
archive (
CombineArchive
, optional) – parent COMBINE archiveworking_dir (
str
, optional) – working directory (e.g., directory of the parent COMBINE/OMEX archive)
- Returns
object
: representation of the OMEX Metadata file inschema
nested
list
ofstr
: nested list of errors with the OMEX Metadata filenested
list
ofstr
: nested list of warnings with the OMEX Metadata file
- Return type
tuple
- biosimulators_utils.omex_meta.io.read_omex_meta_files_for_archive(archive, archive_dirname, schema)[source]¶
Read all of the OMEX Metadata files in an archive
- Parameters
archive (
CombineArchive
) – COMBINE/OMEX archivearchive_dirname (
str
) – directory with the content of the archiveschema (
OmexMetaSchema
) – schema to parsefilename
into
- Returns
object
: representation of the OMEX Metadata file inschema
nested
list
ofstr
: nested list of errors with the OMEX Metadata filenested
list
ofstr
: nested list of warnings with the OMEX Metadata file
- Return type
tuple
- biosimulators_utils.omex_meta.io.write_omex_meta_file(content, schema, filename, format=OmexMetaOutputFormat.rdfxml_abbrev)[source]¶
Write an OMEX Metadata file
- Parameters
content (
object
) – representation of the OMEX Metadata file inschema
schema (
OmexMetaSchema
) – schema forcontent
intofilename (
str
) – path to save OMEX Metadata fileformat (
OmexMetaOutputFormat
, optional) – format forfilename
biosimulators_utils.omex_meta.utils module¶
Methods for generating OMEX metdata files for models
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-07-19
- Copyright
2021, Center for Reproducible Biomedical Modeling
- License
MIT
- biosimulators_utils.omex_meta.utils.build_omex_meta_file_for_model(model_filename, metadata_filename, metadata_format=OmexMetaOutputFormat.rdfxml_abbrev)[source]¶
Create an OMEX metadata file for a model encoded in CellML or SBML. Also add missing metadata ids to the model file.
- Parameters
model_filename (
str
) – path to model to extract metadata aboutmetadata_filename (
str
) – path to save metadatametadata_format (
OmexMetaOutputFormat
, optional) – format formetadata_filename
biosimulators_utils.omex_meta.validation module¶
Methods for validate BioSimulations metadata
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2021-06-23
- Copyright
2021, Center for Reproducible Biomedical Modeling
- License
MIT
- biosimulators_utils.omex_meta.validation.validate_biosimulations_metadata(metadata, archive=None, working_dir=None)[source]¶
Validate BioSimulations metadata for a file in a COMBINE/OMEX archive
- Parameters
metadata (
dict
) – BioSimulations metadataarchive (
CombineArchive
, optional) – parent COMBINE archiveworking_dir (
str
, optional) – working directory (e.g., directory of the parent COMBINE/OMEX archive)
- Returns
nested
list
ofstr
: nested list of errors with the metadatanested
list
ofstr
: nested list of warnings with the metadata
- Return type
tuple