Functions:
-
get_attr_path–Get a previously loaded execution path from a model object.
-
get_path_of_node–Get the execution path associated with an RDF node.
-
load_attr_path–Load a resource path from an RDF graph into a model object.
get_attr_path
get_attr_path(model)
Get a previously loaded execution path from a model object.
Parameters:
-
model(ModelBase) –Model object containing the loaded path.
Returns:
-
str–The model path as a string.
Raises:
-
ValueError–If the model is not a
ResourceWithPath.
Source code in src/rdf_utils/models/execution.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
get_path_of_node
get_path_of_node(graph, node_id)
Get the execution path associated with an RDF node.
Parameters:
-
graph(Graph) –RDF graph containing the node.
-
node_id(URIRef) –URI of the node whose path should be loaded.
Returns:
-
str–The node path as a string.
Raises:
-
TypeError–If the node path is missing or is not an RDF literal.
Source code in src/rdf_utils/models/execution.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
load_attr_path
load_attr_path(graph, model, **kwargs)
Load a resource path from an RDF graph into a model object.
Models without the ResourceWithPath type are left unchanged.
Parameters:
-
graph(Graph) –RDF graph containing the model data.
-
model(ModelBase) –Model object to update.
-
kwargs(Any, default:{}) –Additional loader arguments, ignored by this loader.
Raises:
-
ValueError–If a
ResourceWithPathmodel has no 'path' predicate linking to a literal.
Source code in src/rdf_utils/models/execution.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |