Fold Predicate#
The Fold Predicate operation can be use to transform every instance of a predicate
to a node property such that if S - P -> O,
Pbecomes the node property name on nodeSObecomes the value for the node propertyPon nodeS
kgx.graph_operations.fold_predicate#
- kgx.graph_operations.fold_predicate(graph: BaseGraph, predicate: str, remove_prefix: bool = False) None[source]#
Fold predicate as node property where every edge with
predicatewill be folded as a node property.- Parameters:
graph (kgx.graph.base_graph.BaseGraph) – The graph
predicate (str) – The predicate to fold
remove_prefix (bool) – Whether or not to remove prefix from the predicate (
False, by default)