oldman.client.mediation package

Submodules

oldman.client.mediation.default module

class oldman.client.mediation.default.DefaultMediator(data_stores, oper_extractor, schema_graph=None, attr_extractor=None)[source]

Bases: oldman.client.mediation.mediator.Mediator

create_session()[source]

TODO: explain it

declare_method(method, name, class_iri)[source]

TODO: point this comment to the definition.

get_client_model(class_name_or_iri)[source]
import_store_model(class_iri, data_store=None)[source]
import_store_models(store=None)[source]

TODO: check possible conflicts with local models.

oldman.client.mediation.mediator module

class oldman.client.mediation.mediator.Mediator[source]

Bases: object

TODO: describe

create_session()[source]

TODO: explain it

declare_method(method, name, class_iri)[source]

Attaches a method to the Resource objects that are instances of a given RDFS class.

Like in Object-Oriented Programming, this method can be overwritten by attaching a homonymous method to a class that has a higher inheritance priority (such as a sub-class).

To benefit from this method (or an overwritten one), Resource objects must be associated to a Model that corresponds to the RDFS class or to one of its subclasses.

Parameters:
  • method – Python function that takes as first argument a Resource object.
  • name – Name assigned to this method.
  • class_iri – Targeted RDFS class. If not overwritten, all the instances (Resource objects) should inherit this method.
get_client_model(class_name_or_iri)[source]
import_store_model(class_iri, store=None)[source]
import_store_models(store=None)[source]

oldman.client.mediation.store_proxy module

class oldman.client.mediation.store_proxy.DefaultStoreProxy(store_selector, conversion_manager)[source]

Bases: oldman.client.mediation.store_proxy.StoreProxy

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

TODO: explain

:return list of ClientResource ?

first(client_tracker, resource_factory, types=None, hashless_iri=None, pre_cache_properties=None, eager_with_reversed_attributes=True, **kwargs)[source]
flush(resource_factory, client_resources_to_update, client_resources_to_delete, is_end_user)[source]

TODO: explain

:return list of the new ClientResource ?

get(client_tracker, resource_factory, iri, types=None, eager_with_reversed_attributes=True)[source]

TODO: explain

TODO: also consider the client resource tracker.

:return a ClientResource

sparql_filter(client_tracker, resource_factory, query)[source]

TODO: explain

:return list of ClientResource ?

class oldman.client.mediation.store_proxy.StoreProxy[source]

Bases: object

TODO: find a better name

filter(resource_tracker, resource_factory, types=None, hashless_iri=None, limit=None, eager=False, pre_cache_properties=None, **kwargs)[source]

TODO: explain

:return list of ClientResource ?

first(resource_finder, resource_factory, types=None, hashless_iri=None, pre_cache_properties=None, eager_with_reversed_attributes=True, **kwargs)[source]
flush(resource_factory, client_resources_to_update, client_resources_to_delete, is_end_user)[source]

TODO: explain

:return list of the updated ClientResource ?

get(client_tracker, resource_factory, iri, types=None, eager_with_reversed_attributes=True)[source]

TODO: explain

:return a ClientResource

sparql_filter(resource_finder, resource_factory, query)[source]

TODO: explain

:return list of ClientResource ?

oldman.client.mediation.store_selector module

class oldman.client.mediation.store_selector.StoreSelector(stores)[source]

TODO: continue

select_sparql_stores(query)[source]
select_store(client_resource, **kwargs)[source]

TODO: what is the correct behavior when multiple stores are returned?

select_stores(id=None, **kwargs)[source]
stores

Module contents