Tree Editing with
Zippers
Alex Miller
Revelytix
aka @puredanger
aka ā€œDr. Strange Loopā€
Zipper node protocol
Some records
Two ā€œchildā€ variants
seq of records
fields holding records
Use the record zipper
Comparison
:op := :left :right
ScalarFunction
:f :+ :exprs
ScalarFunction
:f :- :exprs
2 3 6 1
ā€œ(2 + 3) = (6 - 1)ā€
Use the record zipper
Comparison
:op := :left :right
ScalarFunction
:f :+ :exprs
ScalarFunction
:f :- :exprs
2 3 6 1
ā€œ(2 + 3) = (6 - 1)ā€
Use the record zipper
Comparison
:op := :left :right
ScalarFunction
:f :+ :exprs
ScalarFunction
:f :- :exprs
2 3 6 1
ā€œ(2 + 3) = (6 - 1)ā€
Use the record zipper
Comparison
:op := :left :right
ScalarFunction
:f :+ :exprs
ScalarFunction
:f :- :exprs
2 3 6 1
ā€œ(2 + 3) = (6 - 1)ā€
Tree pattern mutator
Apply evaluation rule
Comparison
:op := :left :right
ScalarFunction
:f :- :exprs
5
6 1
Comparison
:op := :left :right
5 5
Revelytix
• Data integration using semantic web
• SPARQL -> SQL translation
• SPARQL federation
• Business rules engine
• Emergent analytics
SPARQL to SQL
Parse, translate to
SPARQL algebra
Plan using
mapping
Optimize plan
Generate SQL
SELECT ?Person ?Name
WHERE {
?Person <http://domain/Person/Name> ?name
}
SPARQL algebra tree
SQL query plan
SELECT 'http://domain/Person/' || ID, Name
FROM People
SQL query plan
tree rules

Tree Editing with Zippers

  • 1.
    Tree Editing with Zippers AlexMiller Revelytix aka @puredanger aka ā€œDr. Strange Loopā€
  • 2.
  • 3.
  • 4.
    Two ā€œchildā€ variants seqof records fields holding records
  • 5.
    Use the recordzipper Comparison :op := :left :right ScalarFunction :f :+ :exprs ScalarFunction :f :- :exprs 2 3 6 1 ā€œ(2 + 3) = (6 - 1)ā€
  • 6.
    Use the recordzipper Comparison :op := :left :right ScalarFunction :f :+ :exprs ScalarFunction :f :- :exprs 2 3 6 1 ā€œ(2 + 3) = (6 - 1)ā€
  • 7.
    Use the recordzipper Comparison :op := :left :right ScalarFunction :f :+ :exprs ScalarFunction :f :- :exprs 2 3 6 1 ā€œ(2 + 3) = (6 - 1)ā€
  • 8.
    Use the recordzipper Comparison :op := :left :right ScalarFunction :f :+ :exprs ScalarFunction :f :- :exprs 2 3 6 1 ā€œ(2 + 3) = (6 - 1)ā€
  • 9.
  • 10.
    Apply evaluation rule Comparison :op:= :left :right ScalarFunction :f :- :exprs 5 6 1 Comparison :op := :left :right 5 5
  • 11.
    Revelytix • Data integrationusing semantic web • SPARQL -> SQL translation • SPARQL federation • Business rules engine • Emergent analytics
  • 12.
    SPARQL to SQL Parse,translate to SPARQL algebra Plan using mapping Optimize plan Generate SQL SELECT ?Person ?Name WHERE { ?Person <http://domain/Person/Name> ?name } SPARQL algebra tree SQL query plan SELECT 'http://domain/Person/' || ID, Name FROM People SQL query plan tree rules