Editor
- class pyomexmeta.Editor(editor_ptr: ctypes.c_longlong)
Primary interface for creating new, modifying existing or deleting annotations from an rdf graph
- __init__(editor_ptr: ctypes.c_longlong)
Editor constructor.
Most users should not use the constructor directly but instead use the creator method
RDF.to_editor(). This ensures that the necessary references to the parent RDF object (and existing namespaces etc) are properly passed to theEditorclass.- Parameters
editor_ptr – A pointer (a ctypes c_int64) that points to an Editor object in memory
- See Also
- __weakref__
list of weak references to the object (if defined)
- add_creator(creator) → pyomexmeta.pyomexmeta.Editor
Add model level annotation “creator” to the rdf graph
- add_curator(curator) → pyomexmeta.pyomexmeta.Editor
Add model level annotation “curator” to the rdf graph
- add_date_created(date_created) → pyomexmeta.pyomexmeta.Editor
Add model level annotation “date created” to the rdf graph
- add_description(description) → pyomexmeta.pyomexmeta.Editor
Add model level annotation “description” to the rdf graph
- add_energy_diff(energy_diff: pyomexmeta.pyomexmeta.EnergyDiff) → None
Adds a EnergyDiff to the relevant RDF graph (the one that created this
Editor).Users do not normally call this method themselves, because the preferred user interface is to use the context manager for
EnergyDiff. If the context manager forEnergyDiffis not used to create theEnergyDiffobject, then this method must be called to add theEnergyDiffobject to the relevantRDFobject See Examples.- Parameters
energy_diff – An instance of
EnergyDiffto add to the model
See also
Returns: None
- add_namespace(namespace: str, prefix: str) → None
Add a new namespace to the RDF graph.
- Parameters
namespace – The full uri for the namespace
prefix – The prefix that may be used instead of the full uri
Returns: None
Examples
>>> rdf = RDF() >>> editor = rdf.to_editor("<insert xml here>") >>> editor.add_namespace("http://fantasticalNamespace", "fanta")
- add_parent_model(parent_model) → pyomexmeta.pyomexmeta.Editor
Add model level annotation “parent model” to the rdf graph
- add_personal_information(personal_information: pyomexmeta.pyomexmeta.PersonalInformation) → None
Adds a PersonalInformation to the relevant RDF graph (the one that created this
Editor).Users do not normally call this method themselves, because the preferred user interface is to use the context manager for
PersonalInformation. If the context manager forPersonalInformationis not used to create thePersonalInformationobject, then this method must be called to add thePersonalInformationobject to the relevantRDFobject See Examples.- Parameters
personal_information – An instance of
PersonalInformationto add to the model
See also
Returns: None
- add_physical_entity(physical_entity: pyomexmeta.pyomexmeta.PhysicalEntity) → None
Adds a PhysicalEntity to the relevant RDF graph (the one that created this
Editor).Users do not normally call this method themselves, because the preferred user interface is to use the context manager for
PhysicalEntity. If the context manager forPhysicalEntityis not used to create thePhysicalEntityobject, then this method must be called to add thePhysicalEntityobject to the relevantRDFobject See Examples.- Parameters
physical_entity – An instance of
PhysicalEntityto add to the model
See also
Returns: None
- add_physical_process(physical_process: pyomexmeta.pyomexmeta.PhysicalProcess) → None
Adds a PhysicalProcess to the relevant RDF graph (the one that created this
Editor).Users do not normally call this method themselves, because the preferred user interface is to use the context manager for
PhysicalProcess. If the context manager forPhysicalProcessis not used to create thePhysicalProcessobject, then this method must be called to add thePhysicalProcessobject to the relevantRDFobject See Examples.- Parameters
physical_process – An instance of
PhysicalProcessto add to the model
See also
Returns: None
- add_physical_property(property: pyomexmeta.pyomexmeta.PhysicalProperty) → None
Adds a PhysicalProperty to the relevant RDF graph (the one that created this
Editor).Composite annotations usually create their own
PhysicalPropertybut this method gives users the option to add one manually.Users do not normally call this method themselves, because the preferred user interface is to use the context manager for
PhysicalProperty. If the context manager forPhysicalPropertyis not used to create thePhysicalPropertyobject, then this method must be called to add thePhysicalPropertyobject to the relevantRDFobject See Examples.- Parameters
property – An instance of
PhysicalPropertyto add to the model
See also
Returns: None
- add_pubmed(pubmed) → pyomexmeta.pyomexmeta.Editor
Add model level annotation “pubmed” to the rdf graph
- add_singular_annotation(singular_annotation: pyomexmeta.pyomexmeta.SingularAnnotation) → None
Adds a SingularAnnotation, which represents a single Triple. The SingularAnnotation is added to the RDF graph that created this
Editorobject.Users can add arbitrary singular annotations to an RDF graph.
Users do not normally call this method themselves, because the preferred user interface is to use the context manager for
SingularAnnotation. If the context manager forSingularAnnotationis not used to create theSingularAnnotationobject, then this method must be called to add theSingularAnnotationobject to the relevantRDFobject See Examples.- Parameters
singular_annotation – An instance of SingularAnnotation to add to the model
See also
Returns: None
- add_taxon(taxon) → pyomexmeta.pyomexmeta.Editor
Add model level annotation “taxon” to the rdf graph
- check_valid_metaid(id: str) → None
Convenience method for checking whether the metaid id is valid for this RDF graph
- get_metaids() → List[str]
Return a list of available metaids for current xml model
- new_energy_diff() → pyomexmeta.pyomexmeta.EnergyDiff
Create a new
EnergyDiffobject.This is a context manager, i.e. designed to be used inside a with block. Doing so, automatically adds this
EnergyDiffto the relevantRDFobject. Use without a context manager requires users to manually add theEnergyDiffto theRDFusingadd_energy_diff()See also
- Returns
- new_personal_information() → pyomexmeta.pyomexmeta.PersonalInformation
Create a new
PersonalInformationobject.This is a context manager, i.e. designed to be used inside a with block. Doing so, automatically adds this
PersonalInformationto the relevantRDFobject. Use without a context manager requires users to manually add thePersonalInformationto theRDFusingadd_personal_information()See also
- Returns
- new_physical_entity() → pyomexmeta.pyomexmeta.PhysicalEntity
Create a new
PhysicalEntityobject.This is a context manager, i.e. designed to be used inside a with block. Doing so, automatically adds this
PhysicalEntityto the relevantRDFobject. Use without a context manager requires users to manually add thePhysicalEntityto theRDFusingadd_physical_entity()See also
- Returns
- new_physical_process() → pyomexmeta.pyomexmeta.PhysicalProcess
Create a new
PhysicalProcessobject.This is a context manager, i.e. designed to be used inside a with block. Doing so, automatically adds this
PhysicalProcessto the relevantRDFobject. Use without a context manager requires users to manually add thePhysicalProcessto theRDFusingadd_physical_process()See also
- Returns
- new_physical_property() → pyomexmeta.pyomexmeta.PhysicalProperty
Create a new
EnergyDiffobject
- new_singular_annotation() → pyomexmeta.pyomexmeta.SingularAnnotation
Create a new
SingularAnnotationobject.This is a context manager, i.e. designed to be used inside a with block. Doing so, automatically adds this
SingularAnnotationto the relevantRDFobject. Use without a context manager requires users to manually add theSingularAnnotationto theRDFusingadd_singular_annotation()See also
- Returns
- remove_energy_diff(energy_diff_ptr: ctypes.c_longlong) → None
Remove a
EnergyDifffrom the RDF graph. Does nothing if not exists
- remove_personal_information(personal_information_ptr: ctypes.c_longlong) → None
Remove a
PersonalInformationfrom the RDF graph. Does nothing if not exists
- remove_physical_entity(physical_entity_ptr: ctypes.c_longlong) → None
Remove a
PhysicalEntityfrom the RDF graph. Does nothing if not exists
- remove_physical_process(physical_process_ptr: ctypes.c_longlong) → None
Remove a
PhysicalProcessfrom the RDF graph. Does nothing if not exists
- remove_single_annotation(single_annotaiton_ptr: ctypes.c_longlong) → None
Remove a
SingularAnnotationfrom the RDF graph. Does nothing if not exists