oldman.client package

Submodules

oldman.client.resource module

class oldman.client.resource.ClientResource(model_manager, session, iri=None, hashless_iri=None, collection_iri=None, iri_fragment=None, is_new=True, **kwargs)[source]

Bases: oldman.core.resource.resource.Resource

ClientResource: resource manipulated by the end-user.

Has access to the session.

TODO: complete the description.

Parameters:
  • iri – IRI of the resource. If not given, this IRI is generated by the main model. Defaults to None.
  • hashless_iri – Hash-less IRI that is given to the main model for generating a new IRI if no id is given. The IRI generator may ignore it. Defaults to None. Must be None if collection_iri is given.
  • collection_iri – IRI of the controller to which this resource belongs. This information is used to generate a new IRI if no id is given. The IRI generator may ignore it. Defaults to None. Must be None if hashless_iri is given.
  • iri_fragment – TODO: describe.

Is not serializable.

classmethod load_from_graph(mediator, model_manager, id, subgraph, is_new=True, collection_iri=None)[source]

Loads a new ClientResource object from a sub-graph.

TODO: update the comments.

Parameters:
  • mediatorMediator object.
  • id – IRI of the resource.
  • subgraphrdflib.Graph object containing triples about the resource.
  • is_new – When is True and id given, checks that the IRI is not already existing in the union_graph. Defaults to True.
Returns:

The Resource object created.

receive_deletion_notification_from_store()[source]

TODO: explain

receive_local_deletion_notification()[source]

TODO: explain and find a better name.

“Pre”-deletion.

session

oldman.client.resource_factory module

class oldman.client.resource_factory.ClientResourceFactory[source]

Bases: object

new_resource(iri=None, hashless_iri=None, collection_iri=None, types=None, iri_fragment=None, is_new=True, **kwargs)[source]

TODO: describe

class oldman.client.resource_factory.DefaultClientResourceFactory(model_manager, session)[source]

Bases: oldman.client.resource_factory.ClientResourceFactory

new_resource(iri=None, hashless_iri=None, collection_iri=None, types=None, iri_fragment=None, is_new=True, **kwargs)[source]

oldman.client.session module

class oldman.client.session.ClientSession[source]

Bases: oldman.core.session.session.Session

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

See oldman.store.store.Store.filter().

first(types=None, hashless_iri=None, eager_with_reversed_attributes=True, pre_cache_properties=None, **kwargs)[source]
new(iri=None, types=None, hashless_iri=None, collection_iri=None, **kwargs)[source]

Creates a new Resource object without saving it in the data_store.

The kwargs dict can contains regular attribute key-values that will be assigned to OMAttribute objects.

TODO: update this doc

Parameters:
  • iri – IRI of the new resource. Defaults to None. If not given, the IRI is generated by the IRI generator of the main model.
  • types – IRIs of RDFS classes the resource is instance of. Defaults to None. Note that these IRIs are used to find the models of the resource (see find_models_and_types() for more details).
  • hashless_iri – hash-less IRI that MAY be considered when generating an IRI for the new resource. Defaults to None. Ignored if id is given. Must be None if collection_iri is given.
  • collection_iri – IRI of the controller to which this resource belongs. This information is used to generate a new IRI if no id is given. The IRI generator may ignore it. Defaults to None. Must be None if hashless_iri is given.
Returns:

A new Resource object.

sparql_filter(query)[source]

See oldman.store.store.Store.sparql_filter().

class oldman.client.session.DefaultClientSession(model_manager, store_proxy)[source]

Bases: oldman.client.session.ClientSession

TODO: find a better name

close()[source]

TODO: implement it

delete(client_resource)[source]

TODO: describe.

Wait for the next flush() to remove the resource from the store.

filter(types=None, hashless_iri=None, limit=None, eager=False, pre_cache_properties=None, **kwargs)[source]
first(types=None, hashless_iri=None, eager_with_reversed_attributes=True, pre_cache_properties=None, **kwargs)[source]
flush(is_end_user=True)[source]

TODO: describe.

TODO: re-implement it, very naive

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

See oldman.store.datastore.DataStore.get().

get_updated_iri(tmp_iri)[source]

TODO: remove it

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

TODO: explain

receive_reference(reference, object_resource=None, object_iri=None)[source]

Not for end-users!

receive_reference_removal_notification(reference)[source]

Not for end-users!

sparql_filter(query)[source]

See oldman.store.store.Store.sparql_filter().

Module contents