Example #1
0
    def get_event(self, uri):
        # ------------------------
        """
    Get an Event from its recording's graph.

    :param uri: The URI of an Event.
    :rtype: :class:`~biosignalml.Event`
    """
        return Event.create_from_graph(uri, self)
Example #2
0
    def get_event(self, uri):
        #------------------------
        """
    Get an Event from its recording's graph.

    :param uri: The URI of an Event.
    :rtype: :class:`~biosignalml.Event`
    """
        return Event.create_from_graph(uri, self)
Example #3
0
    def get_event(self, uri, graph_uri=None):
        # -----------------------------------------
        """
    Get an Event from the repository.

    :param uri: The URI of an Event.
    :param graph_uri: An optional URI of the graph to query.
    :rtype: :class:`~biosignalml.Event`
    """
        # The following line works around a Virtuoso problem
        if graph_uri is None:
            graph_uri = self.get_graph_and_recording_uri(uri)[0]
        graph = self.get_resource_as_graph(uri, BSML.Event, graph_uri)

        ##### Put into Event.load_from_graph()   ????
        for tm in graph.get_objects(uri, BSML.time):  ## This could be improved...
            graph.append_graph(self.get_resource_as_graph(tm.uri, BSML.Instant, graph_uri))
            graph.append_graph(self.get_resource_as_graph(tm.uri, BSML.Interval, graph_uri))
        return Event.create_from_graph(uri, graph)
Example #4
0
    def get_event(self, uri, graph_uri=None):
        #-----------------------------------------
        """
    Get an Event from the repository.

    :param uri: The URI of an Event.
    :param graph_uri: An optional URI of the graph to query.
    :rtype: :class:`~biosignalml.Event`
    """
        # The following line works around a Virtuoso problem
        if graph_uri is None:
            graph_uri = self.get_graph_and_recording_uri(uri)[0]
        graph = self.get_resource_as_graph(uri, BSML.Event, graph_uri)

        ##### Put into Event.load_from_graph()   ????
        for tm in graph.get_objects(uri,
                                    BSML.time):  ## This could be improved...
            graph.append_graph(
                self.get_resource_as_graph(tm.uri, BSML.Instant, graph_uri))
            graph.append_graph(
                self.get_resource_as_graph(tm.uri, BSML.Interval, graph_uri))
        return Event.create_from_graph(uri, graph)