diff --git a/sbol3/identified.py b/sbol3/identified.py index 36cd8c4..0d44b66 100644 --- a/sbol3/identified.py +++ b/sbol3/identified.py @@ -1,3 +1,4 @@ +import abc import math import posixpath from typing import Union, List, Callable, Any @@ -22,6 +23,32 @@ def __init__(self, identity: str, type_uri: str, *, name: str = None, description: str = None, derived_from: List[str] = None, generated_by: List[str] = None, measures: List[SBOLObject] = None) -> None: + """ + :param identity: this object's Uniform Resource Identifier (URI). + this URI MUST be globally unique among all other Identified + object URIs. See SBOL 3.0.1 specification section 5.1. + This can also be a `displayId`, which will be concatenated + to a default namespace automatically. + :param type_uri: the concrete type of this object, specified as + a URI. These are typically in the SBOL3 namespace, like + `http://sbols.org/v3#Sequence` or + `http://sbols.org/v3#Component`. This can also be the type + URI of an extension class. + :param name: A human-readable name for this object, for display + purposes. + :param description: Per the SBOL 3.0.1 specification, "a more + thorough text description" of this object. + :param derived_from: The URIs of one or more SBOL or non-SBOL + objects from which this object was derived. This property + is defined by the PROV-O ontology. + :param generated_by: The URIs of one or more prov:Activity + objects that describe how this object was generated. This + property is defined by the PROV-O ontology. + :param measures: The URIs of one or more om:Measure objects, + each of which refers to a om:Measure object that describes + measured parameters for this object. om:Measure objects are + defined by the OM ontology + """ super().__init__(identity) self._document = None self._display_id = TextProperty(self, SBOL_DISPLAY_ID, 0, 1) @@ -208,7 +235,16 @@ def serialize(self, graph: rdflib.Graph): graph.add((identity, rdf_prop, rdflib.URIRef(item.identity))) item.serialize(graph) + @abc.abstractmethod def accept(self, visitor: Any) -> Any: + """ + An abstract method for concrete classes to override. This + method is part of the visitor pattern implementation. + + :param visitor: Ignored + :return: Unspecified + :raises: NotImplementedError if not overridden + """ message = f'accept is not implemented for {type(self).__qualname__}' raise NotImplementedError(message)