International Journal of Web & Semantic Technology (IJWest) Vol.1, Num.4, October 2010 Inheritance-Edge : An inheritance-edge eij ∈ E from vi to vj , where vi, vj ∈ V , if vj **is a sub class**
of vi.

Property-Edge : An property-edge eij ∈ E from vi to vj , where vi, vj ∈ V , if vj **is an object property**
of vi.

## 4 Overview Of The Method

In this section we present the relevant formalisms and present the **overall algorithm for solving the**
problem. The variable set and the class set specified in the query q are denoted by Sv(q**) and** Sc(q)
respectively. We present a graph search based structural matching algorithm to check the semantic safety of the protocol.

Definition 2. The specialization sequence σ = hc1.c2. · · · .cki in a query q **is the sequence of classes**
that are concatenated through the '.' operator, and for any two consecutive classes ci and ci+1 **in the** sequence, ci is the super class of ci+1. Therefore the elements of Sc(q) **can be individual classes or**
specification sequences.

## 4.1 Structural Algorithm To Check The Semantic Consistency

Algorithm 1: **Check-Consistency**
input : The Protocol P **and the Server Ontology** Os 1 V **← {}**;
2 foreach query q **in the protocol** P do 3 foreach **element** τ in Sc(q) do 4 if τ is a specialization sequence **then**
5 c1 ← **the first concept of** τ ; 6 ct ← **FindMatch(**Os, c1);
7 for i ← 2 to **length**(τ ) do 8 cm ← the i th **concept of** τ ;
9 if **any class** c
′

t equivalent to cm is not found as a sub class of ct in Os **then**
10 **Report Mismatch at** cm; 11 **else**
12 ct ← c
′

t 13 end 14 end 15 V ← V ∪ **property set for** ct; 16 **else**
/* c is an individual class */
17 c1 ← τ ;
18 ct ← **FindMatch(**Os, c1);
19 V ← V ∪ **property set for** ct; 20 end 21 end 22 if Sv(q) ( V **then**
23 Report {Sv(q) − V } **as unmatched variables;**
24 end 25 end