Defining relations on graphs: how hard is it in the presence of node partitions? M. Praveen and B. Srivathsan CMI 9 February 2015
Regular Path Queries on Graphs a b u v c a b u ′ v ′
Regular Path Queries on Graphs a b u v c a b u ′ v ′ ab Regular path query Q : x − − → y
Regular Path Queries on Graphs a b u v c a b u ′ v ′ ab Regular path query Q : x − − → y Q ( G ) = {� u , v � , � u ′ , v ′ �}
RPQ-definability a b u v c a b u ′ v ′ ◮ ◮ {� u , v �}
RPQ-definability a b u v c a b u ′ v ′ ◮ ◮ {� u , v �} ◮ Is there a RPQ Q such that Q ( G ) = {� u , v �} ?
RPQ-definability a b u v c a b u ′ v ′ ◮ ◮ {� u , v �} ◮ Is there a RPQ Q such that Q ( G ) = {� u , v �} ? ◮ [Antonopoulos, Neven, Servais 2013] RPQ-definability is Pspace -complete.
Node partitions 1 2 1 a b u v c a b u ′ v ′ 2 1 2
Node partitions 1 2 1 a b u v c a b u ′ v ′ 2 1 2 ↓ r 1 . ab [ r = 1 ] Regular data path query Q : x − − − − − − − → y
Node partitions 1 2 1 a b u v c a b u ′ v ′ 2 1 2 ↓ r 1 . ab [ r = 1 ] Regular data path query Q : x − − − − − − − → y Q ( G ) = {� u , v �}
Node partitions 1 2 1 a b u v c a b u ′ v ′ 2 1 2 ↓ r 1 . ab [ r = 1 ] Regular data path query Q : x − − − − − − − → y Q ( G ) = {� u , v �} e ::= ε | a | e + e | e + | ↓ r . e | e [ c ] c ::= r = | r � = | c ∧ c | c ∨ c | ¬ c
RDPQ-definability 1 2 1 a b u v c a b u ′ v ′ 2 1 2 ◮ ◮ {� u , v �}
RDPQ-definability 1 2 1 a b u v c a b u ′ v ′ 2 1 2 ◮ ◮ {� u , v �} ◮ Is there a RDPQ Q such that Q ( G ) = {� u , v �} ? ◮ We study the complexity of RDPQ-definability.
Motivation - schema mappings Stuttgart Chennai Bordeaux Chennai Bordeaux friend colleague friend colleague
Motivation - schema mappings Stuttgart Chennai Bordeaux Chennai Bordeaux friend colleague friend colleague
Motivation - schema mappings Stuttgart Chennai Bordeaux Chennai Bordeaux friend colleague friend colleague ↓ r 1 . ( friend + collegue ) ∗ [ r = 1 ]
Related work G.H.L. Fletcher, M. Gyssens, J. Paredaens, and D. V. Gucht. On the expressive power of the relational algebra on finite sets of relation pairs. IEEE Trans. Knowledge and Data Engg. , 21(6):939–942, 2009. G. Gottlob and P. Senellart. Schema mapping discovery from data instances. J. ACM , 57(2):6:1–6:37, 2010. A. Das Sarma, A. Parameswaran, H. Garcia-Molina, and J. Widom. Synthesizing view definitions from data. In Proceedings , ICDT, pages 89–103, 2010. B. Alexe, B. T. Cate, P. G. Kolaitis, and W. Tan. Designing and refining schema mappings via data examples. In SIGMOD , pages 133–144, 2011.
Related work . . . D. Calvanese, G. De Giacomo, M. Lenzerini, and M. Y. Vardi. Simplifying schema mappings. In ICDT , pages 114–125, 2011. P. Barcel´ o, J. P´ erez, and J. Reutter. Schema mappings and data exchange for graph databases. In ICDT , pages 189–200, 2013.
Regular Expressions with Equality 1 1 0 0 a a a u 1 v 1 3 0 0 1 a a a u 2 v 2 1 1 2 3 a a a u 3 v 3 Q = ( a · ( a ) = · a ) =
Regular Expressions with Equality 1 1 0 0 a a a u 1 v 1 3 0 0 1 a a a u 2 v 2 1 1 2 3 a a a u 3 v 3 Q = ( a · ( a ) = · a ) = Q ( G ) = {� u 1 , v 1 �}
Regular Expressions with Equality 1 1 0 0 a a a u 1 v 1 3 0 0 1 a a a u 2 v 2 1 1 2 3 a a a u 3 v 3 Q = ( a · ( a ) = · a ) = Q ( G ) = {� u 1 , v 1 �} e ::= ε | a | e + e | e + | e = | e � =
Number of registers 2 3 2 3 a a a u 1 v 1 0 2 1 0 a a a u 2 v 2 1 2 2 3 a a a u 3 v 3
Number of registers 2 3 2 3 a a a u 1 v 1 0 2 1 0 a a a u 2 v 2 1 2 2 3 a a a u 3 v 3 Q = ↓ r 1 · a · ↓ r 2 · a [ r = 1 ] · a [ r = 2 ]
Number of registers 2 3 2 3 a a a u 1 v 1 0 2 1 0 a a a u 2 v 2 1 2 2 3 a a a u 3 v 3 Q = ↓ r 1 · a · ↓ r 2 · a [ r = 1 ] · a [ r = 2 ] Q ( G ) = {� u 1 , v 1 �}
Results ◮ RDPQ mem -definability is Expspace -complete. ◮ k − RDPQ mem -definability is in NSpace ( O ( n 2 δ k )). ◮ RDPQ = -definability is Pspace -complete. ◮ UCRDPQ-definability is coNP -complete.
Witnesses for RPQ-definability a a u v c a b u ′ v ′
Witnesses for RDPQ-definability 1 2 1 a a u v c a a u ′ v ′ 1 2 2
Witnesses for RDPQ-definability u v c u ′ u ′ v ′ v ′
Witnesses for RDPQ-definability � � u v c u ′ u ′ v ′ v ′
Witnesses for RDPQ-definability � � � � � � u v c u ′ u ′ v ′ v ′ � � � � � �
Witnesses for RDPQ-definability � � � ↓ r � � � u v c u ′ u ′ v ′ v ′ � � � � � �
Witnesses for RDPQ-definability � � � [ r = ] ↓ r � � � u v c u ′ u ′ v ′ v ′ � � � � � �
Witnesses for RDPQ-definability � � � [ r = ] ↓ r � � � u v c u ′ u ′ v ′ v ′ � ↓ r � � � � �
Witnesses for RDPQ-definability � � � [ r = ] ↓ r � � � u v c u ′ u ′ v ′ v ′ [ r = ] � ↓ r � � � � �
Expspace Lower Bound t f . . . t 3 t i t 2 2 n
Expspace Lower Bound t f p 1 q 1 illegal tilings . . . p 2 q 2 all tilings t 3 t i t 2 2 n
Expspace Lower Bound t f p 1 q 1 illegal tilings . . . p 2 q 2 all tilings t 3 t i t 2 2 n There exists a legal tiling iff {� p 2 , q 2 �} is definable.
Expspace Lower Bound t f . . . t 3 t i t 2 2 n
Expspace Lower Bound t f t i t 2 . . . . . . t 3 t i t 2 2 n
Expspace Lower Bound t f t i t 2 . . . . . . t 3 t 3 t i t 2 . . . 2 n
Expspace Lower Bound t f ↓ r n · · · ↓ r 2 ↓ r 2 t i t 2 . . . . . . t 3 t 3 t i t 2 . . . 2 n
Expspace Lower Bound t f ↓ r n · · · ↓ r 2 ↓ r 2 t i r = r = r � = · · · t 2 . n 2 1 . . . . . t 3 r = r = r = · · · t 3 2 1 n t i t 2 . . . 2 n
Conclusion ◮ RDPQ mem -definability is Expspace -complete. ◮ k − RDPQ mem -definability is in NSpace ( O ( n 2 δ k )). ◮ RDPQ = -definability is Pspace -complete. ◮ UCRDPQ-definability is coNP -complete.
Conclusion ◮ RDPQ mem -definability is Expspace -complete. ◮ k − RDPQ mem -definability is in NSpace ( O ( n 2 δ k )). ◮ RDPQ = -definability is Pspace -complete. ◮ UCRDPQ-definability is coNP -complete. Thank you. Questions?
Recommend
More recommend