Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Tree Editing with Zippers

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

  • Login to see the comments

  • Be the first to like this

Tree Editing with Zippers

  1. 1. Tree Editing with Zippers Alex Miller Revelytix aka @puredanger aka “Dr. Strange Loop”
  2. 2. Zipper node protocol
  3. 3. Some records
  4. 4. Two “child” variants seq of records fields holding records
  5. 5. Use the record zipper Comparison :op := :left :right ScalarFunction :f :+ :exprs ScalarFunction :f :- :exprs 2 3 6 1 “(2 + 3) = (6 - 1)”
  6. 6. Use the record zipper Comparison :op := :left :right ScalarFunction :f :+ :exprs ScalarFunction :f :- :exprs 2 3 6 1 “(2 + 3) = (6 - 1)”
  7. 7. Use the record zipper Comparison :op := :left :right ScalarFunction :f :+ :exprs ScalarFunction :f :- :exprs 2 3 6 1 “(2 + 3) = (6 - 1)”
  8. 8. Use the record zipper Comparison :op := :left :right ScalarFunction :f :+ :exprs ScalarFunction :f :- :exprs 2 3 6 1 “(2 + 3) = (6 - 1)”
  9. 9. Tree pattern mutator
  10. 10. Apply evaluation rule Comparison :op := :left :right ScalarFunction :f :- :exprs 5 6 1 Comparison :op := :left :right 5 5
  11. 11. Revelytix • Data integration using semantic web • SPARQL -> SQL translation • SPARQL federation • Business rules engine • Emergent analytics
  12. 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

×