Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I added a new method to convert a multi-relational rdf-graph file into a non-relational graph of type
datastructures::Graph
, called "relation-tail merging".It can be used by calling the
datastructures::Graph::rdflib_to_graph()
method with the new input-parameterrelation_tail_merging=True
.The process of relation-tail merging tries to solve the issue that predicate-nodes often carry little to no information (which is why these candidates are usually skipped during walk mining).
Relation_tail_merging works as follows (is also explained in our corresponding paper, which is currently under review):
First, the next tail node is selected, t, as well as a set of nr relations of identical type, r, where the topological form ()-r->(t) is given. The process of relation-tail merging then involves inserting a new node, rt, so that ()-r->(t) turns into (*)-->(rt)-->(t). The new directional edges, -->, are now typeless, and the new inserted node, rt, represents a "relation-modified" node and is named accordingly in the form <type_of_r>_<name_of_t>.
To implement this method, i changed the
datastructures::Graph::rdflib_to_graph()
method accordingly and i also applied a small change to the functionMINDWALCMixin::_generate_candidates()
, so that, if we use a relation-tail merged graph, MINDWALC does also collect walks with odd depths, so that also (rt) nodes are considered during candidate collection.I also added a mew function to the datastructures::Graph class, called graph_to_neo4j(). This method can load a given datastructures::Graph instance into a running and empty neo4j database. This can be useful to investigate our graph using the neo4j desktop app.