How to use the sbol3.toplevel.TopLevel 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 / implementation.py View on Github external
from .toplevel import TopLevel
from rdflib import URIRef
from .constants import *
from .property import URIProperty


class Implementation(TopLevel):

    def __init__(self, type_uri=SBOL_IMPLEMENTATION, uri=URIRef("example"), version=VERSION_STRING):
        super().__init__(type_uri, uri, version)
        self._built = URIProperty(self, SBOL_URI+'#built', '0', '1', [])

    @property
    def built(self):
        return self._built.value

    @built.setter
    def built(self, new_built):
        self._built.set(new_built)
github SynBioDex / pySBOL / sbol3 / experiment.py View on Github external
from .toplevel import TopLevel
from rdflib import URIRef
from .constants import *
from .property import ReferencedObject

class ExperimentalData(TopLevel):
    def __init__(self, uri=URIRef('example'), version=VERSION_STRING):
        super().__init__(SBOL_EXPERIMENTAL_DATA, uri, version)


class Experiment(TopLevel):
    def __init__(self, uri=URIRef('example'), version=VERSION_STRING):
        super().__init__(SBOL_EXPERIMENT, uri, version)
        self.experimentalData = ReferencedObject(self, SBOL_URI + "#experimentalData", SBOL_EXPERIMENTAL_DATA, '0', '*', [])
github SynBioDex / pySBOL / sbol3 / experiment.py View on Github external
from .toplevel import TopLevel
from rdflib import URIRef
from .constants import *
from .property import ReferencedObject

class ExperimentalData(TopLevel):
    def __init__(self, uri=URIRef('example'), version=VERSION_STRING):
        super().__init__(SBOL_EXPERIMENTAL_DATA, uri, version)


class Experiment(TopLevel):
    def __init__(self, uri=URIRef('example'), version=VERSION_STRING):
        super().__init__(SBOL_EXPERIMENT, uri, version)
        self.experimentalData = ReferencedObject(self, SBOL_URI + "#experimentalData", SBOL_EXPERIMENTAL_DATA, '0', '*', [])
github SynBioDex / pySBOL / sbol3 / combinatorialderivation.py View on Github external
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)


class CombinatorialDerivation(TopLevel):

    def __init__(self, type_uri=SBOL_COMBINATORIAL_DERIVATION, uri=URIRef("example"), strategy='http://sbols.org/v2#enumerate', version=VERSION_STRING):
        super().__init__(type_uri, uri, version)
        self._strategy = URIProperty(self, SBOL_STRATEGY, '1', '1', [])  # TODO in original source, it doesn't look like strategy is used
        self.masterTemplate = ReferencedObject(self, SBOL_TEMPLATE, SBOL_COMBINATORIAL_DERIVATION, '0', '1', [])
        self.variableComponents = OwnedObject(self, SBOL_VARIABLE_COMPONENTS, '0', '*', [])

    @property
    def strategy(self):
        return self._strategy.value

    @strategy.setter
    def strategy(self, new_strategy):
        self._strategy.set(new_strategy)
github SynBioDex / pySBOL / sbol3 / model.py View on Github external
from .toplevel import TopLevel
from .property import Property, URIProperty
from .constants import *


class Model(TopLevel):
    def __init__(self, rdf_type=SBOL_MODEL, uri=URIRef('example'), source='', language=EDAM_SBML, framework=SBO_CONTINUOUS, version=VERSION_STRING):
        super().__init__(rdf_type, uri, version)
        self._source = URIProperty(self, SBOL_SOURCE, '0', '1', [], source)
        self._language = URIProperty(self, SBOL_LANGUAGE, '0', '1', [], language)
        self._framework = URIProperty(self, SBOL_FRAMEWORK, '0', '1', [], framework)

    @property
    def source(self):
        return self._source.value

    @source.setter
    def source(self, new_source):
        self._source.set(new_source)

    @property
    def language(self):
github SynBioDex / pySBOL / sbol3 / collection.py View on Github external
from .toplevel import TopLevel
from rdflib import URIRef
from .constants import *
from .property import URIProperty


class Collection(TopLevel):

    def __init__(self, type_uri=SBOL_COLLECTION, uri=URIRef("example"), version=VERSION_STRING):
        super().__init__(type_uri, uri, version)
        self._members = URIProperty(self, SBOL_MEMBERS, '0', '*', [])

    @property
    def members(self):
        return self._members.value

    @members.setter
    def members(self, new_members):
        self._members.set(new_members)
github SynBioDex / pySBOL / sbol3 / attachment.py View on Github external
from .toplevel import TopLevel
from .constants import *
from rdflib import URIRef
from .property import URIProperty, LiteralProperty


class Attachment(TopLevel):

    def __init__(self, type_uri=SBOL_ATTACHMENT, uri=URIRef("example"), version=VERSION_STRING, source=''):
        super().__init__(type_uri, uri, version)
        self._source = URIProperty(self, SBOL_SOURCE, '1', '1', [], source)
        self._format = LiteralProperty(self, SBOL_URI, '#format', '0', '1', [])
        self._size = LiteralProperty(self, SBOL_URI, '#size', '0', '1', [])
        self._hash = LiteralProperty(self, SBOL_URI, '#hash', '0', '1', [])

    @property
    def source(self):
        return self._source.value

    @source.setter
    def source(self, new_source):
        self._source.set(new_source)