diff options
author | Iwan Aucamp <aucampia@gmail.com> | 2022-04-14 20:05:30 +0200 |
---|---|---|
committer | Iwan Aucamp <aucampia@gmail.com> | 2022-04-14 20:05:30 +0200 |
commit | 436bc1e2ed35386ab74cb7319f7100d0b9f63c78 (patch) | |
tree | c47ca36501a14a264d0ffe740fcad9c2ba484ab5 /rdflib/exceptions.py | |
parent | 8bad917cbc8213e176a47fd37d24f487485dda17 (diff) | |
download | rdflib-436bc1e2ed35386ab74cb7319f7100d0b9f63c78.tar.gz |
Remove `(TypeCheck|SubjectType|PredicateType|ObjectType)Error` and related
Also remove
`check_(context|subject|predicate|object|statement|pattern)`.
It seems nothing is using these exceptions and functions.
Technically this does remove parts of the public API, but I would argue
they are "buggy" parts as anything that use them would be sorely
disappointed to find that the behaviour is not as expect, and these
functions/exceptions don't serve any function related to the aim of
RDFLib unless they are integrated with the rest of RDFLib.
Diffstat (limited to 'rdflib/exceptions.py')
-rw-r--r-- | rdflib/exceptions.py | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/rdflib/exceptions.py b/rdflib/exceptions.py index 4e31c0b8..2d71e6e2 100644 --- a/rdflib/exceptions.py +++ b/rdflib/exceptions.py @@ -4,11 +4,6 @@ TODO: __all__ = [ "Error", - "TypeCheckError", - "SubjectTypeError", - "PredicateTypeError", - "ObjectTypeError", - "ContextTypeError", "ParserError", ] @@ -21,61 +16,6 @@ class Error(Exception): self.msg = msg -class TypeCheckError(Error): - """Parts of assertions are subject to type checks.""" - - def __init__(self, node): - Error.__init__(self, node) - self.type = type(node) - self.node = node - - -class SubjectTypeError(TypeCheckError): - """Subject of an assertion must be an instance of URIRef.""" - - def __init__(self, node): - TypeCheckError.__init__(self, node) - self.msg = "Subject must be instance of URIRef or BNode: %s(%s)" % ( - self.node, - self.type, - ) - - -class PredicateTypeError(TypeCheckError): - """Predicate of an assertion must be an instance of URIRef.""" - - def __init__(self, node): - TypeCheckError.__init__(self, node) - self.msg = "Predicate must be a URIRef instance: %s(%s)" % ( - self.node, - self.type, - ) - - -class ObjectTypeError(TypeCheckError): - """Object of an assertion must be an instance of URIRef, Literal, - or BNode.""" - - def __init__(self, node): - TypeCheckError.__init__(self, node) - self.msg = ( - "\ -Object must be instance of URIRef, Literal, or BNode: %s(%s)" - % (self.node, self.type) - ) - - -class ContextTypeError(TypeCheckError): - """Context of an assertion must be an instance of URIRef.""" - - def __init__(self, node): - TypeCheckError.__init__(self, node) - self.msg = "Context must be instance of URIRef or BNode: %s(%s)" % ( - self.node, - self.type, - ) - - class ParserError(Error): """RDF Parser error.""" |