Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
OWL2 library for Prolog
Prolog Gnuplot JavaScript CSS TeX Shell Other

This branch is 206 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
apps
benchmarks
bin
doc
examples
iso
owl2java
owlgres
rules
t
testfiles
tools
.gitignore
Cookbook.txt
INSTALL.txt
MANIFEST
Makefile.in
README
Reasoning_using_Thea.txt
configure
configure.in
graph.xml
graph_http.log
httpd.log
install-sh
owl2_basic_reasoner.pl
owl2_basic_reasoner.plt
owl2_catalog.pl
owl2_classifier.pl
owl2_classifier.plt
owl2_export_rdf.pl
owl2_export_rdf.plt
owl2_fol.pl
owl2_from_rdf.pl
owl2_from_rdf.plt
owl2_from_rdf.txt
owl2_from_rdf_utils.pl
owl2_instance_util.pl
owl2_io.pl
owl2_java_owlapi.pl
owl2_java_owlapi.plt
owl2_manchester_parser.pl
owl2_manchester_parser.plt
owl2_metamodel.pl
owl2_model.pl
owl2_model.plt
owl2_owllink.pl
owl2_owllink.txt
owl2_plsyn.pl
owl2_popl.pl
owl2_profiles.pl
owl2_reasoner.pl
owl2_reasoning_rules.pl
owl2_rl_rules.pl
owl2_rl_rules.plt
owl2_tbox_reasoner.pl
owl2_tbox_reasoner.plt
owl2_thea1_compat.pl
owl2_to_progol.pl
owl2_to_prolog_dlp.pl
owl2_to_prolog_dlp.plt
owl2_util.pl
owl2_xml.pl
owl2_xml.plt
owl_parser.pl
pldoc.sty
swrl.pl
swrl.plt
swrl_rdf_hooks.pl
thea.pl

README

---+ Thea2 : Prolog Modules for OWL2

%TOC%

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

See INSTALL.txt

---++ Overview

The model is based on Structural Specification and Functional-Style
Syntax for OWL2 (http://www.w3.org/TR/owl2-syntax), and can be found
in owl2_model.pl

Predicates such as subClassOf/2 can be used to query in-memory axioms

There are a variety of surface forms for OWL2. The goal is to
eventually support all of these for both parsing and writing. So far
we have parsers and writers for:

* RDF - owl2_from_rdf.pl
* OWL-XML - owl2_xml.pl

We also allow for reading and writing from prolog factfiles.

The module owl2_io.pl is used for reading and writing other formats
and languages. For example:

==
swipl -g "[library('thea2/owl2_io')],load_axioms('testfiles/wine.owl',owl)"
==

See

* Cookbook.txt

For some handy recipes

---++ SWRL support

The module swrl.pl provides support for the Semantic Web Rules Language

SWRL rules are treated as axioms, extending owl2_model.pl

In addition, we allow for representation of rules as prolog terms and
prolog programs - there is a partial converter from prolog programs to
OWL2+SWRL

---++ 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
owl2_owlapi_java.pl

For more information see Reasoning_using_Thea.txt

---++ Utilities

Currently the owl2_util.pl is a grab-bag of ad-hoc utility
predicates. Browse this to get an idea of some of the capabilities.

For example, one useful predicate is use_labels_for_IRIs/0

---++ 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.

---++ Optional Extras

The core modules are

* owl2_model.pl -- for representing and manipulating axioms and expressions in OWL ontologies
* owl2_io.pl -- for reading/writing axioms

However, there are various additional modules that are not required
but may be useful for specific purposes. Here is an overview of what
is currently distributed (some of these may move to separate
distributions):


---+++ Integration with other LP systems

Pure prolog, disjunctive datalog, description logics etc are all
related families of languages constituting some subset of first-order
logic. Each offers its own inference procedures including the prolog
WAM, SLG resolution, DL reasoners, ILP etc. Navigating this territory
can be difficult due to a lack of standards. Thea aims to make this
easier.

See Cookbook.txt for some recipes

---+++ Integration with exteral tools

---++++ OWLAPI

If you have JPL installed you can use a bridge module to access
all the capabilities of the OWLAPI. This includes reasoners such as
Pellet and FaCT++.

* owl2_java_owlapi.pl

Requires JPL

---++++ OWLGRES

Owlgres is an open source, database-backed scalable reasoner for
OWL2.  

* owl2_sqlmap_owlgres.pl - allows ABox axiom predicates to be mapped
to an OWLGRES database

Requirements:

* ODBC
* sql_compiler.pro (currently distributed as part of blipkit)

---++ 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
Something went wrong with that request. Please try again.