예제 #1
0
 def open(self, configuration, create=False):
     """Raise a ModificationException if create, as this graph is read-only.
     """
     if create:
         raise ModificationException() #ReadOnlyGraph does not support this
     else:
         Graph.open(self, configuration, create)
예제 #2
0
 def parse(self,
           source=None,
           publicID=None,
           format=None,
           location=None,
           file=None,
           data=None,
           **args):
     """Raise a ModificationException as this graph is read-only.
     """
     raise ModificationException()  #ReadOnlyGraph does not support this
예제 #3
0
class ReadOnlyGraph(Graph):
    """A read-only version of rdflib.Graph.
    """

    # Invalid name #pylint: disable=C0103
    # Redefining built-in #pylint: disable=W0622

    def __init__(self,
                 store_or_graph='default',
                 identifier=None,
                 namespace_manager=None):
        if isinstance(store_or_graph, Graph):
            assert identifier is None and namespace_manager is None
            Graph.__init__(self, store_or_graph.store,
                           store_or_graph.identifier,
                           store_or_graph.namespace_manager)
        else:
            Graph.__init__(self, store_or_graph, identifier, namespace_manager)

    def destroy(self, configuration):
        """Raise a ModificationException as this graph is read-only.
        """
        raise ModificationException()  #ReadOnlyGraph does not support this

    def commit(self):
        """Raise a ModificationException as this graph is read-only.
        """
        raise ModificationException()  #ReadOnlyGraph does not support this

    def rollback(self):
        """Raise a ModificationException as this graph is read-only.
        """
        raise ModificationException()  #ReadOnlyGraph does not support this

    def open(self, configuration, create=False):
        """Raise a ModificationException if create, as this graph is read-only.
        """
        if create:
            raise ModificationException()  #ReadOnlyGraph does not support this
        else:
            Graph.open(self, configuration, create)

    def add(self, (s, p, o)):
        """Raise a ModificationException as this graph is read-only.
        """
        raise ModificationException()  #ReadOnlyGraph does not support this
예제 #4
0
 def load(self, source, publicID=None, format="xml"):
     """Raise a ModificationException as this graph is read-only.
     """
     raise ModificationException() #ReadOnlyGraph does not support this
예제 #5
0
 def bind(self, prefix, namespace, override=True):
     """Raise a ModificationException as this graph is read-only.
     """
     raise ModificationException() #ReadOnlyGraph does not support this
예제 #6
0
 def __isub__(self, other):
     """Raise a ModificationException as this graph is read-only.
     """
     raise ModificationException() #ReadOnlyGraph does not support this
예제 #7
0
 def addN(self, quads):
     """Raise a ModificationException as this graph is read-only.
     """
     raise ModificationException() #ReadOnlyGraph does not support this
예제 #8
0
 def rollback(self):
     """Raise a ModificationException as this graph is read-only.
     """
     raise ModificationException() #ReadOnlyGraph does not support this
예제 #9
0
 def destroy(self, configuration):
     """Raise a ModificationException as this graph is read-only.
     """
     raise ModificationException() #ReadOnlyGraph does not support this
예제 #10
0
            Graph.open(self, configuration, create)

    def add(self, (s, p, o)):
        """Raise a ModificationException as this graph is read-only.
        """
        raise ModificationException() #ReadOnlyGraph does not support this

    def addN(self, quads):
        """Raise a ModificationException as this graph is read-only.
        """
        raise ModificationException() #ReadOnlyGraph does not support this

    def remove(self, (s, p, o)):
        """Raise a ModificationException as this graph is read-only.
        """
        raise ModificationException() #ReadOnlyGraph does not support this

    def __iadd__(self, other):
        """Raise a ModificationException as this graph is read-only.
        """
        raise ModificationException() #ReadOnlyGraph does not support this

    def __isub__(self, other):
        """Raise a ModificationException as this graph is read-only.
        """
        raise ModificationException() #ReadOnlyGraph does not support this

    def set(self, (subject, predicate, object)):
        """Raise a ModificationException as this graph is read-only.
        """
        raise ModificationException() #ReadOnlyGraph does not support this
예제 #11
0
 def parse(self, source, publicID=None, format="xml", **args):
     raise ModificationException()
예제 #12
0
 def __isub__(self, other):
     raise ModificationException()
예제 #13
0
 def remove(self, triple_or_quad):
     raise ModificationException()
예제 #14
0
 def addN(self, triple_or_quad):
     raise ModificationException()