Skip to content

[DRAFT] 2-rpq-all-paths#11

Open
suvorovrain wants to merge 4 commits intostablefrom
rain/2-rpq-all-paths
Open

[DRAFT] 2-rpq-all-paths#11
suvorovrain wants to merge 4 commits intostablefrom
rain/2-rpq-all-paths

Conversation

@suvorovrain
Copy link

No description provided.

This commit adds an implementation of the regular path query algorithm based
on linear-algebra graph processing approach. The algorithm finds a set of nodes
in a edge-labelled directed graph. These nodes are reachable by paths starting
from one of source nodes and having edges labels conform a word from the
specified regular language.

This algorithm is based on the bread-first-search algorithm over the adjacency
matrices. Regular languages are defined by non-deterministic finite
automaton. The algorithm considers the paths on which "label words" are accepted
by the specified NFA.

The algorithm is used with the following inputs:
* A regular automaton adjacency matrix decomposition.
* A graph adjacency matrix decomposition.
* An array of the starting node indices.

It results with a vector, having v[i] = 1 iff the node is reachable by a
path satisfying the provided regular constraints.
This patch is used to make the regular path query algorithm work with
2-RPQs. 2-RPQs represent RPQs extended with possibility of traversing
graphs into the directions opposite to the presented edges.

E.g. SPARQL 2-RPQ `Alice ^<mother> <daughter> ?x` could be used to find
Alice and all of her sisters by getting all Alice mother's daughters.

2-RPQ support is provided by adding two extra parameters to the RPQ
algorithm. One of them is used to specify some of the provided labels as
inversed. The second one inverses the whole query allowing to execute
single-destination RPQs (e.g. `?x <Son> Bob` gets Bob's parents).
This patch provides a workaround for benchmarking 2-RPQ algorithm on
a few real-world datasets like Wikidata or yago-2s by allowing
duplicates in MatrixMarket files corresponding to boolean matrices
since most of the publicly available graphs likely to have duplicates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants