RDF Storage
The construction is described in the paper "Hypergraph Based Query Optimization", which we will use by translating the logic to OT circuits, starting with decryption into the circuit using the extended decryption process of the address content. We adopt their term definitions in this section, Query Planner, and Query Evaluator. their definitions provided here roughly verbatim for convenience:
Notation:
- RDF Graph –
G = (V, E)whereV = {v|v ∈ S ∪ O}andE = {e1, e2, ...}∃e = {u, v}whereu, v ∈ V. - Edge Labeling Function –
le(S, O) = P. - Node Labeling Function –
lv(vt) = twheret ∈ (S ∪ O)andS = Subject(URI ∪ BLANKS),P = Predicate(URI),O = Object(URI ∪ BLANKS ∪ LIT). - Hypergraph –
H(G) = (V, E)where nodeV = {v1, ..., vn}andE = {e1, ..., en}whereV = {v|v ∈ S ∪ O ∪ P}and each edgeEis a non-empty set ofV . ∀P, ∃e|(Si, Oi) ∈ H(G)where1 ≤ i ≤ n. - Overlapping Hyperedge –
(hi(G) ⊑ hi+1(G))whereh1(G) = (S1, P1, O1)andh2(G) = (S2, P2, O2), (h1(G) ⊑ h2(G)) iff ∀s1 ∈ S1 ∈ h1(G)∃s2 ∈ S2 ∈ h2(G)∨∀o1 ∈ O1 ∈ h1(G)∃o2 ∈ O2 ∈ h2(G)∨∀p1 ∈ P1 ∈ h1(G)∃p2 ∈ P2 ∈ h2(G). - Predicate-Based Index –
I(G) = (V, E)whereV = {v|v ∈ Pi ∈ hi ∧ δ}andE = (vi, vj)wherevi, vj ∈ Vand1 ≤ i ≤ n − 1, 1 ≤ j ≤ nforδ ∈ V ∃e = (δ, v).δis the root of the index. - SPARQL Query –
QRcontains<Qq, Qs, Qp >whereQqis the query form andQpis the match pattern if?x ∈ var(Qq)then?x ∈ var(Qp)andQscontains constraints likeFILTER,OPTIONAL. - Query Graph –
QG = (V, E), V ← {var ∈ Qpi}andE ← {P ∈ Qpi ∧ (var ∈ Qpi, var ∈ Qpi+1)}where1 ≤ i ≤ n,nis the number of predicates,Pis the predicate. - Query Path –
Qpath∃Qpath, δ → Pi ∈ I(G)|Pi.size = minsize ∧ (Pi → Pi+1) ∈ I(G) if ∃var ∈ Qpi == var ∈ Qpi+1. - Data Insertion – Given
QRandQpthen check∃Pi ∈ Qp ∈ I(G), if true then checkPi ∈ H(G) ∨ create hi ∈ Pi ∧ update H(G)withhi. Check if∃var ∈ Qp ∈ H(G), if true then overlaphiwithvar’sh ∨ update hiwithvar ∈ Qp. - Data Deletion – Given
QRandQpthen check∃Pi ∈ Qp ∈ I(G) ∧ Pi ∈ var, if true then check|hi| == 0, if true then removevar ∈ Qp ∈ H(G) ∨copy ofPiexists.
Given these definitions, their paper proposes algorithms to perform the whole of the queries for this database:
Create Hypergraph:
- Given an RDF graph
Gas triple(S, O, P). V ← ∅, E ← ∅, ei ← ∅∀(S, O, P) ∈ G, V ← V ∪ V ∈ (S ∪ O ∪ P).∀Pi|1 ≤ i ≤ n, 1 ≤ j ≤ n, ei ← {Pi, {Sj , Oj}}, E ← ei.H(G) = (V, E).
Create Predicate-Based Index:
- Given a hypergraph
H(G). - Sort hyperedges by size.
∀hi|1 ≤ i ≤ n − 1, ifMIN(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 ↔ PjelseI(G) = I(G) ∪ Pi → Pj.