• No results found

Semantics Expressiveness Management Algorithms

4.5 Expressiveness Management Approach

4.5.4 Semantics Expressiveness Management Algorithms

The semantic expressiveness management is based on the above section’s modular- ization and projection techniques.

Algorithms of which extracts are elucidated here were devised based on the con- tents of the above section. They stress on the resolution aspect of expressive axioms (Algorithm 1) and then on projecting and building lists of deprecated axioms per projected expressiveness (Algorithm 2, itself based on Algorithm 1).

Definition 3 Deprecated ontology elements are those rendered obsolete due to the projection π of an ontology O from a Language A (usually OWL DL) to a Language B (a DL fragment). Depreciated elements form the “resolved” versions of extra ex- pressive elements once their expressive features are deprecated. A depreciated element can be equal to ⊥ when no particular depreciated version exists for the deprecated element.

Algorithm 1 Interpretation

SMOF structures contain elements that allow the detection of restriction axioms that have DL undecidability side effects, along with their corresponding depreciated ele- ments. These elements can potentially be set per use case: the depreciation level that the algorithm privileges (lines 3 through 5). However, in general they are defined independently, per expressiveness level, i.e. the second depreciation level privileged by the algorithm (lines 7 through 8); or simply according to their type, the third depreciation level applied by the algorithm (in lines 11 through 13).

Algorithm 1 resolve(α,): Resolve Axiom α accordingly with expressiveness 

1: Input: the axiom to be resolved α, the expressiveness level to abide by  2: Output: the resolved axiom α

3: α← extract UC.depreciated(α); 4: if α is not null then

5: set α ← α; 6: else

7: α← extract smofElement.depreciated(α) w.r.t. ; 8: if α is not null then

9: set α ← α; 10: else

11: α ← extract smofElement.depreciated(α); 12: if α is not null then

13: set α ← α; 14: else 15: deprecate(α); // α = ⊥ 16: end if 17: end if 18: end if 19: return α; (line 15).

A deprecated axiom is rendered obsolete (set for elimination from the ontology to be projected).

Algorithm 2 Interpretation

This pseudocode represents extracts taken from the complete projection algo- rithm. These extracts highlight the basic elements behind its logic and conception. The algorithm can be called for particular levels of expressivity, and for specific dep- recated lists to be returned for comparison purposes.

Its asymptotic complexity isO(n), where n is the number of input axioms to be tra- versed by the algorithm and projected according to their classified expressiveness in the metamodel.

Starting with a definition of empty SMOF ontology containers (line 3), and dictio- naries of (key,value) pair lists to hold (deprecated, depreciated) elements (line 4), the pseudocode then considers the set comprising all axioms in the input ontology (line 5).

It visits these axioms one after the other. Lines 6 through 9 treat the DL restriction axioms (by calling the previous algorithm to resolve them appropriately).

Algorithm 2 Extracts from Projection Algorithm:

1: Input: ODL ←{The set of all axioms forming the OWL DL Ontology} ;

2: Output: Projected ontologies πDL, πEL, πQL, πRL along with corresponding Dictionary of (deprecated, depreciated) elementsDL−,EL−,QL−,RL− ;

3: πDL, πEL, πQL, πRL ← {} ;

4: DL−, EL−, QL−, RL−← empty (key,value) pair lists ;

5: for all axiom α∈ ODL do

6: if α.type∈ (RestrictionAxiomsDL) then

