POPL

Prolog Ontology Processing Language

Quick Intro

POPL (Prolog Ontology Processing Language) allows you to write expressive ontology rewrite rules in a high-level declarative fashion using a syntax similar to Manchester syntax. For example, to change all existential restrictions to universal restrictions:


P some X ===> P only X.

The following example takes all axioms of the form W subClassOf (has_part some P) and replaces them with P subClassOf (part_of some W)


W < 'has part' some P ===> P < 'part of' some W.

Command line Usage

Individual POPL directives can be called from the command line:


thea --popl "add disjointClasses(X,Y) where (subClassOf(X,A),subClassOf(Y,A),X\=Y)" testfiles/caro.owl --to owl

However, it is probably best to place all directives in a file and process it


thea --popl-file tf-caro.popl testfiles/caro.owl --to owl

Other options can be passed – e.g. setting a reasoner:


thea --popl-file tf-caro.popl testfiles/caro.owl --to owl

POPL Files

Syntax

A POPL file must be valid prolog syntax, with any of the infix operators allowed in plsyn. See plsyn for details.

Options

Options can be embedded in the POPL file. These instruct the engine which reasoner to use, whether to expect use of labels rather than IRIs in the rules, etc.

Rewrite Rules

Rewrite rules are of the form LHS ===> RHS. (terminated by a “.”). If an axiom matches then LHS, it is replaced with the the RHS. If the axiom contains an expression that matches the LHS, each occurrence of that expression in that axiom is matched by the RHS.

Rewrite rules can also be of the form LHS ===> RHS where Condition. Here Condition is a prolog goal. The Thea OWL2 model is assumed.

Each axiom is processed by all rules, starting from the first rule, ending with the last one listed.

Background Rules

Arbitrary prolog code can be placed in the POPL file. Unit clauses are not allowed, instead always say “Head :- true.”.

Advanced Examples

From OPPL2 examples:


propertyAssertion(adjacentTo,X,Y) ===> classAssertion( hasLandBoundary some ('LandBoundaryFragment' and boundaryOf value Y), X).

Alternatively, based on inferences rather than assertions:


option(reasoner(pellet)).

% add new assertions
add classAssertion( hasLandBoundary some ('LandBoundaryFragment' and boundaryOf value Y), X) where reasoner_ask(propertyAssertion(adjacentTo,X,Y)).

% remove original assertions
remove propertyAssertion(adjacentTo,X,Y).

The following makes all subclass-siblings mutually disjoint:


add X\^Y where (subClassOf(X,A),subClassOf(Y,A),X\=Y).

The following does the same thing, but makes single disjointClasses axioms for the entire set of siblings:


add disjointClasses(L) where setof(X,subClassOf(X,A),L),L\=[_].

Trackbacks

  • By Thirty OWL API Tools » AI3:::Adaptive Information on September 26, 2011 at 6:07 pm

    […] POPL (Prolog Ontology Processing Language) allows you to write expressive ontology rewrite rules in a high-level declarative fashion using a syntax similar to Manchester syntax […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: