def create_from_graph(cls, uri, graph, **kwds): #---------------------------------------------- from biosignalml.data.time import TemporalEntity # Prevent a circular import self = cls(uri, None, **kwds) self.add_metadata(graph) if self.time is not None: self.time = TemporalEntity.create_from_graph(self.time, graph) return self
def create_from_graph(cls, uri, graph, **kwds): #---------------------------------------------- from biosignalml.data.time import TemporalEntity # Prevent a circular import self = cls(uri, None, **kwds) self.add_metadata(graph) if self.time is not None: self.time = TemporalEntity.create_from_graph(self.time, graph) return self
def create_from_graph(cls, uri, graph, **kwds): #---------------------------------------------- ''' Create a new instance of a Segment, setting attributes from RDF triples in a graph. :param uri: The URI of the Segment. :param graph: A RDF graph. :type graph: :class:`~biosignalml.rdf.Graph` :rtype: :class:`Segment` ''' from biosignalml.data.time import TemporalEntity # Prevent a circular import self = super(Segment, cls).create_from_graph(cls, uri, graph, **kwds) if self.time is not None: ## Could add_metadata automatically do this for sub-elements?? ## PropertyMap would need to know class (TemporalEntity) self.time = TemporalEntity.create_from_graph(self.time, graph) return self
def create_from_graph(cls, uri, graph, **kwds): #---------------------------------------------- ''' Create a new instance of a Segment, setting attributes from RDF triples in a graph. :param uri: The URI of the Segment. :param graph: A RDF graph. :type graph: :class:`~biosignalml.rdf.Graph` :rtype: :class:`Segment` ''' from biosignalml.data.time import TemporalEntity # Prevent a circular import self = super(Segment, cls).create_from_graph(cls, uri, graph, **kwds) if self.time is not None: ## Could add_metadata automatically do this for sub-elements?? ## PropertyMap would need to know class (TemporalEntity) self.time = TemporalEntity.create_from_graph(self.time, graph) return self