Skip to content

Commit

Permalink
Merge pull request #346 from tcmitchell/321-identified-doc
Browse files Browse the repository at this point in the history
Add documentation to `Identified.__init__`
  • Loading branch information
tcmitchell authored Nov 1, 2021
2 parents 9f41705 + 2152936 commit b3e4f16
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions sbol3/identified.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import abc
import math
import posixpath
from typing import Union, List, Callable, Any
Expand All @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit b3e4f16

Please sign in to comment.