160 likes | 171 Views
This document discusses the extension of formal languages for component-based development and thinking, specifically focusing on the Language (Xcerpt) and the Reuse Language (Reuse.Xcerpt).
E N D
I3: Composition And Typing Annual Meeting Reuseware Composition Framework U. Aßmann, J. Henriksson, J. Johannes, S. Zschaler Munich, February 27, 2007
Introduction • Motivation • Extend formal languages to enable component-based development and thinking Language (Xcerpt) Reuse Language (Reuse Xcerpt) written in written in Program Compose with Reuseware executed with • Define components • Describe how to compose them • Define special-purpose composition operators Existing tools (Xcerpt engine)
Motivational example • Xcerpt modules • No module system exists for Xcerpt • Globally reusable rules/functions (XQuery, LP) • Module system requirements • Make rules available where appropriate • Code protection • Compose instead of extending Xcerpt engine itself Called module import export Calling module
Motivational example • Xcerpt modules • Ontology reasoner Sports Equipment owl:Class file:sports.owl <?xml version="1.0" ?> <owl> <Class id="SportsEquipment" /> <Class id="TennisRacket"> <subClassOf about="SportsEquipment" /> </Class> <Class id="WilsonTennisRacket"> <subClassOf about="TennisRacket" /> </Class> </owl> rdfs:subClassOf Tennis Racket owl:Class rdfs:subClassOf Wilson Tennis Racket owl:Class
Motivational example CONSTRUCT rdfsengine [ output [ inferredSubClassOf [ all subClassOf [ var Sub, var Super ] ] ] ] FROM or { declsubclassof [ var Sub, var Super ], and { declsubclassof [ var Sub, var Z ], declsubclassof [ var Z, var Super ] } } END • Xcerpt modules • Ontology reasoner 2 rdfsengine [ output [ inferredSubClassOf [ subClassOf [ "TennisRacket", "SportsEquipment" ], subClassOf [ "WilsonTennisRacket", "TennisRacket" ], subClassOf [ "WilsonTennisRacket", "SportsEquipment" ] ] ] ] 1 + 2 CONSTRUCT declsubclassof [ var Sub, var Super ] FROM in { resource { "file:sports.owl", "xml" }, owl {{ Class { attributes { id { var Sub } }, subClassOf { attributes { about { var Super } } } } }} } END CONSTRUCT declsubclassof [ var Sub, var Super ] FROM in { resource { "file:sports.owl", "xml" }, owl {{ Class { attributes { id { var Sub } }, subClassOf { attributes { about { var Super } } } } }} } END 1 1 declsubclassof [ "TennisRacket", "SportsEquipment" ] declsubclassof [ "WilsonTennisRacket", "TennisRacket" ]
Motivational example private module mSubClassOf{ } • Xcerpt modules • Ontology reasoner CONSTRUCT rdfsengine [ output [ inferredSubClassOf [ all subClassOf [ var Sub, var Super ] ] ] ] FROM or { declsubclassof [ var Sub, var Super ], and { declsubclassof [ var Sub, var Z ], declsubclassof [ var Z, var Super ] } } END 2 CONSTRUCT declsubclassof [ var Sub, var Super ] FROM in { resource { "file:sports.owl", "xml" }, owl {{ Class { attributes { id { var Sub } }, subClassOf { attributes { about { var Super } } } } }} } END 1
Motivational example private module mSubClassOf{ } • Xcerpt modules • Module definition • VISIBILITY is public or private • MODULE NAME is an identifier string CONSTRUCT public rdfsengine [ output [ inferredSubClassOf [ all subClassOf [ var Sub, var Super ] ] ] ] FROM or { declsubclassof [ var Sub, var Super ], and { declsubclassof [ var Sub, var Z ], declsubclassof [ var Z, var Super ] } } END 2 DEFAULT VISIBILITY module MODULE NAME{ } CONSTRUCT VISIBILITY HEAD FROM VISIBILITY BODY END ... CONSTRUCT declsubclassof [ var Sub, var Super ] FROM public in { resource { "file:sports.owl", "xml" }, owl {{ Class { attributes { id { var Sub } }, subClassOf { attributes { about { var Super } } } } }} } END 1
Motivational example file:/subclassof.mxcerpt private module mSubClassOf{ } • Xcerpt modules CONSTRUCT public rdfsengine [ output [ inferredSubClassOf [ all subClassOf [ var Sub, var Super ] ] ] ] FROM or { declsubclassof [ var Sub, var Super ], and { declsubclassof [ var Sub, var Z ], declsubclassof [ var Z, var Super ] } } END 2 Composition program qualify /subclassof.mxcerpt as rdfsengine; use rdfsengine; GOAL hassubclass [ allvar Super ] FROM in { module { rdfsengine }, rdfsengine [ output [ inferredSubClassOf {{ subClassOf [ var Sub, var Super ] }} ] ] } END CONSTRUCT declsubclassof [ var Sub, var Super ] FROM public in { resource { "file:sports.owl", "xml" }, owl {{ Class { attributes { id { var Sub } }, subClassOf { attributes { about { var Super } } } } }} } END 1
Motivational example file:/subclassof.mxcerpt privatemodule mSubClassOf{ } • Xcerpt modules CONSTRUCT public rdfsengine [ output [ inferredSubClassOf [ all subClassOf [ var Sub, var Super ] ] ] ] FROM or { declsubclassof [ var Sub, var Super ], and { declsubclassof [ var Sub, var Z ], declsubclassof [ var Z, var Super ] } } END 2 Composition program qualify /subclassof.mxcerpt as rdfsengine; use rdfsengine; GOAL hassubclass [ allvar Super ] FROM in { module { rdfsengine }, rdfsengine [ output [ inferredSubClassOf {{ subClassOf [ var Sub, var Super ] }} ] ] } END Controlling execution of composition operators CONSTRUCT declsubclassof [ var Sub, var Super ] FROM public in { resource { "file:sports.owl", "xml" }, owl {{ Class { attributes { id { var Sub } }, subClassOf { attributes { about { var Super } } } } }} } END 1
Motivational example file:/subclassof.mxcerpt private module mSubClassOf { } • Xcerpt modules CONSTRUCT public rdfsengine [ output [ inferredSubClassOf [ all subClassOf [ var Sub, var Super ] ] ] ] FROM or { declsubclassof [ var Sub, var Super ], and { declsubclassof [ var Sub, var Z ], declsubclassof [ var Z, var Super ] } } END Special-purpose composition operators for the Xcerpt module system Composition program qualify /subclassof.mxcerpt as rdfsengine; use rdfsengine; GOAL hassubclass [ allvar Super ] FROM in { module { rdfsengine }, rdfsengine [ output [ inferredSubClassOf {{ subClassOf [ var Sub, var Super ] }} ] ] } END load componentF0,…,Fn transformF0,…,Fn return result; CONSTRUCT declsubclassof [ var Sub, var Super ] FROM public in { resource { "file:sports.owl", "xml" }, owl {{ Class { attributes { id { var Sub } }, subClassOf { attributes { about { var Super } } } } }} } END Composer encapsulated components F0 F1 Fn … Composition operator definition
Motivational example • Xcerpt modules: Encapsulation • Avoid unintended rule dependencies using module stores • Solved using existing capabilities of Xcerpt • Stores have two properties: MODULE ID, VISIBILITY • MODULE ID is a string identifier, VISIBILITY: public or private • Query terms referring external resource are left untouched CONSTRUCT store [ modul [ MODULE ID ], visibility [ VISIBILITY ], HEAD ] FROM store [ modul [ MODULE ID ], visibility [ VISIBILITY ], BODY ] END CONSTRUCT HEAD FROM BODY END
Motivational example Ontology reasoner module • Xcerpt modules • Composition result CONSTRUCT store [ modul [ "/subclassof.mxcerpt" ], visibility [ “public” ], rdfsengine [ output [ inferredSubClassOf [ all subClassOf [ var Sub, var Super ] ] ] ] ] FROM store [ modul [ "/subclassof.mxcerpt" ], visibility [ ”private” ], or { declsubclassof [ var Sub, var Super ], and { declsubclassof [ var Sub, var Z ], declsubclassof [ var Z, var Super ] } } ] END 2 Composition program GOAL hassubclass [ allvar Super ] FROM store [ modul [ "/subclassof.mxcerpt" ], visibility [ "public" ], rdfsengine [ output [ inferredSubClassOf {{ subClassOf [ var Sub, var Super ] }} ] ] ] END CONSTRUCT store [ modul [ "/subclassof.mxcerpt" ], visibility [ "private" ], declsubclassof [ var Sub, var Super ] ] FROM in { resource { "file:sports.owl", "xml" }, owl {{ Class { attributes { id { var Sub } }, subClassOf { attributes { about { var Super } } } } }} } END 1
Possibilities • Xcerpt modules • One instantiation of the Reuseware Framework • One language (Xcerpt); One technique (module system) • Component-based development of queries • Aspects? • Component-based ontology engineering • Support exists for Notation3 (N3) • Starting student work • Integration of Reuseware in Protégé • What are your needs?
Outlook • Tooling perspective for final year • Seamlessly integrated tools on top Reuseware Main focus “OWL-ware” “Xcerpt-ware” Query languages Ontology languages XML I1? Xcerpt, XQuery OWL, N3 ODF, SVG URML Eclipse Prototypes Protégé Reasoners Tools? Strelka Reuseware Composition Framework
Ongoing Work • Enriching composition interfaces • Constraining how components can be put together • Augment interfaces with “semantical constraints” • Not only syntactical composition • Integrating Composition and Typing of I3 • Applicable to Xcerpt • How can types constrain which components fit to each other?
The end • Thank you!