OWL2 library for Prolog
Prolog Gnuplot JavaScript CSS TeX Shell Other
Failed to load latest commit information.
apps translate_IRIs/2 Nov 15, 2010
benchmarks for paper Nov 17, 2009
bin mv Nov 27, 2010
doc Mailing list in sw.gr Nov 23, 2010
examples Restructure documentation, move to doc folder Mar 8, 2010
iso some stuff for prologcafe/java Apr 2, 2010
jars works for hermit Jul 2, 2010
owl2java accidentally committed wrong file Mar 17, 2009
owlgres docs Jun 17, 2009
t slim Jun 25, 2010
testfiles objectPropertyAssertion to support lists as Objects. Mar 9, 2011
tools dev Jun 25, 2010
util top-to-bottom Nov 18, 2010
.gitignore popl Jul 9, 2010
Cookbook.txt fixed typo. From Martin Günther Jul 9, 2010
INSTALL.txt docs Mar 3, 2010
MANIFEST slim Jun 25, 2010
Makefile.in fixes from Martin Günther Jul 2, 2010
README docs Nov 16, 2010
Reasoning_using_Thea.txt docs Nov 15, 2010
Release_prep.txt new Jul 8, 2010
aceowlxml.owl IRI not handled. Preparing a solution Nov 25, 2010
configure added Makefile.in for installation, based on standard SWI packages Feb 11, 2009
configure.in added some convenience predicates to owl2_model. more functionality f… Feb 13, 2009
graph.xml Remove owl_parser_log, remove owl/4 used1 predicates Mar 31, 2010
httpd.log Restructure documentation, move to doc folder Mar 8, 2010
install-sh added Makefile.in for installation, based on standard SWI packages Feb 11, 2009
owl2_catalog.pl catalogs May 4, 2010
owl2_classifier.pl still alpha, not ready May 31, 2009
owl2_classifier.plt generate class expressions from instances May 20, 2009
owl2_dotty.pl changed pred name display_obj -> visualize_obj Nov 27, 2010
owl2_export_rdf.pl Annotation correction. annotation/3 axioms are now created from aNN/3… Feb 18, 2011
owl2_export_rdf.plt fixed roundtrip Jun 19, 2009
owl2_fol.pl first order logic Jun 16, 2009
owl2_from_rdf.pl objectPropertyAssertion to support lists as Objects. Mar 9, 2011
owl2_from_rdf.plt Added automatic plunit test for for all approved owl2_test cases Oct 22, 2010
owl2_from_rdf.txt BaseURI+ compatible with SWI 5.10.x May 5, 2010
owl2_from_rdf_utils.pl rdf_2_owl should not clear owl/4 facts of current Ontology before cop… Feb 18, 2011
owl2_graph_reasoner.pl docs Nov 23, 2010
owl2_instance_util.pl docs Nov 17, 2009
owl2_io.pl ISO Nov 27, 2010
owl2_java_owlapi.pl owl:Nothing support Nov 27, 2010
owl2_java_owlapi.plt added teams test http://owl.cs.manchester.ac.uk/2009/07/sssw/teams.html Aug 4, 2009
owl2_lcs.pl cmd-line-args Nov 18, 2010
owl2_lcs.plt tests Nov 8, 2010
owl2_manchester_parser.pl frames Jun 28, 2010
owl2_manchester_parser.plt frames Jun 27, 2010
owl2_metamodel.pl cosmetic Aug 26, 2010
owl2_model.pl Annotation correction. annotation/3 axioms are now created from aNN/3… Feb 18, 2011
owl2_model.plt tests Mar 24, 2009
owl2_obo_parser.pl obo Aug 26, 2010
owl2_owllink.pl Move owllink documentation to examples/owllink Jan 5, 2010
owl2_owllink.txt Documentation for owl2_rl_rules Jan 5, 2010
owl2_plsyn.pl fixed Nov 27, 2010
owl2_popl.pl popl Nov 27, 2010
owl2_profiles.pl added predicates for testing if ontology fits profile Nov 24, 2010
owl2_reasoner.pl get unsatisfiable classes Nov 27, 2010
owl2_reasoning_rules.pl Commit changes Feb 10, 2010
owl2_rl_rules.pl Merge branch 'master' of git@github.com:vangelisv/thea.git Nov 25, 2010
owl2_rl_rules.plt moved tests to separate .plt modules May 27, 2010
owl2_shell.pl popl Nov 27, 2010
owl2_text_display.pl shell Nov 27, 2010
owl2_thea1_compat.pl owl_export_rdf 1st version Jun 18, 2009
owl2_to_progol.pl formatting Jul 18, 2009
owl2_to_prolog_dlp.pl documentation for reasoning Dec 12, 2009
owl2_to_prolog_dlp.plt more comprehensive tests Apr 10, 2009
owl2_util.pl vars Nov 27, 2010
owl2_xml.pl Added support for both IRI and URI, owl and owlx namespaces Nov 26, 2010
owl2_xml.plt added roundtrip test May 26, 2009
owl_parser.pl owl2rl_rules fg and bg reasoning tested Dec 27, 2009
pldoc.sty Restructure documentation, move to doc folder Mar 8, 2010
swrl.pl docs Nov 15, 2010
swrl.plt fixed Aug 4, 2009
swrl_rdf_hooks.pl test_use_owl/3 now exported May 5, 2010
thea.pl Commit changes Feb 10, 2010


---+ Thea2 : Prolog Modules for OWL2

