Query Planner
For query planning, the sender role is conducted by the key holder for the relevant resources. The receiver role is conducted by the clique(s) (cluster(s)) responsible for the hypergraph. Again, these algorithms are produced from the source literature:
Create SPARQL Query Graph:
- Given a query match pattern
Qp ∈ QR
. V ← ∅, E ← ∅
∀Qpi|1 ≤ i
- if
i == 1, V ← V ∪ (var ∈ Qpi.S ∪ var ∈ Qpi.O), E ← (var ∈ Qpi.S, var ∈ Qpi.O)
- if
i ≥ 2
, if(var ∈ Qpi.S == var ∈ Qpi+1.S) ∧ (var ∈ Qpi.O == var ∈ Qpi+1.S)
thenV ← V ∪ var ∈ Qpi.S, E ← (var ∈ Qpi, var ∈ Qpi+1)
elseV ← V ∪ var ∈ Qpi+1.O, E ← (var ∈ Qpi, var ∈ Qpi+1)
- else, if
(var ∈ Qpi.S == var ∈ Qpi+1.O) ∧ (var ∈ Qpi.O == var ∈ Qpi+1.O)
then if∃var ∈ Qpi+1.S ∈ V, V ← V ∪ var ∈ Qpi.S, E ← (var ∈ Qpi, var ∈ Qpi+1)
.MIN(size(hi))
thenI(G) = I(G) ∪ δ ↓ Pi, ∀j|i + 1 ≤ j ≤ n, if (hi(G) ⊑ hj(G)) ∧ (size(Pi) == size(Pj))
thenI(G) = I(G) ∪ Pi ↔ Pj
elseI(G) = I(G) ∪ Pi → Pj
. - if not
(var ∈ Qpi.S == var ∈ Qpi+1.O) ∧ (var ∈ Qpi.O == var ∈ Qpi+1.O)
, thenV ← V ∪ var ∈ Qpi+1.S, E ← (var ∈ Qpi, var ∈ Qpi+1)
. QG = (V, E)
Create Query Path:
- Given a set of predicates
P ∈ QG, QG and I(G)
. - Start from
δ
. Qpath ← δ → min(size(Pi)) ∈ I(G)
∀Qi|1 ≤ i ≤ n − 1, i + 1 ≤ j ≤ n
, if∃var ∈ Qpi ∈ QG == var ∈ Qpj ∈ QG
, thenQpath ← Qpath ∪ (Pi → Pj) ∈ I(G)
.