How to use the sbol3.identified.Identified function in sbol3

To help you get started, we’ve selected a few sbol3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SynBioDex / pySBOL / sbol3 / interaction.py View on Github external
from .identified import Identified
from .property import OwnedObject, URIProperty
from .validation import *
from .constants import *


class Interaction(Identified):
    def __init__(self, rdf_type=SBOL_INTERACTION, uri='example', interaction_type=SBO_INTERACTION):
        super().__init__(rdf_type, uri)
        self.functionalComponents = OwnedObject(self, SBOL_FUNCTIONAL_COMPONENTS, '0', '*', [libsbol_rule_18])
        self._types = URIProperty(self, SBOL_TYPES, '1', '*', [], interaction_type)
        self.participations = OwnedObject(self, SBOL_PARTICIPATIONS, '0', '*', [])
        self.measurements = OwnedObject(self, SBOL_MEASUREMENTS, '0', '*', [])
        # TODO hidden properties

    @property
    def types(self):
        return self._types.value

    @types.setter
    def types(self, new_types):
        self._types.set(new_types)
github SynBioDex / pySBOL / sbol3 / measurement.py View on Github external
from sbol3.identified import Identified
from sbol3.constants import *
from sbol3.property import LiteralProperty, URIProperty
from rdflib import URIRef


class Measurement(Identified):
    """The purpose of the Measure class is to link a numerical value to a unit of measure."""

    def __init__(self, uri=URIRef('example'), value=0.0, unit='', version=VERSION_STRING):
        super().__init__(SBOL_MEASURE, uri, version)
        self._value = LiteralProperty(self, SBOL_VALUE, '1', '1', [], value)
        self._unit = URIProperty(self, SBOL_UNIT, '1', '1', [], unit)
        self._types = URIProperty(self, SBOL_TYPES, '0', '*', [])

    @property
    def value(self):
        return self._value.value

    @value.setter
    def value(self, new_value):
        self._value.set(new_value)
github SynBioDex / pySBOL / sbol3 / combinatorialderivation.py View on Github external
from .identified import Identified
from .toplevel import TopLevel
from .constants import *
from rdflib import URIRef
from .property import ReferencedObject, URIProperty, OwnedObject


class VariableComponent(Identified):

    def __init__(self, type_uri=SBOL_IDENTIFIED, uri=URIRef('example'), repeat='http://sbols.org/v2#on', version=VERSION_STRING):
        super().__init__(type_uri, uri, version)
        self.variable = ReferencedObject(self, SBOL_VARIABLE, SBOL_COMPONENT, '0', '1', [])
        self._repeat = URIProperty(self, SBOL_OPERATOR, '1', '1', [], repeat)
        self.variants = ReferencedObject(self, SBOL_VARIANTS, SBOL_COMPONENT_DEFINITION, '0', '*', [])
        self.variantCollections = ReferencedObject(self, SBOL_VARIANT_COLLECTIONS, SBOL_COLLECTION, '0', '*', [])
        self.variantDerivations = ReferencedObject(self, SBOL_VARIANT_DERIVATIONS, SBOL_COMBINATORIAL_DERIVATION, '0', '*', [])

    @property
    def repeat(self):
        return self._repeat.value

    @repeat.setter
    def repeat(self, new_repeat):
        self._repeat.set(new_repeat)
github SynBioDex / pySBOL / sbol3 / participation.py View on Github external
from .identified import Identified
from .constants import *
from rdflib import URIRef
from .property import URIProperty, ReferencedObject, OwnedObject


class Participation(Identified):

    def __init__(self, type_uri=SBOL_PARTICIPATION, uri=URIRef('example'), participant='', version=VERSION_STRING):
        super().__init__(type_uri, uri, version)
        self._roles = URIProperty(self, SBOL_ROLES, '0', '*', [])
        self.participant = ReferencedObject(self, SBOL_PARTICIPANT, SBOL_FUNCTIONAL_COMPONENT, '1', '1', [], participant)
        self.measurements = OwnedObject(self, SBOL_MEASUREMENTS, '0', '*', [])

    @property
    def roles(self):
        return self._roles.value

    @roles.setter
    def roles(self, new_roles):
        self._roles.set(new_roles)

    def addRole(self, new_role):
github SynBioDex / pySBOL / sbol3 / mapsto.py View on Github external
from .identified import Identified
from .constants import *
from rdflib import URIRef
from .property import URIProperty, ReferencedObject


class MapsTo(Identified):

    def __init__(self, type_uri=SBOL_MAPS_TO, uri=URIRef('example'), local='', remote='', refinement=SBOL_REFINEMENT_VERIFY_IDENTICAL, version=VERSION_STRING):
        super().__init__(type_uri, uri, version)
        self.local = ReferencedObject(self, SBOL_LOCAL, SBOL_COMPONENT, '1', '1', [], local)
        self.remote = ReferencedObject(self, SBOL_REMOTE, SBOL_COMPONENT, '1', '1', [], remote)
        self._refinement = URIProperty(self, SBOL_REFINEMENT, '1', '1', [], refinement)

    @property
    def refinement(self):
        return self._refinement.value

    @refinement.setter
    def refinement(self, new_refinement):
        self._refinement.set(new_refinement)
