Presentation on theme: "XJ: an introduction Miguel Calejo Declarativa"— Presentation transcript:
1 XJ: an introduction Miguel Calejo Declarativa XJ: an introduction Miguel Calejo Declarativa
2 XJ (XSB+Java) historyXSB Inc. uses Prolog with large DBs for high-end data consolidation&cleaning, knowledge extraction, etc., to support e-Procurement and other processesFrom 1999 to 2002 Declarativa developed XJ, an InterProlog-based infrastructure for Java GUIs wrapping Prolog applicationsXJ 1.0 ( )XJ 2.0 ( ): more pragmatic, easier to customizeAdditional components (2003-today) by XSB, Inc.March 2006: open source releaseMost desktop tools referred in have a XJ GUI
3 XJ - declarative GUI construction Why the need for XJ?LOTS of different Prolog data to display and edit!Heterogeneous, “kind of” relational but non normalizedVisionGUI “deduced” from logic program + annotations, complemented with specific Java classesAutomatically supports data updating & visualization, operation invocation, error handling, undoRide on Swing (JFC) and InterPrologApplication development with XJProlog program is developed, ignoring GUI issuesGUI Term declarations addedAdditional Java classes may be added for specifics
4 XJ rationale Generic principles Specifics Prolog term structure conditions GUI structure and layoutProlog atomic data typically maps into simple GUI elements such as a Swing JTextFieldA Prolog free variable is assumed to be an empty or “null” valueSets of Prolog tuples may be displayed as more complex GUI elements, such as a Swing JTable or JTreeSpecificsEach term node can have a property listThe (InterProlog) TermModel class represents terms; its (XJ) subclass GUITerm represents annotated terms
5 XJ example: term annotations alloy_shape( 'STEEL'( alloy('852') ), 'MOLD CASTING’ ).labels(alloy_shape/2,'Alloy shape'('Alloy','Shape')).guiTerm(alloy_shape(_M,_S),gt(_,,[gt(_,[operation(XXX,sisa('OBJECT',XXX),'Show in Ontology'), biGuiLink(X1,sub(X1,_),isa(X1,'METAL')) ],[gt(alloy,[constant],[gt(_,[atomUPPER,minSize=3,maxSize=10,typicalSize=8,name='Name'],)])]),gt(_,[atomUPPER,typicalSize=15, biGuiLink(X2,sub(X2,_),isa(X2,'CASTING'))],)])).
6 XJ 1.0 example: derived GUI editList(alloy_shape(_,_)).Navigation to other windowsFor listInplace editing w/ basic type checkingDouble-clickFor term
7 XJ another exampleeditList(spec_attr(S,_,_), (name(S,Chars),append("AMS 40",_,Chars)), _).
8 XJ2.0: pushing the Swing envelope... Data can be (lazily) fetched from Prolog as needed
10 XJ concepts GUITerm class, GT terms Your own components: XJComponent Property listsBuilding Java visual hierarchiesContainersYour own components: XJComponentAbout lists and treesOperations and functions
11 An XJ example Showing and editing data about one tuple Showing and editing data about several tuples
12 Conclusion Integrated documentation missing ...but full source downloadable fromCurrently uses slight variation of InterProlog 2.1.2; hopefully this will get cleaned up soon