My notes about computer science, programming, and
software
© 2003, 2007 Jean-Marc Vanel
e-mail: Send your comments - My home page
This is my blog. Sometimes I say things in French there, and sometimes in
english here.
Parfois je dis les choses en Français,
et parfois ici en Anglais.
Found this: Solutions to some exercises in "The Art of Prolog"
On the same site there other Prolog goodies, and unexpectedly, nice pictures of Flowers in the Maritime Alps .
After some time studying Prolog alone, I come back to Ontologies, RDF and OWL, following the SWI-Prolog track. SWI has comprehensive Semantic Web facilities.
I try to sum up the key ideas that will, IMHO, shape the sowtware development in the next 20 years.
examples: form generation, intelligent display of information ( e.g. intelligent unfolding of a tree view )
JAVA PROGRAM REPRESENTATION AND MANIPULATION IN PROLOG
They use a clause representation for the upper structures, and lists and trees for the executable parts.
Suppose I want a bi-directional correspondance between two domains. To be more specific, think of translation between Java and C++ language.
I first thought of declaring this, but I don't like the repetition of the same pattern on both sides of :-
correspondance_java_cpp( class( X, java ), class( X, cpp ) ) :- class( X, java ); class( X, cpp ).
Of course in a real application the predicate class will have more arguments, or be completed by other predicates like field, method, etc.
cehteh suggests:
correspondance( class, X, [java, cpp] ) :- ...
I don't like that too much.
But I want to try another design. Let's declare,without variables, that there is a correspondance :
% declarative reading: a class in Java corresponds % to a class in C++, and vice-versa correspondance( class, java, class, cpp ).
Then at the class instances level:
instance_correspondance( I1, I2, Domain1, Domain2 ) :- instance_of( I1, C1 ), instance_of( I2, C2 ), correspondance( C1, Domain1, C2, Domain2 ).
In fact instance_of is just another property on objects, in the spirit of RDF.
property_correspondance( I1, P1, I2, P2, Domain1, Domain2 ) :- has_property( I1, P1, V1 ), has_property( I2, P2, V2 ), property_correspondance( C1, P1, Domain1, C2, P2, Domain2 ).
Then I'd like to say that by default there is a verbatim correspondance between instances for class and property, unless otherwise stated.
correspondance( class, java, template, cpp ).
correspondance( C, java, C, cpp ). ????? à voir ????? property_correspondance( class, boolean, java, class, bool, cpp ). property_correspondance( C, P, java, C, P, cpp ).
The english that is to be "translated" in Prolog rule is the following:
????????????
TODO
Is there a standard way to reuse (or translate) a BNF as a DCG ?
I downloaded the zip from:
http://www.agfa.com/w3c/euler/ ( look for "latest version" )
First I made a smal script to launch the local (non-web) application:
% cat run_euler52.sh
java -classpath bin/Euler.jar:bin/Euler_Tests.jar:lib/tuprolog.jar euler.EulerRunner $*
Some explainations are on README and on Google pages:
http://josderoo.googlepages.com/euler52
Download:
http://wiki.axiom-developer.org/AxiomBinaries
Extensive documentation:
http://wiki.axiom-developer.org/uploads/contents.xhtml
Try the following expressions in Axiom :
simplify 2*x + 5*x draw ( 2*x + 5*x + x*x , x=0..30 ) solve ( 2*x + 5*x + x*x = 0 ) factor 2*x + 5*x + x*x expand % factor 2*x + 5*x**4 integrate ( 2*x + 5*x**4, x ) D %
Interesting article about using rules for configuring Internet access from a home network:
http://www.ninebynine.org/SWAD-E/Scenario-HomeNetwork/HomeNetworkConfig-20021215.html
I updated ai/path_big.pl so that it compiles and executes in XSB.
The SWI version with random/2 is still here: ai/path_big_swi.pl
Now I can run and compare CPU on a simple uninformed path finding algorithm satisfying these rules:
I want to check that tabled Prolog (i.e. XSB) is really quicker than SWI Prolog.
Swoop is now on Google code : http://code.google.com/p/swoop/source : only 3 new source files in 2007 .
The new branch of Protégé 4.0 with the new OWL API goes on, it has more plugins :
http://protege.stanford.edu/download/release_notes/release_notes_alpha.html
The 3.X branch also goes on, with enhancements of the SWRL features. They justly leverage on the idea that a query is just a kind of rule. See:
http://protege.cim3.net/cgi-bin/wiki.pl?SQWRL
Note that the SWRL syntax is very Prolog-like (but with the consequence at the end):
Person(?p) ^ hasAge(?p, ?age) ^ swrlb:greaterThan(?age, 17) -> Adult(?p)
Here is the same rule, but turned into a query returning a list of pairs :
Person(?p) ^ hasAge(?p, ?a) ^ swrlb:lessThan(?a, 17) -> sqwrl:select(?p, ?a)
Note that besides SWRL, Prolog and JBoss rules, there is still another syntax for rules, CWM from the W3C guys, see:
http://www.w3.org/2000/10/swap/doc/Rules
This is how that same rule looks in CWM:
{ ?p a Person . ?p hasAge ?age .
?age math:greaterThan 17 } -> ?p a Adult
CWM is used in Jos de Roo's Euler framework, were in gets translated in Prolog as an implementation low-level (!) language. He also has rules for the OWL semantic.
In AIMA (in historical notes of chapter Knowledge Representation) I read about openmind.org . The concept if very valuable; I could be a kind of Wikipedia for structured knowledge, if it's still active ...
It's not clear how the different projects are technically connected. It's too bad that a project aiming at sharing knowledge is so unclear in its Web pages!
Learner :
http://web.media.mit.edu/~timc/learner/
according to my Web browser the last update is august 2002.
The Animals guessing game is a good idea, but the server is down.
http://www.openmind.org/Animals.html
The Web query and input server is quite impressive, even though the knowledge is sketchy:
http://commons.media.mit.edu:3000/
try for instance the word "sepal".
There is at least one way to download the KB:
http://globalmind.media.mit.edu/forresearcher.php?lan=eng
but I'm not sure whether it's the same as the one continuously updated on the before-mentioned server.
http://kaminari.istc.kobe-u.ac.jp/PrologCafe/ feb. 2004
http://gnuprologjava.sourceforge.net/ nov. 2000
http://www.cs.kuleuven.ac.be/~bmd/PrologInJava/ 2004
I published some time ago "Notes on AI based software design" on google docs.
Many thanks to cehteh on #prolog on IRCNet.
From the Mercury site:
after stripping away the declarations of a Mercury program, the syntax of the remaining part of the program is mostly compatible with Prolog syntax.
Using metadata on classes and properties (OWL or UML like), it is possible to infer an input form. For example, if a property has cardinality exactly one, the form will behave so as to refuse validation until a value has been entered. If the property is composite (in UML sense), an embedded form for a corresponding object should be created; in the contrary, a pull-down or other search widget will allow to enter an existing object.
I updated ai/path_big.pl so that it compiles in XSB. but it doesn't execute yet; atom_concat/3 doesn't tolerate numbers with XSB, it needs real atoms.
The SWI version with random/2 is here: ai/path_big_swi.pl
à suivre ...
To process and concat a number into an atom, I must in XSB use character arrays. Also I discovered that there is a random/3 function in XSB, incompatible with random/1 in SWI.
I have to find how to do the equivalent of #ifdef SWI
in Prolog
. Maybe there exists a predicate to obtain the name of the Prolog engine. I try
channel #prolog on IRCNet ... Nobody . Nothing on Prolog: The ISO
Standard Documents .
consult('path_big.pl').
consult('arc_rules.pl').
start_list_of_nodes( 100, 200, _ListOfNodes, _Links ). start_list_of_nodes( 2, 3, _ListOfNodes, _Links ).
arc( A, N1, N2 ).
arcs( node1, node2 ).
I have just written a small program in Prolog which creates a random graph; I will be able to make interesting performance measurements on route finding problems .
I wanted to compare XSB and SWI-Prolog, but it doesn't run on XSB, because it lacks the random(+IntExpr) function. Onde could argue that a random generator has nothing to do in logic programming ...
Hopefully I can call a Java function; or I can just populate on SWI-Prolog, save the terms in a file, and read them on XSB. Or simply use a formula with multiplication by a big integer and modulo . I'll do that !
BTW the mailing lists of XSB on sourceforge are polluted by spam.
Marco indicated me the google GWT framework Web . The heavy client is back, and his key language Javascript, as the GWT examples show. After having looked at the showcase I said myself: one more example of a collection of widgets, along with Java, Qt, GTK, WxWidgets, JSP, etc. My thought process would be to abstract these concepts in an ontology, plus rules which would make it possible to apply the suitable widgets to a concrete object (or to a class).
I had a segmentation fault when running ./run-cyc.sh ; I had to remove
../server/cyc/run/world/kb-5006-RH-ES3-x86_32-local.load
to force a rebuild.
To run opencyc on Fedora Core 7, I had to create a file
scripts/platform-override.txt
with the content RH-ES3-x86_32 .
Login as CycAdministrator or HPKB-User.
In Browser Tools, the most interesting page is "The Hierarchy Browser". Note that Browser Tools is not one of the top 6 icons:
Assert
Compose
Create
Doc
History
Query.
The hyperlink for Browser Tools on the top right.
The microtheories are supposed to modularize the Knowledge Base, but UniversalVocabularyMt is ubiquitous.
I had a look with these keywords, that a (very wise) customer would type:
prolog ontology open source development services
I added a new page about "Web browser specs : placeholder for my dissatisfactions with all Web browsers".
My program of studies for the week-end, and after
write a performance test case about itinerary search
study the Java extensions of XSB and SWI-Prolog
How can I extract a domain ontology from opencyc?
How can I dump in CycL a microtheory out of opencyc ?
Is there a CycL to Prolog translator?
Some links to check about ontologies and AI
[PDF]
Format de fichier:
PDF/Adobe Acrobat - Version
HTML |
[PDF]
Format de fichier:
PDF/Adobe Acrobat - Version
HTML |
[PDF]
Combining First-Order Logic
Knowledge Bases
and Logic Programming
using fol-programs
Master Thesis
Michael Felderer, 2006
I try to understand how to use gcj on projects with a large C++ code base.
Calling C++ from Java is not documented. I got a hint from here : http://www.gamedev.net/community/forums/
In fact each Java method subcontracted to C++ should be labelled native, just
like with JNI. Indeed i's called CNI (C++ Native Interface)
I read AIMA, to see how I could use AI techniques for common developments
tasks.
An interesting article analysing the issues when designing an API sitting
between an OWL repository and an application such as an editor: Cooking the Semantic Web
with the OWL API Sean Bechhofer1 , Raphael Volz2 , and Phillip Lord1
Being disapointed by the ATL langage, I search in another direction :
"object
graph" transformation pattern - Google search
That brings a handful of results :
GROOVE - Graphs for Object-Oriented Verification
D. Blostein, H. Fahmy, and A. Grbavec, "Practical Use of Graph Rewriting," Technical Report No. 95-373, Computing and Information Science, Queen's University, January, 1995.
elipse 3.2 callisto is relased !
I've learned things in this article :
What's
New in Eclipse 3.2 Java Development Tools
From the developpers of the Coral UML editor , I read this interesting
article :
Model Interchange Using OMG Standards
http://crest.abo.fi/publications/public/2005/TR675.pdf
IN model: |----- *|City|
-------| |----- |road | * | |--------- OUT model : |----- * 2|----||Road|
-------|City|
|----- |----| I feel that this is a nice use case , and that something is missing in ATL. Namely the possibility to get the collection of all instances of the "road" association. Because for each such instance I want to create an instance of the Road class.
==> Would this be part of the solution :
helper def : roads : Collection(Mof ! Classifier) = MOF ! Association.allInstances() ;
I put a FreeMind file about UML tool development in http://jmvanel.free.fr/uml/development-uml-tools.mm .
The recipe :
cd src_new ./build.sh
This generates the file build/java-interfaces.jar , without which there is
are lots of red files in eclipse .
The interestinig thing is that the UML 1.4 classes are generated from the XMI
through MDR . This happens in a special Ant task in src/model-mdr/build.xml
:
<mdr storageFile="${basedir}/${build.javas}/mymdr"> <instantiate name="mof4models" /> <readXMI file="${xmi.file}.xml" extent="mof4models" /> <mapJava dir="${build.javas}" extent="mof4models" /> <instantiate name="uml" extent="mof4models" package="UML"/> <writeDTD file="${build.dir}/UML14.dtd" extent="uml"/>
The XMI files are in :
src/model-mdr/src/org/argouml/model/mdr/mof
. There is the
original OMG file 01-02-15.xml , supplemented by a small 01-02-15_Diff.xml
adding the MDR stuff .
So JMI and its MDR implementation allow to generate Java
classes from any MOF model . For each (meta) class in the meta model ( here UML
1.4 ) , there is in the generated code (in
src/model-mdr/build/java/
) :
an interface, e.g.
org.omg.uml.foundation.core.Operation
an interface for the associated factory, e.g.
org.omg.uml.foundation.core.OperationClass ClassifierClass
The factory OperationClass
has a method
createOperation()
returning an instance of Operation
.
For an abstract class such as Classifier
, there is no
create method in ClassifierClass
.
In turn these XXXClass
classes are obtained through getters in the
enclosing package.
I guess that the implementations corresponding to these interfaces are made
through DynamicProxy's .
applicable to M1 objects ( plain classes ) ?
openMDX's JMI
Tutorial
http://argouml-andromda.tigris.org/
openMDX , the pros :
impressive "Proof of Concept": an Enterprise class CRM solution in 200 days;
an effort on documentation;
leverages on MDR and JMI ;
swiss-made :-)
The cons : they seems to have reinvented a kind of in-memory JDO container . I couldn't understand how the real implementation ( methods body ) are injected .
I found this interesting thread while searching for "jmi emf comparison"
:
[news.eclipse.tools.emf]
Re: NetBeans MDR might consider adopting adopting EMOF as well
adopting EMOF as
well
Java Metadata
Interface(JMI)
-
why is XML Schema for MOF 2 not available ( http://www.omg.org/cgi-bin/doc?ptc/2004-10-17 )
Latest UML 2 in MOF available ? in mailing list of ArgoUML .
modularization of UML ; semantic markup ( à la RDF ) to add some semantic to UML elements; e.g. building an editor by stating what is a box and what is a link, the sonnectivity and other constraints
uniform drag'n'drop in XML .
example of ATL transform : dual graph; cities and roads .
possible to reverse an ATL transform ?
reading of Bézivin article "unification"
I installed ATL on my Linux laptop . There is no ready-made large zip like
for Windows ( single
zip bundle ).
I am impressed by the number (49) of ATL exemples ( http://www.eclipse.org/gmt/atl/atlTransformations/
). Each one has at least the 5 necessary files model and metamodel A and B, and
the ATL transform, plus a detailled documentation. It covers varied domains
like : UML, Java, XSLT, Relational, some Gang of 4 design patterns, Petri Net,
Maven, Bugzilla, Make to Ant, SVG, etc ...
Non-eclipse ATL Web
site - Eclipse/GMT/ATL
website.
http://www.topcased.org/
My first note since my hire by a software company ; it's my third week . My new job is about UML , not using UML for development, but writing software to manage UML models .
Some URL that I found interesting about UML, MOF, etc :
UML-Based
Ontology Modelling for Software Agents
MODELS2006/UML conference
homepage
4TH WORKSHOP ON COMPUTATIONAL INTELLIGENCE AND INFORMATION TECHNOLOGIES -
October 13, 2003, Faculty of Electronics, Niš, Serbia
http://cs.elfak.ni.ac.yu/ciit/w4/
A MDA-based Approach
to the Ontology Definition Metamodel
MDA Standards for
Ontology Development
jmi repository :
mdr: netbeans.org : Metadata
Repository home
QVT
QVT - Wikipedia, the
free encyclopedia
Domain-specific
modelling - Wikipedia, the free encyclopedia -
The official QVT (Query, View Transform) spec. from OMG is quite readable :
http://www.omg.org/cgi-bin/doc?ptc/2005-11-01
[from wikipedia] The most advanced open source implementation seems presently
(May 2006) to be the INRIA ATL
implementation with a large user community and a significant number of examples
available from an open source library.
MTL
TUTORIAL , part of http://modelware.inria.fr/
http://modfact.lip6.fr/ModFactWeb/index.jsp
- Simple QVT TRL (Simple Transformation Rule Language) is presented in details
in this
document(in French).
Books by Alison Cawsey :
introductory AI
course , Computers in
Teaching and Learning , and data structures and
algorithms II .
http://www.markwatson.com/opencontent/
- This is an open book about AI programming in Java by Mark Watson. There is a
chapter about expert system programming .
I should start a real knowledge base about articles and hyperlinks .
Paper books
"Constructing Intelligent Agents Using Java" by Joseph P.
Bigus and Jennifer Bigus, Jowh WIley, 2001, second edition. Chapter
4 is about reasoning system. There is CD with Java code attached to
the book,
"Jess in Action : Java Rule-Based Systems"
by Ernest Friedman-Hill. This is about building expert systems in
Java using Jess system, tons of code in the book.
Too bad that there's no RPM on Fedora! I had to install the packages tk and tk-devel after having this message:
checking for Tcl configuration... configure: WARNING: Can't find Tcl configuration definitions
To install the packages, I used the convenient yumex GUI.
The anemic business model strikes again !
I had the curiosity to look at Compiere 's JavaDoc :
MClient
Reading Holger Knublauch's presentation:
Ontology Design and Software Technology
Protege and Java, UML & Model-Driven Architecture
Ontology
Design and Software Technology (June 2003)
For me UML is a good standard for drawing diagrams. It's almost the only one,
and it can be applied to most things. Sadly many articles and books are full of
hard-to-read Java, XML, OWL, etc snippets , instead of nice -to-look-at
diagrams.
I don't agree with him about "Round-Trip Engineering" between UML and Ontology
, because simply ontology has a greater expressive power, so doing a
Round-Trip :
Ontology ==> UML ==> Ontology
can lead to data loss (or complex softaware is needed to ensure data
integrity). Besides that , there is the general inconvenient of round-trip
engineering: at each moment in the project, the source is either UML or
Ontology (the round-trip is rarely real -time) . I think the future is having
robust Knowledge bases and use them as center of the architecture. Is that
realistic with Protégé to-day ? I don't know ...
Design Principles by R. Martin
http://www.objectmentor.com/resources/listArticles?key=topic&topic=Design%20Principles
New on this site : Protégé
links
I'm starting a new (Java) project, with a not too large database, that could
fit in memory. The DB could be used mainly as a backup . So it's not a risk to
trial new technology, especially if I use the Data Access Object design
pattern.
Searching for OODBMS, I came across this :
http://www.eyedb.org/
Since 1994, EyeDB has been used in a lot of bioinformatics projects, and it
went open source in 2006 . For me it's worth a trail .
Published here : http://www.howradical.com/articles/2006/02/18/ruby-rails-and-databases
So I'm trying eYeDB . The first impression is good : there is clean build
procedure, with
./configure make
While it compiles, I have a loo at the "getting started" :
http://doc.eyedb.org/manual/html/GettingStarted/node6.html
I'm glad to see that I'm at a higher level than Java declarations , quite at an
UML abstraction level :
class Person { string firstname; string lastname; int age; Address addr; Person * spouse inverse Person::spouse; set<Person *> children; };
The instal step installs the java classes in /usr/ .
It launches doxygen, which takes again a long time .
There a dependancy towards a GNU environment. I wonder how well it would work
on Windows with Cygwin .
I wonder how easy it is to switch between this ODMG database , with a Java
client application, and the "classical" Hibernate solution .
make install
/usr//share/eyedb/tools/eyedb-postinstall.sh
eyedbrc start
as root .
eyedbrc status Program received signal SIGSEGV, Segmentation fault.
Entered on the bug tracker :
http://sourceforge.net/tracker/?group_id=127988&atid=710190
eyedbrc status eyedbuseradd jmvanel eyedbsysaccess jmvanel dbcreate eyedbodl -d jmv --update --package=person /home/jmv/test/person.odl eyedbodl --gencode=Java --package=person /home/jmv/test/person.odl
Question asked on the list : eyeDB and POJO
The Calendar team is proud to announce the first official release of the new Lightning extension: Lightning 0.1 for Windows, Linux and Mac OS X. This is a major milestone on the road to an integrated calendar for users of the award-winning mail-client Mozilla Thunderbird. Thanks go to all developers, testers and other supporters of the project. More information and download instructions are available on the Lightning homepage.
Preparing a training on advanced Swing
The Massachusets Institute of Technology put its course on line (
OpenCourseWare ) :
http://ocw.mit.edu/index.html
Very good quality !
later .......
I did this enhancement to JDepend ; it is
useful for me . It reports in the textUI the names of classes causing cyclic
dependency . I made the feature available to XML UI too . I also changed the
Ant stylesheet :
While I was there, I also wrote a small class counting fields and methods ,
extending jdepend.textui.JDepend :
src/jdepend/textui/JDependStatistics.java
Time permitting, the next step for me would be to extend the cycle finding
algorithm to find all the cycle starting points. I realize that finding all the
cycles ( in a badly writen software ) would lead to an uninteresting and
large amount af results. Think of a dependency graph having the shape of a
large grid ! But just finding all the cycle starting points makes sense . I
might need to use a library for graph theory .
I had a look at the Spring tests, to see how I could add some AOP in the
eXist database . A basic Spring example is :
AopNamespaceHandlerTests
However, it implies that the target object is retrieved from the Spring context
. Is there another possibility ? I mean , how can I have an allready existing
application object be "decorated" by Spring AOP ?
The goal in eXist would be to replace this code in Append . process () :
if (!doc.getPermissions().validate(broker.getUser(), Permission.UPDATE)) throw new PermissionDeniedException("permission to update document denied");
The relevant doc. in Srping is here :
http://static.springframework.org/spring/docs/2.0-m2/reference/aspectj.html
After reading more about AOP in Spring , I realized that for my requirement,
i.e. crosscutting concerns in a database engine, Spring is not the right tool.
Instead, direct use of AspectJ
seems the right solution .
Thinking about tests in a badly designed application , I wonder if I can generate some test source code for some class , say MyClass . Each call to constructor and method , or even field change, would be intercepted . Then the source code for the corresponding calls could be generated . The class arguments can be introspected to provide actual values in the generated code .
I read this article about AspectJ and Spring 2 :
http://www.aspectprogrammer.org/blogs/adrian/2006/01/typed_advice_in.html
To make it work, I must also read :
http://static.springframework.org/spring/docs/2.0-m2/reference/index.html
Article about mock objects :
http://www.onjava.com/pub/a/onjava/2004/02/11/mocks.html
Interesting blog on Spring :
http://chris-richardson.blog-city.com/
Two coverture tools to try :
http://cobertura.sourceforge.net/index.html
http://coverlipse.sourceforge.net/index.php
Vidéos sur Java en Fançais :
http://java.developpez.tv/javadesktop-dec2005/
Java Technology Performance Myths Exposed, TS-3268, JavaOne 2005
http://developers.sun.com/learning/javaoneonline/2005/coreplatform/TS-3268.pdf
He says that autoboxing is nearly ;-) free . But there are no figures or code,
just graph with ratios . I was searching for "performance loss autoboxing"
.
I read again an interesting thread on theserverside :
Is Java
losing to LAMP and .NET?
My opinion: Yes Java is suffering decreasing popularity compared to Lamp. The
reasons I see :
the absence of free mutualized web hosting for Java
the free availability of the JDK was revolutionary in its time, now the web is the media.
It could have been done by external projects but the Java platform is in tight control by Sun with an unclear mixture of legal and technical ways, and alone Sun does not the human resources to develop the platform as it should be (think of the startup time of the JVM compared to Python or Perl)
the perception that Java is complex
shure the Object Oriented technology needs experience; but also Java could be less complex:
suppress the static keyword and make it a pure Object language like Eiffel
simplify the library and its documentation by grouping overloaded methods
of course the fail of the EBJ technology has done a lot of harm
In this thread someone mentioned Wicked ; it's a Java Web framework similar to
Millstone .
http://wicket.sourceforge.net/ExampleHelloWorld.html
Starting HSQLDB :
http://hsqldb.org/web/hsqlDocsFrame.html
An interesting thread about VTD-XML on theserverside ... ?
The parser does not extract the XML data into a separate DOM structure but
essentially uses indexes into the original document to reduce memory overhead.
Article
: Envisioning a New Language:
A Conversation With Sun Microsystems' Victoria Livschitz
It speaks about a ne language, called Metaphors, whose main concepts are :
entity, process, organizational principle, condition, relationship, event, and
rule.
Book Data
Model Patterns by David C. Hay
When having the message "client denied by server configuration" on Apache,
it felt good to read :
ONLamp.com:
A Day in the Life of #Apache
even tough I knew the answer.
After a discussion with a client, enthousiastic about C#, I check the
existence of a C# Plugin for Eclipse. There is one :
Improve-Technologies:
C# Plugin for Eclipse
I should also try the Mono framework , but no
time now ...
I first install Wine :
rpm -Uvh wine-0.9.1-1fc4winehq.i686.rpm
Then the setup.exe works fine and the WinCVS' windows appears. Now I must
configure WinCVS to tell it where are cvs and python. I have a loook at the Wine User Guide
. In fact when starting wincfg I see that the Linux root is Z: under Wine. So
I can configure WinCVS for the cvs executable :
/usr/local/bin/cvs
It has been installed by gCVS.
My CVSROOT is :
:pserver:jmv@localhost:/var/cvs
If you want to test your knowledge on design patterns , there is this
wonderful quizz :
http://home.earthlink.net/~huston2/dp/patterns_quiz.html
I could find almost all of them, but it takes 1 or 2 minutes , and sometimes
the hint . Didn't find the flyweight . I took state for stategy .
Lot more material on Patterns on the same site :
http://home.earthlink.net/~huston2/dp/patterns.html
Groupware Web applications in Java
I'd like to find groupware Web opensource applications in Java, the equivalent
of opengroupware, Tutos, and the like . I allready found some :
groupware/applications.html
Searching
springframework on sf.net , I found this :
Takama Takama is a CMS based on the JSR 147 and 170; the project uses pluggable Portlet Containers (based on the JSR 168) as presentation layout. Takama uses cutting-edge technologies: J2EE, MVC (Struts), AOP/IoC via SpringFramework and is powered by Maven.
looks nice, but STILL AN EMPTY SHELL :-((
TASH template application Essentially, TASH is a Java web application that makes use of the Springframework, the Tapestry web application framework, Acegi Security and Hibernate. It's a template application, that may prove useful when starting your own web projects.
looks nice, but STILL AN EMPTY SHELL :-((
BRE4J BRE4J is a Business Rule Engine based on java implementation of Rete algorithm, provides a forward-chaining inference engine capabilities and has an adapter for springframework - for easy integration with J2EE platform. It supports CLIPS and RuleML as rul
Check Protégé ( http://protege.stanford.edu ), the
swiss knife for ontologies.
Java, open source, lots of plugins.
I got this error with eclipse debugger on Linux :
Error[0] in gethostbyname() call! err::Success Socket transport failed to init. Transport dt_socket failed to initialize, rc = -1.
The reason was that /etc/hosts was empty ; it should at least contain :
127.0.0.1 localhost
My UML vision of 3 years ago is still good ! But it's still not realized. However there are new things to say on that matter:
XMI is a bad standard: it's not an exchange format, it changes every year, and there are lots of combinations beetwen XMI and UML versions. Other exchange formats might be : plain Java sources, MDR objects serialized as Java object graphs;
a kind of universal interoperability is available now with frameworks and plugins: eclipse, mozilla, OpenOffice, spring, protégé. But of course each framework imposes its own rules.
reusable ontologies are richer in some way than UML - Object Oriented models, but they not yet the dominant paradigm for software development.
First I'll propose my solution on the ArgoUML list.
Based on the eXist XMl database,
it's possible to make an on-line repository of (open source) common business
designs. It allows to display HTML documentation, to search items and
documentation for strings.
I installed the open source UML editors Umbrello :
http://rpmforge.net/user/packages/umbrello/
Too bad that Fedora Core 4 doesn't have it ! Mandriva 2005 has Umbrello .
From the same provenance I found MP3 for xmms :
http://rpmforge.net/user/packages/xmms/
Quotation from the Tapestry framework at Apache.org ( http://jakarta.apache.org/tapestry/ ) :
In Tapestry, you create your application in terms of objects, and the methods and properties of those objects -- and specifically not in terms of URLs and query parameters.
This week-end I switched from Mandriva to Fedora Core 4 . I had to disable
SELinux to be able to boot .
What's interesting is that there is the latest gcj Java development kit with
native eclipse (version 3.1M6 ):
yum install eclipse-jdt.i386
So I created a project from the eXist sources .
And guess what ?
Just 6 compilation problems !
Since Spring Bean configuration is essentially
a graph of objects, it makes sense to represent it as a graph . A nice Swing
editor application (or eclipse plugin) could be developped using e.g. Jung or
Touchgraph libraries.
In fact SpringViz
does that by an XSLT transform from the Spring XML configuration to the
Graphviz visualization format. But it's not an editor, it's just a
visualization.
Conversely, the Spring XML Bean
configuration could be used to reprensent any in-memory Java objects graph.
Another idea is to use this Swing objects graph editor application as a view
for a debugger.
Still another idea is to use an UML editor for object diagrams. But object
diagrams are little supported by open source UML editors like ArgoUML and Umbrello .
I used memtester to check my memory on Linux :
http://pyropus.ca/software/memtester/
I upgraded my laptop to 1Gb . Look at this :-)
$ free total used free shared buffers cached Mem: 1033644 457108 576536 0 16632 251104
And I have eclipse + eXist server + mozilla running !
It was necessary since weeks. My client's application has a separate Tomcat +
Cocoon server + eXist of june 20th, and of course I need to have eXist from
CVS. I'll be able to have several big projects opened in eclipse .
I developed a simple popup plugin. It is open
source.
This popup plugin calls a user shell script from the popup menu, supplying as
arguments the file or folder path and the project path.
It can be useful as it is, or be the starting point for other plugins. It was
inspired by the excellent PDM plugin (http://pmd.sourceforge.net/) .
The small documentation is in French, but the source is commented in English.
Find it all here on my site :
eclipse/ecrire-plugin-eclipse-cdt.html
(posted on news://news.eclipse.org/eclipse.platform )
How do i get the project that is currently active programatically ?
I looked in docs everywhere : nothing .
The answer is simple: there is no notion of a current project in eclipse!
At least in the workspace object .
At each moment , there is one or more opened project(s). A project icon was
last selected in the manager .
From there eclipse infers a kind of current project . That's what is done in
Project / properties... pulldown menu . Sometimes it's not active, because
eclipse cannot determine from the last selects a "current" project .
So what I did is add a popup extension. From the selection, I can get a projet
.
I read with interest the article
Exploring Eclipse's ASTParser
How to use the parser to generate code
http://www-128.ibm.com/developerworks/opensource/library/os-ast/?ca=dgr-lnxw97ASTParser
Alas the download doesn't include the plugin.xml necessary to deploy the
example application . However Manoel the author kindly sent me the last
version.
The XQuery Generator - The XQuery Generator is a tool written in Java that enables the user to create XQueries based on a given XML Schema by defining selections and projections using a graphical user interface. Alas , the XQuery Generator is still under development, and only downloadable for internal purposes.
I updated 2 présentations (in French) :
I install the Subversion Plugin for
Eclipse - Subclipse to download the Protégé source code . The UML backend
is not there :-( in
http://smi-protege.stanford.edu/repos/protege/
There are 4 people on irc://irc.codehaus.org/#drools .
Reproduce the Drools Pet Store
Example with Protégé .
I start to create an OWL ontology with classes Cart and Item . I have to look
in the Protégé
OWL tutorial mentioned in the Protégé OWL
documentation to see what are :
datatype properties (simple type properties)
object properties (values belong to a class in the model )
The answer lies in parag. 4.4 OWL Properties .
First I don't try to reproduce the GUI. I use Algernon as a rule engine . I
look in the Algernon
tutorial to find the syntax , where I find inspiration in forward-chaining
rules , and Algernon commands .
I begin with the following rule :
If the user has bought at least 5 Gold Fish and does not already have a Fish Tank ask the user if they would like a fish tank.
I begin with some tests in the Algernon tab to get comfortable with the
Lisp-like syntax :
( (:instance Cart ?cart ) ( hasItem ?cart ?item) ) ( ( :COUNT ?count ?item ( hasItem cart1 ?item) ) )
I combine both this way :
( ( hasItem cart1 ?item) ( :COUNT ?count ?item ?item ) )
Example of class rule ( :COUNT instruction doesn't work ) :
( (:ADD-RULE Cart ( ( hasItem ?cart ?item) -> ( :COUNT ?count ?item ( ?item ) ) (:PRINTLN "count = " ?count ) ) ) ) ;; This works : ( (:ADD-RULE Cart ( ( hasItem ?cart ?item ) -> ( :COUNT ?count ?item ( hasItem ?cart ?item ) ) (:PRINTLN "count = " ?count ) ) ) )
Example of relation (slot) rule:
( (:ADD-RELATION-RULE hasItem ( hasItem ?cart ?item) -> (:PRINTLN "count === " ) ) ) )
Creating an instance to fire the rules :
( (:ADD-INSTANCE (?x Cart ) ( :NAME ?x "blublu") ( hasItem ?x fish1 ) ) )
The rules are not saved in the Protégé files . The rules are not fired
when the instance is created through the Protégé GUI . I tried with
Protégé native (CLIPS) and Protégé OWL . With Protégé native (CLIPS) I
can't change the name of the instance after creation .
>>>>>>>>>> TO BE CONTINUED
Algernon in Java
documentation .
I'm trying Swoop with Protégé's pizza.owl
example. There's a popup "Setting up views for the ontology" that takes most of
my CPU for 4 minutes and more. I cancelled and restarted, clicked here and
there, and managed to see something similar to Protégé. But if after that I
start the Pellet reasoner,
the window doesn't respond for minutes :-(( .
There are tens of people on the IRC irc://irc.freenode.net#swig - Semantic
Web Interest Group hack-n-chat - UTF-8 charset please - Weblog: http://swig.xmlhack.com/
- Logs: http://ilrt.org/discovery/chatlogs/swig/ .
jmvanel |
There's a popup "Setting up views for the ontology" that takes most of my CPU for 4 minutes and more :-( |
|
|
jmvanel |
I cancel and restarted, clicked here and there, and managed to see something similar to Protégé. |
|
jmvanel: from what I understand OWL has names and it has labels - which can be used to simulate inheritence - but protege doesn't expose this. |
|
|
how is swoop? someone said to try that on #swig? |
|
|
jmvanel |
swoop is quite similar to protégé visually, but it freezes quite too often :-( |
|
jmvanel |
I should try the new beta ... |
|
jmvanel |
OWL is XML, it has XML namespaces (xmlns) and prefixes , and each item , class , instance or property has an unique URI . |
|
yeah thats what I was reading |
|
|
so OWL is shoehorned a little into protege |
|
|
where as swoop is written for owl |
|
|
so hopefully it exposes things easier |
|
|
jmvanel |
Yes. And Protégé has the advantage to be more open to other formats (Clips, Prolog, relational DB, UML, ...) and reasoners (through the DIG interface), and visualization tools (e.g. TouchGraph, Jambalaya, ...). |
|
jmvanel |
So they are complementary. It's like HTML: I generally use Moziilla editor, but when I want spell checking, I use OpenOffice, and when I need complex substitutions I use gvim ... |
|
jmvanel |
I tried swoop-2.3alpha3 . I loads Protégé's pizza.olw example
readily. I has enhancements here and there: a nice TouchGraph view . |
Tried the JSave Protégé plugin
. It's not a GUI plugin, just a command-line program . Maybe I would be
interesting to use Java dynamic proxies, and genrate just the interfaces.
Nice discussion on irc://irc.freenode.net#protege with
the author of Drools , alias Conan (Mark Proctor). I learned that for Drools
3.0, OWL integration is planned . According to Mark, Drools ands its Rete
algorithm should be more efficient than Algernon . I have to check taht !
Found a bug in UML backend in Protégé related to Windows file
separator; send a mail to the list.
The official user documentation for UML backend seems outdated:
http://protege.stanford.edu/plugins/uml/use.html
The "File" pulldown menu doesn't have UML or XMI in "export to format" item .
It is replaced by "Convert to format" .
And there's no "import from format" item .
Instead there is a new type of project , "UML" . But I don't know how to import
an existing XMI file into Protégé.
Nobody on irc://irc.freenode.net#protege :-((
Created a map of the eXist developers :
http://www.zeesource.net/maps/map.do?group=335
Most-popular
rules engines and articles, from javarules.org , The Java Business
Rules Community.
Another list :
http://www.manageability.org/blog/stuff/rule_engines/view
Reading and running with Protégé
the Algernon tutorial
. It has the advantage over Drools to be integrated in Protégé, and to do
both forward and backward chaining. The inconvenient compared to Drools is that
we don't assert directly Java objects (but there is an indirect to do that with
JSave
). I have to see how I can reproduce with Algernon some of the Drools examples . After
that, I have to :
check the OKBC and other objects models for knowledge
see how Pojo (Plain Old Java Objects) can be processed in a Knowledge Base such as Protégé, and how frames (objects) in the KB can be viewed as Pojo
test the relational data source for Protégé; see how one can have a live connection, not a snapshot connection ( maybe connect XSB )
test the XML data source for Protégé (maybe connect eXist to Protégé)
test the UML import and export in Protégé
Examples of processings well suited to rules-based programming:
Thermostat
telephone calls pricing
CMS: approbation rules
workflow: states and transitions
optimisation of queries (e.g. XQuery) and processes
stock management, logistics
permissions and rights management
O'Reilly: Ten Myths about Open Source Software writen in 1999 is still interesting today !
After reading the doc. on Protégé / OWL API :
http://protege.stanford.edu/plugins/owl/api/ReasonerAPIExamples.html
I download the FaCT++ reasoner . It is using the DIG interface to expose its services to
Protégé :
# start FaCT++ : cd /opt/apps/jakarta-tomcat-4.1.31 export LD_LIBRARY_PATH=/usr/src/usr2/FaCT++/lib unset CATALINA_HOME bin/startup.sh # set reasoner URL http://localhost:8080/dig in Protégé / OWL
I follow the Madrid Protégé
OWL tutorial by Matthew Horridge with the Protégé window open (and the
FaCT++ reasoner Wreb server running).
After downloading drools, do this to run the examples :
ant jar-all ant helloword-java ant fibonacci-java
Read the online documentation.
An interesting article about using business rules
with Drools ("Give Your Business Logic a Framework with Drools"):
http://www.onjava.com/pub/a/onjava/2005/08/03/drools.html
: a stock trading application
A nice thread on theserverside.com :
http://www.theserverside.com/news/thread.tss?thread_id=34277
For an excellent explanation of forward and backward chaining read Charles
Forgy's recent articles at http://rulespower.com/ - RulesPower -
Forward and Backward Chaining: Part 1 of 3 .
Drools (298 000 hits on
google) and Mandarax (9 240 hits )
They each do completely separate jobs. One is forward chaining the other is backward chaining. Drools is a forward chaining system this means its reactive to data that is asserted into the system, it's event based. Mandarax is backward chaining, like prolog, you ask it questions and it tries to give you the answer.
Oryx UI for Mandarax ?
Other paths I explored :
drools eclipse , drools GUI
Notes:
form generation typically depends on an object instance and not only on class;
form generation also depends on the application, with prevents to put form generation logic into the business class
form generation can depend on a context, user or session history
to be pedantic, most of those rules are higher order logic (not first-order logic)
of course, rule-based computing can also be used for form validation and actions following user input
rules for form generation can be managed at the class or package level; it's possible to inherit rules following class class inheritance relations (does Drool facilitate this ?)
Here are some examples of rules for form generation :
follow references or not; edit indexed properties or not
edit undefined properties or not
rules based on property names (e.g. don't add input fields for properties whose name end with "Id")
rules based on object references (e.g. adress will be asked for a User object unless this object is associated to a Company object)
permission rules (e.g. only the boss can change user permission)
Added 2007-10 : form fields typically depends on metadata on fields: type,
cardinality, constraints; a form must be able to manipulate (partially)
non-valid data; possibly temporal logic and goal-directed rules can be
applied.
TODO <<<
As indicated in README.txt , after starting run-cyc.sh , you can browse to :
http://localhost:3602/cgi-bin/cyccgi/cg?cb-start
Then you have this interesting page :
Tools
login as CycAdministrator.
Exercice : import SUMO / OWL into Protégé
http://ontologyportal.org/translations/SUMO.owl.txt
http://www.co-ode.org/resources/tutorials/ProtegeOWLTutorial.pdf
Exercise 56: Import the koala ontology into an ontology
is not correct anymore: TODO <<<<
SchemaWeb provides a
comprehensive directory of RDF schemas to be browsed and searched by human
agents and also an extensive set of web services to be used by RDF agents and
reasoning software applications that wish to obtain real-time schema
information whilst processing RDF data.
[PDF] Using
an Ontology to Evaluate a Large Rule Based
Ontology: Theory ...
Google search :
"rule based" ontology
[PDF] Using an Ontology to Evaluate a Large Rule Based Ontology: Theory ...
http://courses.washington.edu/mebi550/HandsOn-part2.html
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmaj/html/aj1rules.asp
Quotation of the day
from Michael Kay : XSLT
2.0 - An Interview with Michael Kay
Being schema-aware means that a stylesheet (or query) can declare what type of input document it is designed to process, and what type of output document it is designed to produce. The main result is that you get better diagnostics when you get your code wrong.
"L'art nait de la contrainte" André Gide
The art is born from constraint.
I wonder if the best programming languages are not the ones that disallow lots
of things and restricts choices. Among the thing desirable to forbid:
static variables (e.g. in eiffel)
create an UML association when all constraints are not satisfied (e.g. multiply constraints)
declare variable of concrete class
use of new, binding to a concrete class implementation
It's not like the list of bad smells from Martin Fowler. You can't consider each as something that a programming language should avoid, because most of them are not not hard limits, like the size of classes.
While thinking about my idea of navigation graph for browser, I came across
this nice page of SVG examples:
http://www.croczilla.com/svg/samples/
Quite many work on Mozilla 1.7.5 .
I could do my navigation graph inside mozilla using SVG, XUL and JavaScript .
There is probably a javascript hook (callback) for opening a page by clicking
on a hyperlink.
Leveraging on existing Java technology, it could be a part of a 100% Java
browser, or an applet (but again we need a callback on opening a page). Is
there a nice open source Java browser?
I did my first non-trivial application with Spring and JUNG ! It opens an XML file, and displays it as a graph. I used this interface for plugability of different implementations of Swing Graph Displayers :
public interface GraphDisplayer { public void setGraph(Graph graph); public JComponent getJComponent(); public void setGraphLayout(Layout l); }
Although quite simple, this interface says a lot about GraphDisplayer:
its input is a Graph object
it provides a display as a Swing JComponent
you can configure it with a Layout
Here Graph and Layout are JUNG interfaces. I implemented GraphDisplayer using the GraphDraw JUNG class. The Spring configuration file (spring.xml) that allows plugability of different implementations is :
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="XMLGraph" class="org.diagxml.jung.JUNGXMLGraph" singleton="false"> </bean> <bean id="graphDisplayer" class="org.diagxml.jung.JUNGGraphDisplayer" singleton="false"> </bean> </beans>
The initialization code using the Spring Framework is :
SimpleXMLGraphApp(String url) throws Exception { ApplicationContext ctx = new FileSystemXmlApplicationContext( "spring.xml"); XMLGraph xmlgraph = (XMLGraph) ctx.getBean("XMLGraph"); xmlgraph.add(new URL(url)); graphDraw_ = (GraphDisplayer) ctx.getBean("graphDisplayer"); graphDraw_.setGraph(xmlgraph); }
Please note that thanks to Spring this
application has no dependance to the graph technology used to represent and
display the graph. I could use JGraph or
Grappa ( a port of a
subset of GraphViz to Java ) or touchGraph to display the graph,
provided that I write another adapter implementing GraphDisplayer.
The default Layout is the SpringLayout. It lasts about 1 second for the
relatively small test document. The default Layout can be changed without
changing the Java code.
---------------- continued here: graph/spring-jung.html
----------------------
Download eclipse project: graph/spring-jung.zip
Programming ressources:
JUNG Manual
Spring -
Java/J2EE Application Framework
Inversion
of Control Containers and the Dependency Injection pattern
MatrixPro
http://www.cs.arizona.edu/people/kobourov/GRIP/
GRIP: Graph dRawing with Intelligent Placement
Quotation of the day
from http://www.understandingxml.com/archives/2005/01/xml_in_the_crys_3.html
... using XForms opens up the possibility that the XForm content is generated
based upon a schema and requirements list, rather than drafted by a
web-designer.
It's true that "using XForms opens up the possibility that the XForm content
is generated based upon a schema and requirements".
It's in fact part of the movement towards a more declarative style of
programming. But the interesting issue is how exactly will it be done. First,
XML Schema is not the only source of data structure. UML and plain objects with
properties are others. Second, how would the development process go? Transforms
or wizards from XML Schema to XForms? How can we ensure the coherence between
XML Schema , XForms, implementation classes?
There are also further complications. XForms alone, based on XML Schema, is unable to validate data in the most general case, because XML Schema is unable to enforce a relation between two different tags. You didn't mention also the fact that validation must in all cases stay on the server, because the web client can't be trusted.
My selection of Gurus, gourous, and
experts
Seen in Recommended Reading in Cafe con Leche XML News
Search
Looks at the Big Picture (Wired)
Open-sourcing
the news (news.com)
Reviving Advanced Hypertext (Jakob Nielsen, AlertBox)
Wave of Change How to Build a Global Internet Tsunami Warning System in a Month (www.pbs.org)
Edd Dumbill's Weblog: Behind the Times (Quote of the day)
I did a development for ArgoUML. I added an entry in the pull-down menu of classes in the class diagram. This entry makes all classes connected by associations to the selected class visible.
I saw this in the documentation of Apache's
ObJectRelationalBridge OJB:
The mapping resides in a dynamic MetaData layer which can be manipulated at
runtime through a simple Meta-Object-Protocol (MOP) to change the behaviour of
the persistence kernel.
http://db.apache.org/ojb/
This dynamic aspect shows more flexibility than other products like Hibernate
and iBatis.
I read this article about
"Language Oriented Programming" (LOP), cited by Martin Fowler here: MetaProgrammingSystem.
It's allways good to read an anbitious article like this, even if I don't quite
agree.
He has right when he writes:
reinvented MOF
My view is deceptively simple: the more natural a programming environment is,
the quicker it will be adopted by programers. But in the long run, the
main-stream programming of to-day will appear to be a kind of handcraft of the
years 1950-2010.
AI, NLP language
Published in news://comp.lang.java.databases
I want to federate (aggregate) several physical datasources, each having its
JDBC driver.
My idea is that this aggregator could be implemented as a special JDBC driver
or Connection, that will respond to queries from the application by
dispatching to the relevant tables in each physical database, and construct
the final rowset by assembling rowsets from each physical database.
JDBCAggregator aggregator = new JDBCAggregator(); aggregator.addConnection(db1); aggregator.addConnection(db2); ResultSet = aggregator.createStatement().executeQuery ( "SELECT * from db1.client as cl, db2.order as ord " + "where cl.id = ord.client_id" );
where all tables from database 1 (respectively 2) get prefix db1 (resp. db2).
Or possibly no prefix if there is no ambiguity.
I'm looking for an open source project or code suggestions.
I try the Creole eclipse plugin. It is a interesting concept, being based on a display of Java code (or other knoledge such as Protégé knoledge base) as a graph. But it is soooo slooooow ! I used JXPath as a test Java source, it is not very large, and my machine is a 2.4GHz Celeron. I should try the stand-alone version ...
I like DbModeller .
I think it would be great if it would be integrated in Squirrel-SQL . Squirrel-SQL is
perfectly complementary to DbModeller, having queries and database management.
It has a plugin architecture, with about 10 plugins adding important features
such as SQL code completion and syntaxic coloring (these plugins should be in
the release). Moreover, Squirrel-SQL has a companion project that is an eclipse
plugin.
Together, Squirrel-SQL and DbModeller would have about the same features as MS
Access (except the GUI assistant for queries which is not very good anyway, and
user forms).
Other missing features :
connection to Object-Relational framework such as Hibernate
import and export to UML
federate several databases
A nice weblog page about ANTLR vs. JavaCC .
eclipse web tools platform project: the replacement of lomboz :
eclipse
WTP milestone plan (Draft)
Marc Godin gave me this nice link about open source Java software : http://www.java-source.net/ . I proposed eXist in the category "databases".
I tried to add C++ (CDT) to my newest eclipse 3.1M2 , but CDT currently
doesn't work with eclipse 3.1 .
Eclipse Platform 3.x) -
Use the following URL in a Site Bookmark in the update manager:
http://update.eclipse.org/tools/cdt/releases/new
News
New Apache Software Foundation project in the incubator: it's around business process management : Agila , designed for writing Java applications that automate business workflows
Software notes:
Carnegie-Mellon University has posted the first beta of Sphinx-4, an open source speech recognition engine written in pure Java
XOM is an XML parser by E.R. Harold . What's Wrong with XML APIs (and
how to fix them). Four Styles of XML API
*
Event Based Push: SAX, XNI
*
Event Based Pull: XMLPULL, CyberNeko, StAX
*
Tree: DOM, JDOM, dom4j, ElectricXML, etc.
*
Data Binding:
Preparing a training about Web services, I got interested in REST (Representational
State Transfer):
XML.com: Implementing REST Web Services: Best Practices and
Guidelines by Hao He.
I came across an alternative to Axis :
ActiveSOAP -
easily embeddable, StAX based framework for working with document centric Web
Services,
REST services and for implementing high performance SOAP intermediaries;
about Active Soap read this:
Thursday, September 23, 2004 |
Supporting both pure REST based XML services and SOAP based web services with ActiveSOAP
The Eclipse Web Tools Platform Project will bring a synthesis of the plugins for Web development, like Lomboz and the IBM contribution.
A new version of GEF (Graph Editing
Framework), the concurrent of JGraph that is the basis of ArgoUML.
A new project for graph algorithms, JGraphT , by the same team that did JGraph.
No special doc. except the Javadoc .
I installed the latest PMD 2.0.6 for
eclipse 3.0 . PMD is now installed from an update Web site:
http://pmd.sourceforge.net/eclipse
I had to remove the empty file :
workspace/.metadata/.plugins/net.sourceforge.pmd.eclipse/ruleset.xml
which provoked an error when running PMD.
I right away applied it to GanttProject, a nice Java GUI
for project management.
I found a few flaws like:
assigning to null
using implementation classes like Vector instead of Collection interface in prototypes
call to ovveridable methods in constructor
I also applied JDepend to find the cyclic dependancies among packages, as
explained here : howto-test. Result: about half
of the packages are cyclic.
QUESTIONS
I wonder if the business rules and classes are well separated from the GUI, and able to be used in a Web or command line app.
Is GanttProject ready for MVC - publish/subscribe Design Pattern, which means I can add easily other views, e.g. a tabular view
is there allready some D'nD ?
For a new project I am looking for a Database - centered CMS (Content Management Systems). I call this application framework DB-CMS. Follow this hyperlink: Database - centered CMS application framework DB-CMS: specification and architecture.
rpm -Uvh /home/jmv/distribs/linux/Plone2-2.0.3-2.src.rpm # compile: rpm -bb --nodeps /usr/src/RPM/SPECS/Plone2.spec urpmi expat rpm -i --nodeps /usr/src/RPM/RPMS/i586/Plone2-2.0.3-2.i586.rpm
At the end I get the message:
Creating initial 'main' instance... Instance created. Listening on 127.0.0.1:8080, initial user: 'plone' with password: 'plone'. For security reasons, Plone only listens on the local interface, and it is common to use Apache to proxy to that particular port to make Plone available to the outside world. Check out the how-to section on http://plone.org if you are unsure about how to set up proxies in Apache. Setup of initial database in 'main' instance... Created initial database content. Found the database in old location. Using this for the 'main' instance... New database location is /var/lib/plone2/main/var. look at /etc/plone2/main/zope.conf. Run then "/etc/init.d/plone2 start" to start Plone2. you may create new Plone instances with mkploneinstance.
Then I browsed to http://127.0.0.1:8080/Plone to get the
standard Plone wellcome page.
I can also go to the Zope
Management Interface with user plone and password plone.
Reading Knowledge
Representation Book ... John F. Sowa,
Knowledge Representation: Logical, Philosophical, and Computational
Foundations, Brooks Cole Publishing Co., Pacific Grove, CA, ©2000.
There are two main languages plugins that are in the (3.0beta) distribution of Protégé:
PAL language (Protégé Axiom Language), a Knowledge Interchange Format (KIF)-like language that is used to do complex queries that can't be done by the simple "Queries" tab
Algernon language, a
lisp-like language; an interesting article: Algernon
for Expert Systems; a good
Algernon
Tutorial. It can do most anything:
queries
instance and class management
apply rules:
forward-chaining rules are like triggers in Relational Databases:
When the component ships, delete it from inventory ((shipped ?x ?date) -> (status ?x Sold) (last-update ?x ?date))
backward chaining rules allow to specify an implication used in subsequent queries. Before Algernon retrieves information from the KB it will first try to infer additional relevant information by finding and executing relevant backward-chaining rules.
A component is onsite unless it has been sold. ((location ?x ONSITE) <- (:FAIL (status ?x Sold)))
Additionally, there are other languages, with their associated engines, that are less intimately linked to Protégé:
Prolog
JESS
CLIPS
Flora Tab Widget, a query tab based on F-Logic.
PSM (Problem Solving Methods)
I try the latest Umbrello 1.3, in a hope that the association with cardinality 1-* will be generated. I'm deceived.
I never could compile gcc from CVS, so this time I try to submit a bug
report:
Back To Bug#
17118
In fact it seems that my gcc 3.3 (from Mandrake Cooker) used to bootstrap was broken...
I'm currently trying to get WordNet in a format that Protégé can understand. WordNet is available in Prolog. Maybe get a Prolog to OWL translator ? I remember that long ago someone from W3C made a translation in RDFS. I found:
this at W3C site: Wordnet in RDFS and OWL
Which one is best ?
While searching, I found an OWL version of opencyc.org . But I'm warned that "This file takes approximately 9 hours to load into Protege".
There are 24Mbytes, 60000 entries, and among that about 50 part of plants, but
also numerous properties (Color, Shape, etc).
How semantic Web can make you rich
(funny):
The future's
bright with RDF
I went on my bike to the INRIA library and borrowed the book:
Artificial Intelligence: A Modern
Approach
It is for a 1 year course for graduates. Let's see what I can learn. My primary
concern is understanding ontologies and how to apply them to develop data
exploration programs and enterprise repositories.
I found an interesting project to define an ontology for plants:
Plant Ontology Consortium
: http://www.plantontology.org
It is defined in little known language: DAG data structure, with an editor
called DAG edit . I
downloaded the CVS for the ontology and the software from sf.net.
"Trying to make bits uncopyable is like trying to make water not wet. The
sooner people accept this, and build business models that take this into
account, the sooner people will start making money again." -Bruce Schneier
GNU/Linux
AI & Alife HOWTO
The Generic Frame Protocol (GFP) provides a common object oriented API to
knowledge representation systems
» CLIPS, Classic, Theo, Loom, Ocelot, Sipe,
Ontolingua, Clos, ...
I created this simple ontology in KAON: km/test/plants-kaon.rdf, and I tried to load it Protégé: it said:
JenaLoader completed after 180 ms
but the properties were lost!
In a few years, Protégé has become a fantastic toolbox with tens of
plugins, much like eclipse in its domain. There is a nice little article
entitled "Ontology Development 101: A Guide to Creating
Your First Ontology" that reuses the famous example of the wine
ontology.
Following is a guided tour of the Protégé Contributions
Library.
|
|
|
A Java-based Web application that allows users to share Protégé ontologies over the Internet. |
|
|
|
Facilitates terminological enrichment of ontologies and includes an interface for WordNet. |
Among plugins, Jambalaya presents graph views, with classic layouts:
horizontal or vertical trees, spring algorithm, star shaped.
To activate Jambalaya:
http://www.thechiselgroup.org/jambalaya/install
TRIED - Included in Protégé distribution.
With TGVizTab you can visualize Protégé ontologies using the TouchGraph library.
|
|
|
Represent a relational database as an ontology and the database data as an instance tree. |
This plugin has many potential uses, e.g. for enterprise repositories.
It's too bad that it's not open source. Also is it possible to use any JDBC database? Does it work like this: each row in a table becomes a Prolog fact (and Protégé instance), and the binding is dynamic, in the sense that if rows are added by another program, the next Prolog or Protégé query will take in account these new rows. Finally it not clear what happens for large databases. I hope that: - tables are not loaded in memory - large rowsets for intermediairy queries generated by Ontobase are loaded in memory chunk by chunk
|
Import and export ontologies to and from OKBC servers via the OKBC interface. |
Included in Protégé 2.1.1 distribution.
|
|
|
A rule based inference system implemented in Java and interfaced with Protégé. Performs forward and backward rule-based processing of frame-based knowledge bases. |
|
An integration of GNU Prolog for Java with Protégé. |
|
|
|
Use the CLIPS Rule Engine from within Protégé. |
|
Allows the use of Jess and Protégé together. |
Note: Jess is similar to CLIPS
|
|
|
A query tab based on F-Logic. |
|
Navigate OWL ontologies easily and switch between the asserted and inferred model after classification. Protégé colour coding and several export formats are supported. |
|
Interactively use the the Protégé Knowledge-Base API. |
|
|
|
A python console for editing macros for Protégé. |
KAON is a nice RDF and RDFS editor, with a graph view with spring layout.
Feature |
protégé |
KAON GUI |
---|---|---|
Save format |
protégé(CLIPS text file format),OWL,RDF,RDFS |
RDF+RDFS |
Documentation of classes, etc |
OK |
no way to add |
Constraints |
View documentation(Protégé Axiom Language - PAL language), documentation (GUI) |
no way to add |
Internal help |
YES but doesn't work |
NO |
This is attractive:
Ontolingua
provides a distributed collaborative environment to browse, create,edit,
modify, and useontologies.
The server supports over 150 active users, some of whomhave provided us with descriptionsof
their projects.
But the source for the server doesn't seem to be available. And moreover a Web
User Interface doesn't seem to be best way to create ontologies.
These days lots of readings about AI & KM.
Merging between different knowledge sources: some AI languages like prolog don't have namespaces
Reflexivity: it would be nice to apply KM techniques to KM itself : the knowledge aboout KM itselt could be formalized and accessible using KM techniques.
Object-oriented languages (OO) have a hierarchy with inheritance of properties, whereas in IA languages a class inherits of properties AND values.
Vocabulary equivalences
OO languages |
frame-based KR |
RDF |
prolog |
---|---|---|---|
class |
frame |
class |
concept |
instance |
instance |
resource |
|
field, property(JavaBean) |
slot |
property |
predicate |
static field |
own slot |
|
|
invariant(e.g. Eiffel) |
facet, constraint |
|
|
|
|
|
|
field value |
filler |
value |
|
assignment |
|
triplet |
fact |
I'm working again on the eXist XML database, mainly doing JUnit tests and refactoring. I noticed that, due to the complexity of the product (persistent DOM, Xquery engine, XML:BD collections, user and permission management, XML-RCP, SOAP, REST remote interfaces, Cocoon adapter, ...) the numbers of bug reports grows. Meanwhile the users don't know how to report bug efficiently using JUnit, or simply provide enough information to reproduce the bug. After all, most of them are not developpers. So to help testers and developpers, I did a page explaining How to test eXist , that could be adapted for other projects as well.
Added on this site a page showing ths source code of the same GUI in different (computer) languages. This a what I call the Rosetta stone of GUI's. The idea came from a series of articles in Linux Magazine (France).
training about Design Patterns, eclipse and Refactoring
It's been a long time since I haven't read Cafe au Lait Java News and Resources by Elliotte Rusty Harold . It's good to know that good things are still here !
I'm try to make a simple example showing interoperation with C++. There is a nice article on gcj by project originator Per Bothner in Linux Journal.
This doesn't show all depandancies :
$ rpmgraph /var/cache/apt/archives/*.rpm > ~/rpmgraph.dot $ dotty ~/rpmgraph.dot
Here is the howto for doing parsing with JavaCC for C++.
I put some oder in my list of software tools:
Principales_sources_technologiques.htm
I remove lots of second choices and things that I had no time to check recently
here :
software2.html
While many others that I would like to have time to check are here:
Projets_a_surveiller.html
I found a problem in autoconf . I got messages such as this when doing "make install" :
../../../libtool: line 1: /home/jmv/install: is a directory
Indeed such as file exists and is a link to a direstory :
ls -l /home/jmv/install lrwxrwxrwx 1 jmv jmv 14 jan 2 08:10 /home/jmv/install -> home0/install2
Apparently, when it's a link, configure
(generated by autoconf) thinks that it's necessarily a link to an executable
...
Workaround :
export INSTALL=/usr/bin/install ; make -e install
Reported to bug-autoconf@gnu.org
For years I have been developing simulation software, and for years I have
searched ways of making input forms generically. When the project is
XML-centered, there are solutions based on XML Schema aware editors such as
Pollo, GenDiapo, or Xerlin; also solutions based on XForms editors; all this in
Java and open source.
And when the project is java-centered, a natural solution is to use JavaBean
techniques. For example I tried to extract out of NetBeans the classes
pertaining to this, but it was impossible to do in a short time.
The JavaBean specification was presented by Sun as something for IDE's only,
useable at "design time". But many tools, such as the Castor Java-XML binding
project, or the new XMLEncoder and XMLDecoder classes, make use of the
specification at run time, with the java.beans.Introspector class being the main utility.
Many years after the specification of JavaBeans, there is still a lack of a
simple editor library leveraging on JavaBean standard. There is the Raptor
project:
http://sourceforge.net/projects/raptor/
but it is a heavy-weight project. For a project I reused and adapted this:
http://uk.geocities.com/johndavid_taylor/projects/beanpeeler/
I started from here and updated the bean peeler library:
make the panel easier to use independantly from the frame
upgraded to swing
clean up code
added recursive editing
Here is the current version:
http://jmvanel.free.fr/java/formation-5jours/jmvanel/beans/
There is a test main() in class BeanPeelerPane. Use the wget command to get it
all.
Enough with the context, now about the requirements. What is done is in
green.
The vision of the project is that the Generic JavaBean editor should be robust
enough to accept any JavaBean object without any configuration or BeanInfo.
show and edit consistantly simple typed properties, including enumerated
take in account BeanInfo classes when present according to the JavaBean specification
allow to recursively walk through the bean, which means that if a property has a type which is a class having itself properties, the editor should, when user wants to edit that property, open a new panel, a or new window similar to the primary panel to edit that property
while doing this, take in account the cycles in object graph (don't open twice an editor for an object in a cycle of referencing objects)
indexed properties: allow to:
show items by calling recursively the editor
add a new item at the first null position
delete items
add a reference to another item in any position
add n references to another item
add n clones of another item
do the same as indexed properties for List properties
also treat Map and Set properties
also treat the new JavaBean design patterns with add() and remove()
leverage on Javabean standards and swing standards (possibly use XMLEncoder and XMLDecoder to keep config., but introduce the least possible quantity of XML, this library should be Java and Object Oriented centered); an idea is to use the tool itself to configure the editor; that means : a second instance of JavaBean editor could be used to configure the user JavaBean editor
for numerical properties: editor config. :
min., max., and default
standard text field or slider
It's not finished, but it runs pretty well. It does indexed properties,
recursive editing. Launch BeanPeelerPane and push "Create father" button .
Next I'll do slider for numerics, and BeanPeelerPane being itself a Bean
possibly edited by itself to add configuration such as behavior details,
colors, fonts.
It is under GPL licence, and it will be part of an ecological/biological
simulation framework that I will put on sourceforge.net today. See "Why you shouldn't use
the Library GPL for your next library" on the gnu.org site.
After having booted with the printer on, kudzu proposed to configure the printer, and I let it do this. Then printtool displays:
Unable to open USB device "usb:/dev/usb/lp0": No such device
and lpq say:
imprimante is not ready
("imprimante" is the name of my printer)
However I had, following the advices on the hpoj driver website, chosen in the
printtool GUI:
ptal::/mlc:usb:PSC_750
in tab "Spool type" .
/usr/sbin/printtool
a.k.a.
redhat-config-printer-gui
is misleading and doesn't refresh the diagnostic line "Unable to open ..." when
you change the spool config. And above all, as the documentation says, you have
to click on button "Validate" in secondary window, but that is not sufficient,
then click on button "Apply" in primary window.
Before that :
cat /etc/cups/printers.conf # Printer configuration file for CUPS v1.1.19 # Written by cupsd on lun 05 jan 2004 15:23:27 CET <DefaultPrinter imprimante>Info Created by redhat-config-printer 0.6.x Location hp psc DeviceURI usb:/dev/usb/lp0 State Stopped StateMessage Unable to open USB device "usb:/dev/usb/lp0": No such device Accepting Yes JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0 </Printer>
After that :
cat /etc/cups/printers.conf # Printer configuration file for CUPS v1.1.19 # Written by cupsd on lun 05 jan 2004 15:23:27 CET <DefaultPrinter imprimante> Info Created by redhat-config-printer 0.6.x DeviceURI ptal:/mlc:usb:PSC_750 Location hp psc State Idle Accepting Yes JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0 </Printer>
If I had known this, I could have changed that by hand-editing !
I wanted to have a clear idea of Java
performance compared to C++. So I did a simple program with 1 billion
of multiplications that I tested with C++, Sun's JVM, and GNU's gcj compiler.
There are other execution environments possible. At the kaffe.org site, there are many projects aiming
to run Java in unusual
ways. While I was here, I tried kaffe 1.1.3; installation didn't succeed on
Fedora Linux, so I posted a message on their list ...
To avoid staying on a defeat, I then tried the Jikes
RVM . This one looks really serious, there is a 100 pages Postscript
Manual. To install it, I added this :
export HOST_JAVA_HOME=$JAVA_HOME
in
rvm/config/i686-pc-linux-gnu-jmv
Axis
http://ws.apache.org/axis/java/user-guide.html
I read with much interest and alarm the announcement of the end of Speak Freely
internet telephone program. This is because of the explainations about the
dangers of the Network Address Translation (NAT) in the routers connected to
the broadband links.
Posted in Incipient(thoughts)
Laurent Bossavit's weblog, where this question was raised:
"object languages after 20 years". Have objects failed ? Is a new "post-object"
era being ushered in, and can we guess what new ground will be broken in that
era ?
I haven't (yet) looked at Scarlet language.
I still believe in (and practice) OO languages. What I would need for the next
step and next few years is to integrate some design and refactoring patterns
into the core languages. For instance you could look at each refactoring in
eclipse, and ask yourself the question: what information do I add to the code
when clicking while refactoring, and how could we design language extension
that would make EXPLICIT this information? The most obvious design pattern to
incorporate in an OO language in delegation. Something like :
delegate MyInterface to thisField;
Another line of thought is about interfaces and instanciation. Interfaces are
useful, of course. BUT they leave on the hack side the essential and logically
connected point: the instanciation. It's aggried and understood (not widely
enough but let's leave that apart) that you should thrive to use variables
declared as interface types as much as possible. In practice how you obtain a
concrete object complying with a given interface can be done in a number of
ways: à la JDBC, à la JAXP, à la EJB, etc.
Of course this allows lot of flexibility, but it's a terrible source of time
loss and complexity. I think that languages have allways evolved out of the
need to DECLARE concepts that where implicit before. This allows to check
consistency of code, to build tools and IDE's, and to standardize
practices.This interface and instanciation theme is closely related to
so-called component or plugin framework that appear everywhere: Avalon of
apache.org, eclipse plugin framework (if you know more examples write me). Both
solve the interfaces and instanciation issue by having XML configuration files.
The advantage of such approaches is that, once an extension point has been
created, new features (classes) can be added at this point without changing one
comma in the existing code. Once again, these plugin facilities should be part
of a language.
Still another line of thought is the Aspect Oriented Programming, (AOP)
which is based a notion of poincut, a sort of callback (hook) that can be added
to any method without changing the existing code. This allows to implement
generic and orthogonal concerns like security, transactions, logging, quite
separately from domain-specific code. Currently in AspectJ it is implemented by "weaving"
the original bytecode, which means inserting the calls to AOP methods (named
"advices") into the bytecode. On the AspectJ language see Introduction
to AspectJ . There is 25 hits with AOP on sf.net !
Plugin frameworks and AOP share a same goal, adding features at some point in
the code without changing the existing code.
Functional programming (ML, CAML, Scheme, Haskell, ...) is still at the
margins of state-of the art programming, but it has its promisses. Namely,
forbiding modification of variables after creation enables proof of
programs.
More to come..........................
There are currently many ways of mixing languages to take advantage of specific features of languages, or reuse legacy code:
language translation
object oriented distributed computing frameworks like Corba, Web services, RMI, COM, .NET
leveraging on intermediary machine language (Java bytecode, CLR)
direct call of one language from another
hybrid languages, e.g. XQuery, a mix of XML and algorithmic programming
The
Functional Programming Language XSLT
TODO:
Rule-based programming
MDA
Saw this interesting sentence by Michael Kay in :
Sourceforge Project: Saxon XSLT and XQuery Processor: Forums: View Forum
- Discussion Forums: Open
Discussion - XQuery
from XSLT
Everything you can do in a FLWR expression can be expressed equivalently
using xsl:for-each and xsl:variable. (That's why I was able to implement FLWR
expressions in Saxon by essentially compiling them into XSLT
instructions).
I wrote about BeanShell, JSH, and other Java Shells here in French.
To build Beanshell from the CVS, make a directory lib, and put inside:
bsf.jar from http://jakarta.apache.org/bsf/
servlet.jar from most anywhere (e.g. Saxon or Tomcat, or get it from Sun J2EE )
then just start ant:
ant jarall
Other targets are listed by:
ant -projecthelp
And now I can see that the sources from CVS are not the last sources -:((
I post a message to BeanShell
developpers' list. OK, the last sources are in a zip on the site!
Questions about XMLBeans
I am a long-time user of Castor, but ...
questions apply equally to Castor, or ...
are Java references implemented? (a Java object referenced twice should be stored as an IDREF or a keyref)
are XML Schema keyref implemented as Java accessors?
dynamic binding (changes made through the Java interface change the underlying XML representation) YES
dynamic binding from XML to Java? (changes made to the underlying XML representation through the Java DOM interface change the Java objects)
use case: a generic XML editor is used
if YES, some kind of callback is needed (maybe Javabean-style)
is the underlying XML implementation (DOM or maybe other?) pluggable?
item-to-item XML-Java isomorphism ? (from a Java object, get the corresponding XML object, and vice-versa)
natural naming translations between Java class names and XML tags YES