oldman.core package¶
Subpackages¶
Submodules¶
oldman.core.common module¶
oldman.core.exception module¶
-
exception
oldman.core.exception.AlreadyAllocatedModelError[source]¶ Bases:
oldman.core.exception.ModelGenerationErrorThe class IRI or the short name of a new model is already allocated.
-
exception
oldman.core.exception.ModelGenerationError[source]¶ Bases:
oldman.core.exception.OMErrorError when generating a new model.
-
exception
oldman.core.exception.OMAccessError[source]¶ Bases:
oldman.core.exception.OMUserErrorError when accessing objects.
-
exception
oldman.core.exception.OMAlreadyDeclaredDatatypeError[source]¶ Bases:
oldman.core.exception.OMAttributeDefErrorAt 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.
-
exception
oldman.core.exception.OMAlreadyGeneratedAttributeError[source]¶ Bases:
oldman.core.exception.OMInternalErrorAttribute generation occurs only once per SupportedProperty.
You should not try to add metadata or regenerate after that.
-
exception
oldman.core.exception.OMAttributeAccessError[source]¶ Bases:
oldman.core.exception.OMAccessErrorWhen such an attribute cannot be identified (is not supported or no model has been found).
-
exception
oldman.core.exception.OMAttributeDefError[source]¶ Bases:
oldman.core.exception.OMSchemaErrorInconsistency in the definition of a model class attribute.
-
exception
oldman.core.exception.OMAttributeTypeCheckError[source]¶ Bases:
oldman.core.exception.OMEditErrorThe value assigned to the attribute has wrong type.
-
exception
oldman.core.exception.OMBadRequestException[source]¶ Bases:
oldman.core.exception.OMControllerExceptionTODO: describe
Error: 400
-
exception
oldman.core.exception.OMClassInstanceError[source]¶ Bases:
oldman.core.exception.OMAccessErrorThe object is not an instance of the expected RDFS class.
-
exception
oldman.core.exception.OMControllerException[source]¶ Bases:
exceptions.ExceptionTODO: describe
-
exception
oldman.core.exception.OMDifferentHashlessIRIError[source]¶ Bases:
oldman.core.exception.OMIriError,oldman.core.exception.OMEditErrorWhen creating or updating an object with a different hashless IRI is forbidden.
Blank nodes are not concerned.
-
exception
oldman.core.exception.OMEditError[source]¶ Bases:
oldman.core.exception.OMUserErrorRuntime errors, occuring when editing or creating an object.
-
exception
oldman.core.exception.OMError[source]¶ Bases:
exceptions.ExceptionRoot of exceptions generated by the oldman package expected HTTP ones.
-
exception
oldman.core.exception.OMExpiredMethodDeclarationTimeSlotError[source]¶ Bases:
oldman.core.exception.ModelGenerationErrorAll methods must be declared before creating a first model.
-
exception
oldman.core.exception.OMForbiddenOperationException[source]¶ Bases:
oldman.core.exception.OMControllerExceptionNo chance TODO: improve
-
exception
oldman.core.exception.OMForbiddenSkolemizedIRIError[source]¶ Bases:
oldman.core.exception.OMEditErrorWhen updating a skolemized IRI from the local domain is forbidden.
-
exception
oldman.core.exception.OMHashIriError[source]¶ Bases:
oldman.core.exception.OMAccessErrorA hash IRI has been given instead of a hash-less IRI.
-
exception
oldman.core.exception.OMInternalError[source]¶ Bases:
oldman.core.exception.OMErrorDo not expect it.
-
exception
oldman.core.exception.OMIriError[source]¶ Bases:
oldman.core.exception.OMRuntimeErrorRoot class for problems with an IRI (generation, validation).
-
exception
oldman.core.exception.OMMethodNotAllowedException[source]¶ Bases:
oldman.core.exception.OMControllerException405
-
exception
oldman.core.exception.OMNotAcceptableException[source]¶ Bases:
oldman.core.exception.OMControllerException406 Not Acceptable
TODO: indicate the content-type
-
exception
oldman.core.exception.OMObjectNotFoundError[source]¶ Bases:
oldman.core.exception.OMAccessErrorWhen the object is not found.
-
exception
oldman.core.exception.OMPropertyDefError[source]¶ Bases:
oldman.core.exception.OMSchemaErrorInconsistency in the definition of a supported property.
-
exception
oldman.core.exception.OMPropertyDefTypeError[source]¶ Bases:
oldman.core.exception.OMPropertyDefErrorA RDF property cannot be both an ObjectProperty and a DatatypeProperty.
-
exception
oldman.core.exception.OMReadOnlyAttributeError[source]¶ Bases:
oldman.core.exception.OMEditErrorEnd-users are not allowed to edit this attribute.
-
exception
oldman.core.exception.OMRequiredAuthenticationException[source]¶ Bases:
oldman.core.exception.OMControllerExceptionTry again TODO: improve
-
exception
oldman.core.exception.OMRequiredHashlessIRIError[source]¶ Bases:
oldman.core.exception.OMEditErrorNo hash-less IRI has been given.
-
exception
oldman.core.exception.OMRequiredPropertyError[source]¶ Bases:
oldman.core.exception.OMEditErrorA required property has no value.
-
exception
oldman.core.exception.OMReservedAttributeNameError[source]¶ Bases:
oldman.core.exception.OMAttributeDefErrorSome attribute names are reserved and should not be included in the JSON-LD context.
-
exception
oldman.core.exception.OMResourceNotFoundException[source]¶ Bases:
oldman.core.exception.OMControllerExceptionTODO: describe
-
exception
oldman.core.exception.OMRuntimeError[source]¶ Bases:
oldman.core.exception.OMErrorError at runtime after the initialization.
-
exception
oldman.core.exception.OMSPARQLError[source]¶ Bases:
oldman.core.exception.OMAccessErrorInvalid SPARQL query given.
-
exception
oldman.core.exception.OMSPARQLParseError[source]¶ Bases:
oldman.core.exception.OMInternalErrorInvalid SPARQL request.
-
exception
oldman.core.exception.OMSchemaError[source]¶ Bases:
oldman.core.exception.ModelGenerationErrorError in the schema graph and/or the JSON-LD context.
-
exception
oldman.core.exception.OMStoreError[source]¶ Bases:
oldman.core.exception.OMRuntimeErrorError detected in the stored data.
-
exception
oldman.core.exception.OMTemporaryIriError[source]¶ Bases:
oldman.core.exception.OMEditErrorWhen saving a Resource that has an attribute that points to a temporary IRI.
Bases:
oldman.core.exception.OMEditErrorWhen updating a resource with new types without explicit authorization.
-
exception
oldman.core.exception.OMUndeclaredClassNameError[source]¶ Bases:
oldman.core.exception.ModelGenerationErrorThe name of the model class should be defined in the JSON-LD context.
-
exception
oldman.core.exception.OMUniquenessError[source]¶ Bases:
oldman.core.exception.OMEditErrorAttribute uniqueness violation.
Example: IRI illegal reusing.
-
exception
oldman.core.exception.OMUnsupportedUserIRIError[source]¶ Bases:
oldman.core.exception.OMIriError,oldman.core.exception.OMEditErrorThe IRI provided by the user is not supported.
-
exception
oldman.core.exception.OMUserError[source]¶ Bases:
oldman.core.exception.OMRuntimeErrorError when accessing or editing objects.
-
exception
oldman.core.exception.OMWrongResourceError[source]¶ Bases:
oldman.core.exception.OMEditErrorNot updating the right object.
-
exception
oldman.core.exception.UnsupportedDataStorageFeatureException[source]¶ Bases:
oldman.core.exception.OMStoreErrorFeature not supported by the data store.
oldman.core.id module¶
-
class
oldman.core.id.OMId(iri, is_permanent)[source]¶ TODO: explain why an ID object and not a simple IRI. An ID can be temporary.
Immutable data structure.
-
fragment¶ TODO: explain
-
hashless_iri¶ TODO: explain
-
iri¶
-
is_blank_node¶ TODO: explain
-
is_permanent¶
-
-
class
oldman.core.id.PermanentId(iri)[source]¶ Bases:
oldman.core.id.OMIdTODO: explain
-
class
oldman.core.id.TemporaryId(suggested_hashless_iri=None, suggested_iri_fragment=None, collection_iri=None, can_remain_bnode=True)[source]¶ Bases:
oldman.core.id.OMIdTODO: describe
-
can_remain_bnode¶ Returns True if is currently a blank node and may remain it before being stored.
-
collection_iri¶
-
suggested_fragment¶ TODO: explain
-
suggested_hashless_iri¶ TODO: explain
-
oldman.core.vocabulary module¶
oldman.vocabulary¶
RDF vocabulary used by OldMan. Some of it is specific to OldMan.
TODO: replace these URNs by URLs.
Parent model prioritization
In RDF, a class is often the child of multiple classes. When the code inherited from these classes (common practise in Object-Oriented Programming) is conflicting, arbitration is necessary.
In this library, we provide a RDF vocabulary to declare priorities for each parent of a given child class. A priority statement is declared as follows:
?cls <urn:oldman:model:ordering:hasPriority> [
<urn:oldman:model:ordering:class> ?parent1 ;
<urn:oldman:model:ordering:priority> 2
].
By default, when no priority is declared for a pair (child, parent), its priority value is set to 0.
-
oldman.core.vocabulary.NEXT_NUMBER_IRI= 'urn:oldman:nextNumber'¶ Used to increment IRIs.