SingularAnnotation
- class pyomexmeta.SingularAnnotation(singular_annotation_ptr: ctypes.c_longlong)
Interface for handling single annotations or Triples (or rdf statements).
This is the lowest level interface exposed to users. It allows you to create arbitrary RDF triples and add them to the RDF graph.
SingularAnnotation
objects are created using theEditor.new_singular_annotation()
method.All
SingularAnnotation
objects need to call theSingularAnnotation.about()
method to set the subject portion of the triple object being created.The predicate portion may be set with the predicate factory, invoked with the
SingularAnnotation.predicate()
method or directly from a full uri usingSingularAnnotation.set_predicate_from_uri()
method- The resource portion of the triple may be set with one of
for creating a literal, uri or blank note respectively.
From section 2.3.6 in the OmexMeta specification:
Singular annotations within COMBINE archive annotation files should be encoded as a single RDF triple. The subject of the triple is the annotated element and should be formatted as a relative URI. The predicate is the URI of a BioModels.net qualifier linking the subject to a URI from a knowledge resource or the Dublin Core Metadata Terms qualifier description. The object of the triple should be an identifiers.org-formatted URI indicating a concept in a knowledge resource, or a text string for free-text definitions of model elements.
The following is an example singular semantic annotation indicating that the model element with meta- data ID “meta0013” from the model file “MyModel.sbml” represents adenosine tri-phosphate:
The following is an example free-text description of a model variable with metadata ID “meta0014”:
- __init__(singular_annotation_ptr: ctypes.c_longlong)
Constructor for a
SingularAnnotation()
object.This constructor should not be used directly by users. Instead use the
Editor.new_singular_annotation()
method.Methods in this class implement a builder interface, by returning a a reference to self. This allows optional chaining of methods together.
- Parameters
singular_annotation_ptr – A pointer to an SingularAnnotation which exist in memory
- __weakref__
list of weak references to the object (if defined)
- about(about: str) → pyomexmeta.pyomexmeta.SingularAnnotation
Create a subject node with the string about
- Parameters
about – a metaid that exists in the model. Errors when this metaid does not exist in the model you are annotating, and presents you with available metaids.
- Returns
SingularAnnotation
reference to self object
- delete() → None
clean up resources associated with this
SingularAnnotation
- get_about() → str
Returns the about (subject) portion of rdf triple
- get_predicate() → str
Return the predicate portion of the rdf triple
- get_ptr() → ctypes.c_longlong
returns the underlying pointer to the memory address that stores this
SingularAnnotation
- get_resource() → str
return the resource portion of the rdf triple
- predicate(namespace: str, term: str) → pyomexmeta.pyomexmeta.SingularAnnotation
This method provides a factory interface for predicate node creation.
- Parameters
namespace – One of * “bqbiol” BiomodelsBiologyQualifier. http://biomodels.net/biology-qualifiers/ * “bqmodel” BiomodelsModelQualifier. http://biomodels.net/model-qualifiers/ * “dc” DCTerm. http://purl.org/dc/terms/ * “semsim” SemSim. http://bime.uw.edu/semsim/ * “foaf” Foaf. http://xmlns.com/foaf/0.1/
term – the string of the term in namespace that you would like to use. All terms are supported but there are a finite set from which you cannot deviate. Attempts to create a term in namespace that does not exist results in an error, with a list of available terms in namespace namespace
- Returns
SingularAnnotation
reference to self object
- predicate_from_uri(uri: str) → pyomexmeta.pyomexmeta.SingularAnnotation
Create a uri resource node
- Parameters
uri – A uri string to use for resource
- Returns
SingularAnnotation
reference to self object
- resource_blank(blank_id: str) → pyomexmeta.pyomexmeta.SingularAnnotation
Create a blank resource node
- Parameters
blank_id – A string to use for label of blank resource node
- Returns
SingularAnnotation
reference to self object
- resource_literal(literal: str) → pyomexmeta.pyomexmeta.SingularAnnotation
Create a literal resource
- Parameters
literal – string to use for literal resource node
- Returns
SingularAnnotation
reference to self object
- resource_uri(uri: str) → pyomexmeta.pyomexmeta.SingularAnnotation
Create a uri resource node
- Parameters
uri – A uri to use for uri node
- Returns
SingularAnnotation
reference to self object
- set_predicate_from_uri(uri: str) → pyomexmeta.pyomexmeta.SingularAnnotation
Create a predicate node from an arbitrary uri
Deprecated, use
SingularAnnotation.predicate_from_uri()
instead- Parameters
uri – A uri to use for predicate
- Returns
SingularAnnotation
reference to self object
- set_resource_blank(blank_id: str) → pyomexmeta.pyomexmeta.SingularAnnotation
Create a blank resource node
Deprecated, use
SingularAnnotation.resource_blank()
instead- Parameters
blank_id – The string to use for the blank node
- Returns
SingularAnnotation
reference to self object
- set_resource_literal(literal: str) → pyomexmeta.pyomexmeta.SingularAnnotation
Create a literal resource node
Deprecated, use
SingularAnnotation.resource_literal()
instead- Parameters
literal – The string to use for the literal node
- Returns
SingularAnnotation
reference to self object
- set_resource_uri(uri: str) → pyomexmeta.pyomexmeta.SingularAnnotation
Create a uri resource node
Deprecated, use
SingularAnnotation.resource_uri()
instead- Parameters
uri – The string to use for the uri
- Returns
SingularAnnotation
reference to self object