Creating Java Apps with a Protege Ontology

Constructing an ontology (a concept map) is a marvelous way to begin the design of a new application. The Protege ontology tool, in conjunction with the JENA plug in, makes it possible to quickly generate the Java classes for the application's data core.

by Eric Armstrong

Overview

--Allen Holub's design concept (__link to course__)

--Protege is a good tool for that purpose -- especially when it is combined with JENA, which can be used to generate Java classes. However, Protege 2000 has some quirky behaviors and some unfortunate interface choices. The documentation is a little sketchy, as well, which makes the program seem more difficult to use than it really is. This article should help to plug the gaps.

--link to Ontology 101 -- a great intro to creating an ontology that uses Protege in it's examples
--(Note: That tutorial contains a caution that ontology hierarchies differ from class hierarchies -- a caution that deserves further explanation!)
--link to Learning Java page for more information on developing with Java

--getting the data structures right
--even if you only use a subset of the data
--can always modify functionality downstream, but data conversions are hard -- and the more data you have, the longer the conversion takes. (That doesn't mean the data structures have to be perfect before you start coding, but the better and more complete they are at the outset, the happier you'll be in the long run.)
--Protege + JENA => Java data classes

--Protege can save in multiple formats, and there are multiple widgets that process the data
--in this case, we save as RDFS (RDF schema), and let JENA process that schema to create Java classes

--we can also use Protege to create test data (instances of the ontology classes)
--in this case, the data will be saved in RDF files

Using Protege 2000 -- A Guide for the Object Oriented Developer

--slot==attribute
--slots have independent existence, so they're reused. e.g. size attribute
--protege bug: attributes added to classes don't always appear in the slot view until Protege restarted
--sometimes they do, but not always

--enumerations: e.g. Color: red, blue, green
--Symbol type
--strings "concatenate" when you create an instance

--instance vs class type
--UI bug: "allowed parents" (s/b "allowed classes". The term "parent" was undoubtedly meant to imply the notion of inheritance -- so you don't have to list all possible classes, only a set of superclasses that contains them all)

--unknown: what a list of "template values" does
--completely undocumented. 3 references in the User Guide that tell how to use it, none that explain what it is
--*should* be a subset of allowed values that will appear when you create an instance
--but a list of values can be created there, even when the allowed values list is empty

--protege bug: schema constraints not active until you restart Protege

--bug: displays sometimes aren't updated until you select a different class in the tree and come back
(example: when was it that happened?)

Using the JENA Plugin to Generate Java Classes

...TBD

--working with RDF files for UI prototyping

--converting data to database tables?
--JDBC??

Learning Java & Agile Programming (=> new article)

--the trick is learning object-oriented thinking
--my book had a great introduction to the concept, but it's now $150 on the used book market
--(I should put the two introductory chapters on the web)

--BlueJay for learning Java

--Agile Programming: Unit Testing, Refactoring, Patterns, and Pair Programming

--Recc'd books on Java and Agile Programming

The Web App Technology Stack

--Tomcat or AS8 Dev Ed (used as a web server, with server-bean capabilities) for development

--other Phillipe recc's

--TreeWidget: OurFaces

Summary

 

§ Home  ·  Health  ·  Music  ·  Dance  ·  Golf  ·  Yoga  ·  Essays  ·  Store §
www.TreeLight.com

Subscribe for announcments.
Contact me to send feedback, make a donation, or find ways to help others.
And by all means, be sure to visit The TreeLight Store.