oldman.client.model package

Submodules

oldman.client.model.manager module

class oldman.client.model.manager.ClientModelManager(oper_extractor, declare_default_operation_functions=True, **kwargs)[source]

Bases: oldman.core.model.manager.ModelManager

Client ModelManager.

In charge of the conversion between and store and client models.

create_model(class_name_or_iri, context_iri_or_payload, untyped=False, is_default=False, context_file_path=None, accept_new_blank_nodes=False)[source]

TODO: describe

import_model(store_model, is_default=False, store_schema_graph=None)[source]

Imports a store model. Creates the corresponding client model.

oldman.client.model.model module

class oldman.client.model.model.ClientModel(name, class_iri, ancestry_iris, context, om_attributes, operations=None, local_context=None, accept_new_blank_nodes=False)[source]

Bases: oldman.core.model.model.Model

TODO: describe.

TODO: further study this specific case.

Contains methods for end-users (–> layer above the user mediator).

all(session, limit=None, eager=False)[source]

Finds every Resource object that is instance of its RDFS class.

Parameters:
  • limit – Upper bound on the number of solutions returned (SPARQL LIMIT). Positive integer. Defaults to None.
  • eager – If True loads all the Resource objects within one single SPARQL query. Defaults to False (lazy).
Returns:

A generator of Resource objects.

classmethod copy_store_model(store_model, operations)[source]

TODO: describe

declare_method(method, name, ancestor_class_iri)[source]

TODO: describe. Not for end-users!

filter(session, hashless_iri=None, limit=None, eager=True, pre_cache_properties=None, **kwargs)[source]

Finds the Resource objects matching the given criteria.

The class_iri attribute is added to the types.

See oldman.resource.finder.ResourceFinder.filter() for further details.

first(session, hashless_iri=None, eager_with_reversed_attributes=True, pre_cache_properties=None, **kwargs)[source]

Finds the Resource objects matching the given criteria.

The class_iri attribute is added to the types.

See oldman.resource.finder.ResourceFinder.filter() for further details.

get(session, iri, eager_with_reversed_attributes=None)[source]

Gets the first Resource object matching the given criteria.

The class_iri attribute is added to the types. Also looks if reversed attributes should be considered eagerly.

See oldman.store.datastore.DataStore.get() for further details.

get_operation(http_method)[source]

TODO: describe

get_operation_by_name(name)[source]

TODO: describe

methods

dict of Python functions that takes as first argument a Resource object. Keys are the method names.

new(session, iri=None, hashless_iri=None, collection_iri=None, **kwargs)[source]

Creates a new Resource object without saving it.

The class_iri attribute is added to the types.

See new() for more details.

oldman.client.model.operation module

TODO: explain

class oldman.client.model.operation.Operation(http_method, excepted_type, returned_type, function, name)[source]

Bases: object

TODO: describe

expected_type
name
returned_type
oldman.client.model.operation.not_implemented(resource, **kwargs)[source]

Module contents