A collection of modules for parsing and manipulating OWL2 ontologies
in Prolog. It is developed with SWI-Prolog in mind, but the goal is to
maximize portability with other prologs, such as Yap and XSB.

This documentation is intended to be read via pldoc

---++ Installation


You can bypass installation and use the 'thea' script directly. See

---++ Overview

The module owl2_io.pl provides a means of loading and saving OWL2
axioms in a prolog model using predicates such as load_axioms/3 and
save_axioms/3. For example =|load_axioms('pizza.owl').|=

The model is documented in owl2_model.pl, and is based on Structural
Specification and Functional-Style Syntax for OWL2
(http://www.w3.org/TR/owl2-syntax). Predicate names such as
subClassOf2/, equivalent_to/2 and class/1 can be used to query an
in-memory prolog database.

For example:

:- use_module(library(thea2/owl2_io)).
:- use_module(library(thea2/owl2_model)).

show_superclasses(OntFile,Class) :-

The database can be manipulated via assert_axiom/2 and
retract_axiom/2. For more advanced OWL pattern matching and
replacement, see owl2_popl.pl

The Semantic Web Rule Language (SWRL) is also supported via swrl.pl

A number of different reasoners can be used - the module
owl2_reasoner.pl provides predicates such as reasoner_ask/2, which can
be used to query over an entailed knowledge base. A variety of
reasoners can be plugged in, both native prolog and non-prolog (the
latter accessed seamlessly via either owl2_owllink.pl or

---++ Command Line Usage

The script "thea" in the bin directory should work from anywhere, with
no installation of thea modules required.


thea --help

for full instructions. Many complex operations can be chained on the
command line.

See also the other wrapper scripts in the bin directory

See Command_Line_Usage.txt for more details

---++ Further Reading

 * Cookbook.txt - a collection of recipes for various tasks
 * Reasoning_using_Thea.txt - how to use reasoners

See also the apps/ directory for example applications.

---++ Module Manifest

 * owl2_io.pl -- reading/writing OWL from different sources, including:
  * owl2_from_rdf.pl -- requires library(semweb)
  * owl2_export_rdf.pl -- requires library(semweb)
  * owl2_xml.pl -- support for OWL-XML
  * owl2_manchester_paser.pl -- incomplete support for Manchester syntax
  * owl2_plsyn.pl -- infix prolog syntax for OWL
 * owl2_model.pl -- definition of prolog predicates used to embed OWL
 * swrl.pl
  * swrl_rdf_hooks.pl -- allows SWRL to be parsed by owl2_from_rdf.pl
 * owl2_reasoner.pl -- pluggable reasoner framework
  * owl2_rl_rules.pl
  * owl2_graph_reasoner.pl
 * owl2_java_owlapi.pl (requires JPL)
 * owl2_owllink.pl
 * owl2_util.pl -- misc utilities
 * owl2_popl.pl -- prolog ontology processing language
 * owl2_metamodel.pl -- information about OWL axiom types

---++ Reasoning support

The DLP subset of OWL2-DL can be translated to logic programs using a
transormation defined by Grosof. See owl2_to_prolog_dlp.pl

The resulting programs can be used with Prologs such as Yap and
XSB. There are also hooks for answer set programming and disjunctive
datalog systems such as DLV.

There is also a very partial TBox reasoner in owl2_reasoner.pl, and an
ad-hoc reasoner in owl2_basic_reasoner.pl that can be used with a
non-tabled prolog such as SWI; however, this gives incomplete results.

The DIG interface from Thea1 has yet to be converted. However, as we
now have OWLLink support, and DIG is being retired in favor of OWLLink.

You can also use java reasoners via the OWLAPI bridge. See

For more information see Reasoning_using_Thea.txt

---++ Relationship to SWI-Prolog SemWeb Library

Currently we use rdf_db.pl to translate from OWL RDF-XML to OWL
axioms. This 'consumes' the triples in the RDF database. Eventually we
would like a dynamic view over an RDF database, although this will be
difficult due to the non-monotonic nature of the mapping between RDF
and OWL.

---+++ On namespaces

Currently all IRIs are treated as Prolog atoms. This makes for
slightly verbose axioms, especially if long URLs are used.

One possible future option is to use the semweb library and
rdf_register_ns/2 to allow for convenient specification of namespaces
using a QName-like mechanism. This is not currently
implemented. Comments welcome.

One possibility is to simply rewrite the ontology using more compact
atoms. Even though the OWL spec dictates that well-formed IRIs should
be used, Thea allows you to use any unique atom to identify an
entity. See remove_namespaces/0 in owl2_util.pl for details. Of course,
care must be taken when doing this.

---++ Prolog Compatibility

The goal is to keep the core ISO compliant and usable across prolog
systems but this is difficult due to the different implementations of
modules in different Prolog engines. We develop for SWI-Prolog and are
aiming for full support for Yap in the near future.

See the iso/ directory for a dynamically generated version of some
Thea modules, stripped of module declarations. This is usable in
no-module systems like GNU Prolog and systems with incompatible module
syntax such as XSB. Only a subset of Thea functionality will be
available here, as SWI/Yap specific libraries are used for RDF, XML
and Java interaction.

---++ Sample Applications

See the apps/ director

---+++ Web interface

There is the beginnings of a primitive web front end:

* apps/webthea/webthea.pl

---+++ Obol - label parsing and generation

* apps/labelgen/labelgen.pl

---+++ MIREOT - selective migration of referenced classes into an ontology

* apps/mireot/mireot.pl

---++ Authors

This module is a continuation of Thea1, developed by VV.

Some of the code was developed by CJM

Contributions from:

* Martin Güther