R
N.
F
L
:=Extractlengthofthefield (R
n
)R
N.
F
Nl
:=ExtractBoolean (R
n
)// (0 nullable /1 not nullable)R
N.
F
D
:=ExtractFieldDefalutValue (R
n
)End ForR
N
.R
PK
:=ExtractPrimaryKeys (R
n
)R
N
.R
FK
:= ExtractForeignKeys(R
n
)R
N
.R
U
:= ExtractUniqueKeys(r)End ForFor each set of relations (R, R’) Create element RS for storingthe prosperities of the relationships between R and R’.RS.R
PK
(R):= ExtractPrimaryKey (R)RS.R:= ExtractRlation (R)RS.R
FK
(R):= ExtractForeignKey(R’)RS.R:= ExtractRlation (R’)End ForMTRDB: = MTRDB+ R // add the relation R to MTRDBReturn MTRDBEnd algorithm
B.
Generating CDM from MTDATA
The next step is to define the CDM based on a classification of relations, fields and relationships, which may be performedthrough data access.The CDM model is based on three concepts: class, attributeand relationship. Attributes define class structure, whereasrelationships define a set of relationship types. CDM classesare connected through relationships.CDM Class is defined as a set of classes, is denoted as 3-tuplewhere the first element is the name of the CDM class, thesecond element is a list of attributes and the latest element isthe relationships between classes:
{
R A N
C C C C C ClassCDM
,,(::
==−
N
C
is the name of the class C,
A
C
is the list of attributesassociated with this particular class:
{
d lt n A
A A A A A AC
,,,(::
==
Where
n
A
is an attribute name,
t
A
is its type,
l
A
is thelength of this attribute and
d
A
is a default value if given.
R
C
describes the different types of relations that can existbetween any pair of classes in the CDM.
{ }
),,Re,Re:
Cd CslC lN C
R
=
Where
lN
Re
is the name of the relationship between thesource class
Cs
and the destination class
Cd
and
lC
Re
isthe Cardinality source of the class
Cs
, is represented bymin..max notation.
C.
OWL Structure1)
definition of OWL structure.
When the CDM has been obtained, the schema translationphase is started. Then, an appropriate set of rules is used tomap the CDM constructs into OWL classes and createelements for storing OWL dataA class in OWL defines a group of individuals that belongtogether because they share some properties. Every individualin the OWL world is a member of the class owl:Thing. Thuseach user-defined class is implicitly a subclass of owl:Thing.Each class in CDM is translated to owl:class in the Webontology, our class in OWL technology is represented asfollows:
> / "CClass="ID:rdf Class:owl<
N
∈
Each attribute A is translated into a owl:DatatypePropertyclass and represented as :
><>∈=<
>∈=<
>∈=<
opertyDatatypePr: /owl
/ "AType"&xsd,resource:rdf range:rdfs
/ Class"-CC#"resource:rdf domain:rdfs
"CA"ID:rdf opertyDataTypePr:owl
tA
DM
The relationship between two classes C1 and C2, therepresentation of the relationship in Web ontology isrepresented as follows:
><>∈=<
>∈=<
>∈=<
ertyObjectProp: /owl
/ Class"-CC#"resource:rdf range:rdfs
/ Class"-C#"resource:rdf domain:rdfs
"CRelN"ID:rdf ertyObjectProp:owl
21
DM CDM
R
The cardinalities of a relationship are given by specifyingminimum and maximum cardinalities.For mapping the general cardinality we use:<owl:Cardinality rdf:datatype=”&xsd,nonNegativeInteger”>Cardinality
ϵ
RelC</ owl:Cardinality>
And for mapping the maximal cardinality of each relationshipwe use this syntax:<owl:maxCardinalityrdf:datatype=”&xsd,nonNegativeInteger”> Cardinality
ϵ
RelC</ owl:maxCardinality>
2)
Algorithm for Mapping CDM into OWL
Given a CDM Model as input, the algorithm goes through amain loop to classify CDM constructs and generate theirequivalents in OWL.The pseudo code of the mapping process is depicted in thisAlgorithm:
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 10, No. 1, January 201244http://sites.google.com/site/ijcsis/ISSN 1947-5500