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 theEditor
class.- 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 forEnergyDiff
is not used to create theEnergyDiff
object, then this method must be called to add theEnergyDiff
object to the relevantRDF
object See Examples.- Parameters
energy_diff – An instance of
EnergyDiff
to 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 forPersonalInformation
is not used to create thePersonalInformation
object, then this method must be called to add thePersonalInformation
object to the relevantRDF
object See Examples.- Parameters
personal_information – An instance of
PersonalInformation
to 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 forPhysicalEntity
is not used to create thePhysicalEntity
object, then this method must be called to add thePhysicalEntity
object to the relevantRDF
object See Examples.- Parameters
physical_entity – An instance of
PhysicalEntity
to 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 forPhysicalProcess
is not used to create thePhysicalProcess
object, then this method must be called to add thePhysicalProcess
object to the relevantRDF
object See Examples.- Parameters
physical_process – An instance of
PhysicalProcess
to 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
PhysicalProperty
but 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 forPhysicalProperty
is not used to create thePhysicalProperty
object, then this method must be called to add thePhysicalProperty
object to the relevantRDF
object See Examples.- Parameters
property – An instance of
PhysicalProperty
to 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
Editor
object.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 forSingularAnnotation
is not used to create theSingularAnnotation
object, then this method must be called to add theSingularAnnotation
object to the relevantRDF
object 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
EnergyDiff
object.This is a context manager, i.e. designed to be used inside a with block. Doing so, automatically adds this
EnergyDiff
to the relevantRDF
object. Use without a context manager requires users to manually add theEnergyDiff
to theRDF
usingadd_energy_diff()
See also
- Returns
- new_personal_information() → pyomexmeta.pyomexmeta.PersonalInformation
Create a new
PersonalInformation
object.This is a context manager, i.e. designed to be used inside a with block. Doing so, automatically adds this
PersonalInformation
to the relevantRDF
object. Use without a context manager requires users to manually add thePersonalInformation
to theRDF
usingadd_personal_information()
See also
- Returns
- new_physical_entity() → pyomexmeta.pyomexmeta.PhysicalEntity
Create a new
PhysicalEntity
object.This is a context manager, i.e. designed to be used inside a with block. Doing so, automatically adds this
PhysicalEntity
to the relevantRDF
object. Use without a context manager requires users to manually add thePhysicalEntity
to theRDF
usingadd_physical_entity()
See also
- Returns
- new_physical_process() → pyomexmeta.pyomexmeta.PhysicalProcess
Create a new
PhysicalProcess
object.This is a context manager, i.e. designed to be used inside a with block. Doing so, automatically adds this
PhysicalProcess
to the relevantRDF
object. Use without a context manager requires users to manually add thePhysicalProcess
to theRDF
usingadd_physical_process()
See also
- Returns
- new_physical_property() → pyomexmeta.pyomexmeta.PhysicalProperty
Create a new
EnergyDiff
object
- new_singular_annotation() → pyomexmeta.pyomexmeta.SingularAnnotation
Create a new
SingularAnnotation
object.This is a context manager, i.e. designed to be used inside a with block. Doing so, automatically adds this
SingularAnnotation
to the relevantRDF
object. Use without a context manager requires users to manually add theSingularAnnotation
to theRDF
usingadd_singular_annotation()
See also
- Returns
- remove_energy_diff(energy_diff_ptr: ctypes.c_longlong) → None
Remove a
EnergyDiff
from the RDF graph. Does nothing if not exists
- remove_personal_information(personal_information_ptr: ctypes.c_longlong) → None
Remove a
PersonalInformation
from the RDF graph. Does nothing if not exists
- remove_physical_entity(physical_entity_ptr: ctypes.c_longlong) → None
Remove a
PhysicalEntity
from the RDF graph. Does nothing if not exists
- remove_physical_process(physical_process_ptr: ctypes.c_longlong) → None
Remove a
PhysicalProcess
from the RDF graph. Does nothing if not exists
- remove_single_annotation(single_annotaiton_ptr: ctypes.c_longlong) → None
Remove a
SingularAnnotation
from the RDF graph. Does nothing if not exists