How to use the sbol3.object.SBOLObject 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 / document.py View on Github external
# constructor. New property values will be added as properties
            # are parsed from the input file
            for prop_name, values in new_obj.properties.items():
                values.clear()
            new_obj.identity = subject
            # Update document
            self.SBOLObjects[new_obj.identity] = new_obj
            new_obj.doc = self
            # For now, set the parent to the Document. This may get overwritten later for child objects.
            new_obj.parent = self
            # If the new object is TopLevel, add to the Document's property store
            if new_obj.is_top_level():
                self.owned_objects[new_obj.rdf_type].append(new_obj)
        elif subject not in self.SBOLObjects and obj not in self.SBOL_DATA_MODEL_REGISTER:
            # Generic TopLevels
            new_obj = SBOLObject()
            new_obj.identity = subject
            new_obj.rdf_type = obj
            self.SBOLObjects[new_obj.identity] = new_obj
            new_obj.doc = self
github SynBioDex / pySBOL / sbol3 / document.py View on Github external
import logging
from logging.config import fileConfig


class Document(Identified):
    """
    The Document is a container for all SBOL data objects.

    In a previous era, engineers might sit at a drafting board and draft a design by hand.
    The engineer's drafting sheet in LibSBOL is called a Document. The Document serves as a container,
    initially empty, for SBOL data objects. All file I/O operations are performed on the Document
    to populate it with SBOL objects representing design elements.
    """

    SBOL_DATA_MODEL_REGISTER = {
        URIRef(UNDEFINED): SBOLObject,
        URIRef(SBOL_IDENTIFIED): Identified,
        URIRef(SBOL_COMPONENT_DEFINITION): ComponentDefinition,
        URIRef(SBOL_SEQUENCE_ANNOTATION): SequenceAnnotation,
        URIRef(SBOL_SEQUENCE): Sequence,
        URIRef(SBOL_COMPONENT): Component,
        URIRef(SBOL_FUNCTIONAL_COMPONENT): FunctionalComponent,
        URIRef(SBOL_MODULE_DEFINITION): ModuleDefinition,
        URIRef(SBOL_MODULE): Module,
        URIRef(SBOL_INTERACTION): Interaction,
        URIRef(SBOL_PARTICIPATION): Participation,
        URIRef(SBOL_MODEL): Model,
        URIRef(SBOL_SEQUENCE_CONSTRAINT): SequenceConstraint,
        URIRef(SBOL_RANGE): Range,
        URIRef(SBOL_MAPS_TO): MapsTo,
        URIRef(SBOL_CUT): Cut,
        URIRef(SBOL_COLLECTION): Collection,