tree editing with zippers

12
Tree Editing with Zippers Alex Miller Revelytix aka @puredanger aka “Dr. Strange Loop”

Upload: alex-miller

Post on 20-May-2015

2.845 views

Category:

Technology


1 download

DESCRIPTION

A quick talk on how to use Clojure zippers over trees made from records and build a tree pattern matching / mutation facility over that.

TRANSCRIPT

Page 1: Tree Editing with Zippers

Tree Editing with Zippers

Alex MillerRevelytix

aka @puredangeraka “Dr. Strange Loop”

Page 2: Tree Editing with Zippers

Zipper node protocol

Page 3: Tree Editing with Zippers

Some records

Page 4: Tree Editing with Zippers

Two “child” variants

seq of records

fields holding records

Page 5: Tree Editing with Zippers

Use the record zipperComparison

:op := :left :right

ScalarFunction

:f :+ :exprs

ScalarFunction

:f :- :exprs

2 3 6 1

“(2 + 3) = (6 - 1)”

Page 6: Tree Editing with Zippers

Use the record zipperComparison

:op := :left :right

ScalarFunction

:f :+ :exprs

ScalarFunction

:f :- :exprs

2 3 6 1

“(2 + 3) = (6 - 1)”

Page 7: Tree Editing with Zippers

Use the record zipperComparison

:op := :left :right

ScalarFunction

:f :+ :exprs

ScalarFunction

:f :- :exprs

2 3 6 1

“(2 + 3) = (6 - 1)”

Page 8: Tree Editing with Zippers

Use the record zipperComparison

:op := :left :right

ScalarFunction

:f :+ :exprs

ScalarFunction

:f :- :exprs

2 3 6 1

“(2 + 3) = (6 - 1)”

Page 9: Tree Editing with Zippers

Tree pattern mutator

Page 10: Tree Editing with Zippers

Apply evaluation ruleComparison

:op := :left :right

ScalarFunction

:f :- :exprs

5

6 1

Comparison

:op := :left :right

5 5

Page 11: Tree Editing with Zippers

Revelytix

• Data integration using semantic web

• SPARQL -> SQL translation

• SPARQL federation

• Business rules engine

• Emergent analytics

Page 12: Tree Editing with Zippers

SPARQL to SQL Parse, translate to SPARQL algebra

Plan using mappingOptimize plan

Generate SQL

SELECT ?Person ?NameWHERE { ?Person <http://domain/Person/Name> ?name }

SPARQL algebra tree

SQL query plan

SELECT 'http://domain/Person/' || ID, NameFROM People

SQL query plan

tree rules