github SynBioDex / pySBOL / sbol3 / module.py View on Github external
from .identified import Identified
from .constants import *
from .property import OwnedObject, ReferencedObject


class Module(Identified):
    def __init__(self, rdf_type=SBOL_MODULE, uri='example', definition='', version=VERSION_STRING):
        super().__init__(rdf_type, uri, version)
        self.definition = ReferencedObject(self, SBOL_DEFINITION, SBOL_MODULE_DEFINITION, '1', '1', [], definition)
        self.mapsTos = OwnedObject(self, SBOL_MAPS_TOS, '0', '*', [])
        self.measurements = OwnedObject(self, SBOL_MEASUREMENTS, '0', '*', [])
github SynBioDex / pySBOL / sbol3 / sequenceannotation.py View on Github external
from .identified import Identified
from .constants import *
from .property import OwnedObject, URIProperty


class SequenceAnnotation(Identified):

    def __init__(self, uri='example', version=VERSION_STRING):
        """Construct a SequenceAnnotation
        :param uri: A full URI including a scheme, namespace, and identifier.
        If SBOLCompliance configuration is enabled, then this argument is simply
        the displayId for the new object and a full URI will automatically be constructed.
        :param version: An arbitrary version string. If SBOLCompliance is enabled,
        this should be a Maven version string of the form "major.minor.patch".
        """
        super().__init__(SBOL_SEQUENCE_ANNOTATION, uri, version)
        self.component = None #  TODO support ReferencedObject
        self.locations = OwnedObject(self, SBOL_LOCATIONS, '0', '*', [])
        self._roles = URIProperty(self, SBOL_ROLES, '0', '*', [])

    @property
    def roles(self):
github SynBioDex / pySBOL / sbol3 / sequenceconstraint.py View on Github external
from .constants import *
from .identified import Identified
from rdflib import URIRef
from .property import URIProperty, ReferencedObject

class SequenceConstraint(Identified):

    def __init__(self, type_uri=SBOL_SEQUENCE_CONSTRAINT, uri=URIRef('example'), subject='', object='', restriction=SBOL_RESTRICTION_PRECEDES, version=VERSION_STRING):
        super().__init__(type_uri, uri, version)
        self.subject = ReferencedObject(self, SBOL_SUBJECT, SBOL_COMPONENT, '1', '1', [], subject)
        self.object = ReferencedObject(self, SBOL_OBJECT, SBOL_COMPONENT, '1', '1', [], object)
        self._restriction = URIProperty(self, SBOL_RESTRICTION, '1', '1', [], restriction)

    @property
    def restriction(self):
        return self._restriction.value

    @restriction.setter
    def restriction(self, new_restriction):
        self._restriction.set(new_restriction)
github SynBioDex / pySBOL / sbol3 / location.py View on Github external
from .identified import Identified
from .constants import *
from .property import URIProperty, ReferencedObject, LiteralProperty
from rdflib import URIRef

class Location(Identified):
    """The Location class specifies the strand orientation of a Component."""
    def __init__(self, type_uri=SBOL_LOCATION, uri=URIRef('example'), orientation=SBOL_ORIENTATION_INLINE):
        super().__init__(type_uri, uri)
        self._orientation = URIProperty(self, SBOL_ORIENTATION, '1', '1', [], orientation)
        self.sequence = ReferencedObject(self, SBOL_SEQUENCE_PROPERTY, SBOL_SEQUENCE, '0', '1', [])

    @property
    def orientation(self):
        return self._orientation.value

    @orientation.setter
    def orientation(self, new_orientation):
        self._orientation.set(new_orientation)


class Range(Location):
github SynBioDex / pySBOL / sbol3 / component.py View on Github external
from .identified import Identified
from .property import URIProperty, OwnedObject, ReferencedObject
from .constants import *


class ComponentInstance(Identified):
    def __init__(self, rdf_type, uri, definition, access, version):
        super().__init__(rdf_type, uri, version)
        self.definition = ReferencedObject(self, SBOL_DEFINITION, SBOL_COMPONENT_DEFINITION, '1', '1', [], definition)
        self._access = URIProperty(self, SBOL_ACCESS, '0', '1', [], access)
        self.mapsTos = OwnedObject(self, SBOL_MAPS_TOS, '0', '*', [])
        self.measurements = OwnedObject(self, SBOL_MEASUREMENTS, '0', '*', [])

    @property
    def access(self):
        return self._access.value

    @access.setter
    def access(self, new_access):
        self._access.set(new_access)