7: (ODL.swap(α, resolve(α, DL));

8: DL−.add(α, resolve(α, DL)) ;

9: end if

10: if α.type∈ (SemanticsEL,SemanticsQL,SemanticsRL) then

11: (πEL.add(α), πQL.add(α), πRL.add(α)) respectively;

12: else

13: (πEL.swap(α, resolve(α, EL)),

πQL.swap(α, resolve(α, QL)),

πRL.swap(α, (resolve(α, RL))) respectively;

14: (EL−.add(α, resolve(α, EL)), QL−.add(α, resolve(α, QL)),

RL−.add(α, resolve(α, RL))) respectively;

15: end if 16: end for

17: for all αrl ∈ πRL do

18: if αrl.type∈ Direction Conditional Constructs then

19: constructlhs ← lhs(αrl)

20: constructrhs ← rhs(αrl)

21: if (constructlhs ∈ disallowedlhs) or (constructrhs ∈ disallowedrhs) then

22: πRL.add(resolve(αrl, RL)) ; 23: RL−.add(αrl, resolve(αrl, RL)) ; 24: end if 25: end if 26: end for 27: for all αql ∈ πQL do

28: if αql.type∈ QL Conditional Semantics then

29: if ∃clash condition ∈ πQL then

30: πQL.resolve(αql) 31: QL−.add(αql, resolve(αql, QL)) ; 32: end if 33: end if 34: end for 35: πDL ← ODL

belongs to is made (note that very often one axiom belongs to more than one frag- ment); each axiom is accordingly treated, with projected ontologies and deprecation lists being built progressively.

Every profile’s syntactic fragment metadata helps determining a first subset of DL axioms, which still need some more specific filtering to be applied.

From line 17 to line 26, some RL specific processing takes place. The preliminary set of RL axioms is reconsidered to determine whether its constituting antecedents and consequents happen to belong to a further restrictive group. In such a restrictive group, constructs are differently interpreted based on their belonging to the left or to the right hand side of the expression: such a detected condition causes the complete axiom to be excluded from the profile.

It should be pointed out that this reasoning is similarly repeated for the QL syntactic fragment: this part is not shown in the extracts, for the sake of simplicity and ease of presentation.

Lines 27 through 34 depict the analysis of the henceforth isolated set of QL axioms, by further checking whether their constituents can be affected if combined with other particular constructs, and whether these specific constructs happen to be present in the isolated set of axioms being investigated. Such collected axioms, if the test turns out positive, are resolved to get depreciated or excluded from the profile.

Again, it is noteworthy that this reasoning is similarly repeated for the EL and QL syntactic fragments: again, this part is not shown in the extracts, for the sake of simplicity and ease of representation.

The final statements are straightforward and refer to the returned resulting projected ontologies and lists of deprecated/depreciated elements.

Projected KB Example

The following example lists a subset of axioms in a KB (in which the DL notation is used). An illustration of how they will be processed by the projection algorithm will follow it.

Orphan≡ Person  ∀hasParent.Dead Transitive(hasSibling)

Asymmetric(hasSibling)

This KB contains an class equivalence axiom that includes a universal restriction at the right hand side, and an object property that is at the same time transitive and asymmetric.

The following tables show the resulting output of an EL, QL and RL projections of the above KB, along with the deprecated and depreciated corresponding elements:

Projected EL Ontology πEL Deprecated → Depreciated List EL

Orphan Person Orphan≡ Person  ∀hasParent.Dead

→ Orphan Person

Transitive(hasSibling) Asymmetric(hasSibling)→ hasSibling

Universal restrictions in EL are depreciated to subsumption axioms based on the ar- ranged metamodel contents; the asymmetric property characteristic is not supported as well; it is thus deprecated (the object property is left without this characteristic).

Projected QL Ontology πQL Deprecated → Depreciated List QL Orphan≡ Person  ∀hasParent.Dead

Asymmetric(hasSibling) Transitive(hasSibling) → hasSibling

Universal restrictions are supported in QL right hand side axiom constructs. The transitive property characteristic is not supported and is thus deprecated (the object property is left without this characteristic).

Projected RL Ontology πRL Deprecated → Depreciated List RL Orphan ≡ Person  ∀hasParent.Dead

Asymmetric(hasSibling)

Transitive(hasSibling)

This KB is fully supported in RL, therefore its projection leaves it intact, and returns an empty list of deprecated/depreciated elements.