oldman.client package¶
Subpackages¶
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.ResourceClientResource: 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
ClientResourceobject from a sub-graph.TODO: update the comments.
Parameters: - mediator –
Mediatorobject. - id – IRI of the resource.
- subgraph –
rdflib.Graphobject 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
Resourceobject created.- mediator –
-
receive_local_deletion_notification()[source]¶ TODO: explain and find a better name.
“Pre”-deletion.
-
session¶
oldman.client.resource_factory module¶
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
Resourceobject without saving it in the data_store.The kwargs dict can contains regular attribute key-values that will be assigned to
OMAttributeobjects.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
Resourceobject.
-
-
class
oldman.client.session.DefaultClientSession(model_manager, store_proxy)[source]¶ Bases:
oldman.client.session.ClientSessionTODO: find a better name
-
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]¶
-