projects that utilize a data source to publish data as RDF embedded as RDFa an XHTML notation for embedding RDF in XHTML web pages and I see this as a
growth area for publishing information resources that are useful for both humans and software agents.
4.8 Material for Further Study
Writing Semantic Web applications in Java is a very large topic, worthy of an entire book. I have covered in this chapter what for my work have been the most useful
Semantic Web techniques: storing and querying RDF and RDFS for a specific ap- plication. We will see in Chapter 10 some useful techniques for gathering semantic
information from the web. Specifically, in Section 10.1 I briefly talk about entering semantic data from the Open Calais system into a Sesame RDF repository.
I have already mentioned several Java libraries that support OWL Descriptive Logic reasoning in Section 4.6. When the expressive power of RDF and RDFS become
insufficient for your application you will then need to use a library supporting the OWL language and OWL Description Logic reasoning. The combination of RDF
and RDFS is sufficient for many applications and using this simpler technology is the right way to get started developing semantic web applications. Because RDF
and RDFS with very few OWL features, commonly referred to as RDFS-Plus are easier to implement and have a smaller learning curve, I believe that the adoption of
OWL DL will be slow.
I concentrated on using Sesame in an embedded mode in Java applications in this chapter but another common use is as an RDF repository web service. In either
case, the basic ideas of converting data to RDF, storing RDF, and allowing SPARQL queries are the same.
72
5 Expert Systems
We will be using the Drools Java expert system language and libraries in this chap- ter. Earlier editions of this book used the Jess expert system tool but due to the
new more restrictive Jess licensing terms I decided to switch to Drools because it is released under the Apache 2.0 license. The primary web site for Drools is
www.jboss.orgdrools where you can download the source code and documentation. Both Jess and Drools are forward chaining inference engines that use the Rete algo-
rithm and are derived from Charles Forgy’s OPS5 language. One thing to keep in mind whenever you are building a system based on the Rete algorithm is that Rete
scales very well to large numbers of rules but scales at O
N
2
where N is the num- ber of facts in the system. I have a long history with OPS5, porting it to Xerox Lisp
Machines 1982 and the Apple Macintosh 1984 as well as building custom ver- sions supporting multiple “worlds” of data and rule spaces. One thing that I would
like to make clear: Drools is the only technology that I am covering in this book that I have not used professionally. That said, I spent some effort getting up to speed on
Drools as a replacement for Jess on future projects.
While there is some interest in using packages like Drools for “business rules” to capture business process knowledge, often as embedded components in large sys-
tems, expert systems have historically been built to approach human level expertise for very specific tasks like configuring computer systems and medical diagnosis.
The examples in this chapter are very simple and are intended to show you how to embed Drools in your Java applications and to show you a few tricks for using
forward chaining rule-based systems. Drools is a Domain Specific Language DSL that attempts to provide a syntax that is easier to use than a general purpose pro-
gramming language.
I do not usually recommend Java IDEs a personal choice but if you already use Eclipse then I suggest that you use the Drools plugins for Eclipse the “Eclipse
Drools Workbench” which help setting up projects and understand the Drools rule language syntax.
The Eclipse Drools Workbench can automatically generate a small demo which I will go over in some detail in the next two sections. I then design and implement
two simple example rule systems for solving block world type problems and for answering help desk questions.
The material in this chapter exclusively covers forward chaining production systems
73