Menu

#33 Normalization of Axioms does not work for some Disjunctions

open
None
5
2009-02-19
2009-02-19
No

There seems to be a bug regarding the handling of disjunction in the normalization process in WSML2Reasoner.

According to spec:
------------------
Rules of the form A :- B1 and (F or G) and B2 are split into two
different rules:
* A :- B1 and F and B2
* A :- B1 and G and B2
Rules should be split and there should be no disjunction left - rules should be "simple".

Practical example (see attached Ontology):
------------------
axiom BuildingAnnouncementZ1ApplicationRequestDefinition1
definedBy
?request memberOf BuildingAnnouncementZ1ApplicationRequest
:-
?request[construction hasValue ?construction, projectType hasValue
?projectType] memberOf ConstructionServiceRequest
and ?construction memberOf SmallResidentialHouse
and (?projectType memberOf NewBuild or
?projectType memberOf BuildingExtension or
?projectType memberOf ReBuildWithChangeOfExteriorView).

Results in:
-----------
WSML2DatalogTransformer, DatalogVisitor, throws an exception in:

public void enterDisjunction(Disjunction arg0) {
throw new DatalogException("Disjunction is not allowed in
simple WSML datalog rules.");
}

Reason:
-------
At this point of the normalization all disjunctions should be gone.

The execution path is roughly:
Starting in convertEntities() in DatalogBasedWSMLReasoner, LloydToporNormalizer constructs a LogicalExpression transformer based on
the LloyedToporRules.

After this Normalization step there should only be
simple datalog rules left. But this does not hold.
When inspecting the Logical expressions passed into
WSML2DatatolTransformer's transform() method afterwards, there are still _some_ disjunctions left.

Theoretically the output of the above example should be:
N :- BLA
and (?projectType memberOf NewBuild or
?projectType memberOf BuildingExtension or
?projectType memberOf ReBuildWithChangeOfExteriorView).
Should result in:
N:- BLA and ?projectType memberOf NewBuild
N:- BLA and ?projectType memberOf BuildingExtension
and so on.

The most simple case to catch this behavior is:
N :- A and (B or C) and (D or E)
I added a unit-test in LloydToporNormalizerTest for now, which is bound to fail until this is fixed.

I suspect that the expressions are simply traveresed in the wrong order / the rules are applied in the wrong order.

Discussion

  • florianfischer

    florianfischer - 2009-02-19
     
  • florianfischer

    florianfischer - 2009-02-19
    • assigned_to: nobody --> florianfischer
     

Log in to post a comment.