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 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
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
def load(self, source, publicID=None, format="xml"): """Raise a ModificationException as this graph is read-only. """ raise ModificationException() #ReadOnlyGraph does not support this
def bind(self, prefix, namespace, override=True): """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 addN(self, quads): """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 destroy(self, configuration): """Raise a ModificationException as this graph is read-only. """ raise ModificationException() #ReadOnlyGraph does not support this
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
def parse(self, source, publicID=None, format="xml", **args): raise ModificationException()
def __isub__(self, other): raise ModificationException()
def remove(self, triple_or_quad): raise ModificationException()
def addN(self, triple_or_quad): raise ModificationException()