[docs]class OMError(Exception):
"""Root of exceptions generated by the oldman package."""
pass
[docs]class ModelGenerationError(OMError):
"""Error occured when generating a new model."""
pass
[docs]class AlreadyAllocatedModelError(ModelGenerationError):
"""The class IRI or the short name of a new model is already allocated."""
pass
[docs]class OMSchemaError(ModelGenerationError):
"""Error in the schema graph and/or the JSON-LD context."""
pass
[docs]class OMPropertyDefError(OMSchemaError):
"""Inconsistency in the definition of a supported property."""
pass
[docs]class OMPropertyDefTypeError(OMPropertyDefError):
"""A RDF property cannot be both an ObjectProperty and a DatatypeProperty."""
pass
[docs]class OMAttributeDefError(OMSchemaError):
"""Inconsistency in the definition of a model class attribute."""
pass
[docs]class OMAlreadyDeclaredDatatypeError(OMAttributeDefError):
"""At least two different datatypes for the same attribute.
You may check the possible datatype inherited from the property (rdfs:range)
and the one specified in the JSON-LD context.
"""
pass
[docs]class OMReservedAttributeNameError(OMAttributeDefError):
"""Some attribute names are reserved and should not
be included in the JSON-LD context."""
pass
[docs]class OMUndeclaredClassNameError(ModelGenerationError):
"""The name of the model class should be defined in the JSON-LD context."""
pass
[docs]class OMExpiredMethodDeclarationTimeSlotError(ModelGenerationError):
"""All methods must be declared before creating a first model."""
pass
[docs]class OMUserError(OMError):
"""Error when accessing or editing objects."""
pass
[docs]class OMEditError(OMUserError):
"""Runtime errors, occuring when editing or creating an object."""
pass
[docs]class OMAttributeTypeCheckError(OMEditError):
"""The value assigned to the attribute has wrong type."""
pass
[docs]class OMRequiredPropertyError(OMEditError):
"""A required property has no value."""
pass
[docs]class OMReadOnlyAttributeError(OMEditError):
"""End-users are not allowed to edit this attribute."""
pass
[docs]class OMUniquenessError(OMEditError):
"""Attribute uniqueness violation.
Example: IRI illegal reusing.
"""
pass
[docs]class OMWrongResourceError(OMEditError):
"""Not updating the right object."""
pass
[docs]class OMDifferentHashlessIRIError(OMEditError):
"""When creating or updating an object with a different hashless IRI is forbidden.
Blank nodes are not concerned.
"""
pass
[docs]class OMForbiddenSkolemizedIRIError(OMEditError):
"""When updating a skolemized IRI from the local domain is forbidden."""
pass
[docs]class OMRequiredHashlessIRIError(OMEditError):
"""No hash-less IRI has been given."""
pass
[docs]class OMUnauthorizedTypeChangeError(OMEditError):
"""When updating a resource with new types without explicit authorization."""
pass
[docs]class OMAccessError(OMUserError):
"""Error when accessing objects."""
pass
[docs]class OMAttributeAccessError(OMAccessError):
"""When such an attribute cannot be identified
(is not supported or no model has been found).
"""
pass
[docs]class OMClassInstanceError(OMAccessError):
"""The object is not an instance of the expected RDFS class."""
pass
[docs]class OMObjectNotFoundError(OMAccessError):
"""When the object is not found."""
pass
[docs]class OMHashIriError(OMAccessError):
"""A hash IRI has been given instead of a hash-less IRI."""
pass
[docs]class OMSPARQLError(OMAccessError):
"""Invalid SPARQL query given."""
pass
[docs]class OMInternalError(OMError):
""" Do not expect it. """
pass
[docs]class OMSPARQLParseError(OMInternalError):
"""Invalid SPARQL request."""
pass
[docs]class OMAlreadyGeneratedAttributeError(OMInternalError):
"""Attribute generation occurs only once per SupportedProperty.
You should not try to add metadata or regenerate after that.
"""
pass
[docs]class OMDataStoreError(OMError):
"""Error detected in the stored data."""
pass
[docs]class UnsupportedDataStorageFeatureException(OMDataStoreError):
"""Feature not supported by the data store."""