Rule Querying for Semantic Web and Its Evaluation

wafflebazaarInternet και Εφαρμογές Web

21 Οκτ 2013 (πριν από 3 χρόνια και 7 μήνες)

75 εμφανίσεις

UniversityofAizu,GraduationThesis.March,2006
s1100165 1
Rule Querying for Semantic Web and Its Evaluation
Kenji Nishino s1100165
Supervised by
Prof.Incheon Paik
Abstract
The Web is convenient and an indispensable element in
our everyday lives;however,the current Web is designed
for human reasoning about information on the Web be-
cause computers do not possess knowledge.The Seman-
tic Web has been developed to solve this problem.It pro-
vides knowledge through Ontology and Rules that are
represented in SWRL (Semantic Web Rule Language).
At present,Ontology query language had been studied,
but Rule query language is being developed.Therefore,
we cannot get knowledge from computers.In this re-
search project,we designed and evaluated SWRL-QL
(Semantic Web Rule Language Query).
1 Introduction
The Web has evolved as a huge database for various
kinds of information with semantics.It has evolved as
the second wave,and is called the Semantic Web.
The concept of Semantic Web is available to deal
with meaning (semantics) for computers on the Web.
Many researchers have studied the Semantic Web.Se-
mantic Web is constituted of nine layers of technology:
URI/Unicode,XML/Namespace,RDF Model and Syn-
tax,RDF Schema,Ontology,Rules,Logic,Proof,and
Trust.The layers from URI/Unicode to Ontology have
been developed at a concrete level,but from the Rules
layer above this has not been done.
If we want knowledge information from computers,
both rules and ontology are required.Ontology provides
the declarative knowledge or facts while rules provide
the procedures that operate on the facts.Hence,we need
a method to link the two layers.One of the Rule repre-
sentations is SWRL (Semantic Web Rule Language) [1]
which is going to be standardized.It is combined with
OWL [2] (Web Ontology Language),which is the de-
scription language of Ontology,and RuleML [3],which
is the description language of Rule.Several query lan-
guages are necessary as the Semantic Web technology
develops,because query for ontology and rule is the most
fundamental need in all Semantic Web entities.We are
able to query Ontology using OWL-QL (OWL Query
Language) [4],which allows us to get vocabulary in-
formation for computers.However,OWL-QL is able to
query only Ontology and it cannot query Rule.Conse-
quently,we are not able to obtain procedures fromcom-
puters using OWL-QL and we need a query language to
deal with rules.
In this paper,we design SWRL-QL (Semantic Web
Rule Language Query) [5] that used RuleML [3] and
OWL files,but not SWRL files.Therefore,we improve
this systemto use SWRL,and compare the performance
of this systemwith the existing chaining system.In sec-
tion 2,we review Semantic Web technology.In section
3,we describe SWRLQuery Engine,and we implement
the system in section 4.Section 5 describe the experi-
ment,and we evaluate this system in section 6.Finally,
in section 7,we conclude and consider future works.
2 Semantic Web
The Semantic Web aims to provide information that can
be used not only by humans but also by machines.Most
of the existing Web information is represented by natural
language,which is easily understood by humans but not
by machines.For example,if you search for a wine that
goes well with seafood,the existing Web gives informa-
tion about wine,but we cannot search for a wine that
goes well with seafood.However Semantic Web gives
an appropriate answer,because SemanticWeb can under-
stand the meanings of wine,goes well and seafood.The
architecture of a semantic web is shown in Figure 1.
URI Unicode
XML
Namespace
RDF Model & Syntax
RDF Schema
Ontology
Rules
Logic Framework
Proof
Trust
S
i
g
n
a
t
u
r
e
E
n
c
r
y
p
t
i
o
n
Figure 1:Semantic Web Architecture
2.1 RDF Model and Syntax
The Resource Description Framework (RDF) is a
general-purpose language for representing information
in the Semantic Web.RDF inherits XML-based syn-
UniversityofAizu,GraduationThesis.March,2006
s1100165 2
tax.RDF provides a data model which is a collection
of triples,each consisting of a subject,a predicate and
an object,as shown in Figure 2.
Subject
Object
Predicate
Figure 2:RDF Graph
2.2 RDF Schema
RDF Schema (RDFS) defines the RDF vocabulary such
as classes,properties,types,ranges,and domains.
2.3 Ontology
RDFS provides the fundamental representation of the
relation between idea and resource,but their represen-
tation power is not enough.Ontology defines knowl-
edge.Ontology is represented by Web Ontology Lan-
guage (OWL) that can be used to describe the classes and
the relations between themthat are inherent in Web doc-
uments and applications.OWL provides three increas-
ingly expressive sub-languages designed for use by spe-
cific communities of implementers and users.OWL Lite
supports users who primarily need a classification hier-
archy and simple constraints.OWL DL supports users
who want the maximum expressiveness while retaining
computational completeness and decidability.
2.4 Rules
Rules are represented by Semantic Web Rule Language
(SWRL),which is based on OWL and the Rule Markup
Language (RuleML),which is a framework aimed at in-
tegrating different rule systems and applications.
3 SWRLQuery Engine
3.1 SystemArchitecture
The architecture of SWRLQuery is shown in Figure 3.
1.The user sends a query to the SWRLQuery system,
which is then sent to the Rule Inference Engine
2.The Rule Inference Engine reads the SWRL files
3.The SWRL files are sent to the SWRL Divider
4.The SWRL Divider reads the SWRL files and di-
vides theminto RuleML files,which it sends to the
Rule Inference Engine,and OWL files,which are
sent to the Ontology Query Engine
5.The Rule Inference Engine starts reasoning using
backward chaining.If the Rule Inference Engine
needs Ontology,it requests the information from
the Ontology Query Engine
6.The Ontology Query Engine sends Ontology infor-
mation to the Rule Inference Engine
7.The Rule Inference Engine returns the result to the
user
SWRL file
SWRL
Divider
Rule Inference Engine
Ontology Query Engine
RuleML file
owl file
User
input
Result
1
7
5
6
4
4
3
read
2
Figure 3:SWRLQuery Architecture
3.1.1 Rule Inference Engine
The Rule Inference Engine has two processes.First,
Rule Inference Engine gets RuleML from SWRL Di-
vider and parses RuleML,and uses reasoning.Second,if
the Rule Inference Engine does not understand the user
request,it queries the Ontology Query Engine.
3.1.2 Ontology Query Engine
First,the Ontology Query Engine parses OWL files.
Then,the Ontology Query Engine receives a query from
the Rule Inference Engine.If the Ontology Query En-
gine finds Ontology,it returns Ontology,but if it does
not find Ontology,it reports Not found.
3.2 Query example
Suppose the user wants to know whether his wine goes
well with nuts and cheese.This time,we use rules that
are represented using First Order Logic (FOL) described
as follows.
The user query is “GoesWellNutsAndCheese(User’s
Wine)”.The Rule Inference Engine finds that the con-
sequent in a Rule matches GoesWellNutsAndCheese(x).
UniversityofAizu,GraduationThesis.March,2006
s1100165 3
The Rule Inference Engine looks at the antecedent cor-
responding to GoesWellNutsAndCheese(x),which is
CourseCheeseNutsDessert(x).Equally,the Rule In-
ference Engine searches the antecedent corresponding
to CourseCheeseNutsDessert(x),which is hasSugar(x,
sweet),GetColor(x,red),hasBody(x,full),and hasFla-
vor(x,strong).If the Rule Inference Engine searches
these consequents but it cannot find them in Rule,the
Rule Inference Engine requests the Ontology Query En-
gine about User’s wine ontology.The Ontology Query
Engine looks at User’s Wine,which has these spe-
cialties:hasSugar(sweet),GetColor(red),hasBody(full),
and hasFlavor(strong).The Ontology Query Engine
sends this information to the Rule Inference Engine.
Rule Inference Engine gets this information and uses
it to check CourseCheeseNutsDessert(User’s Wine).
When CourseCheeseNutsDessert(User’s Wine) is satis-
fied,GoesWellNutsAndCheese(User’s Wine) is also sat-
isfied.Therefore,the Rule Inference Engine returns
GoesWellNutsAndCheese(User’s Wine) as true for the
user.
4 Implementation
SWRL files are parsed using XSLT (XSL Transforma-
tions) and transformed into RuleML and OWL files.
RuleML files are parsed using jDREW (a Java Deduc-
tive Reasoning Engine for the Web) [8].It transforms
RuleMLto Prolog format.Rule Inference Engine is writ-
ten in Java,which supports backward chaining.It re-
ceives the files in Prolog format,and reasons using it.
The Ontology Query Engine uses the Java Expert Sys-
temShell (JESS) [9].
5 Experiment
5.1 Environment
In this experiment,the following environment was uti-
lized.The Rule Engine was developed using JDK ver-
sion 1.4.08.The Ontology Engine was developed JESS
6.1.The Operating Systemwas Windows XP.
5.2 Method
An experiment regarding two different implementations
was performed to evaluate the performance of the sys-
tem.This experiment was performed under the follow-
ing conditions:
Using our algorithmsystem
• the case of using cache
• the case of not using cache
Using JESS system
• the case of using cache
• the case of not using cache
The user query was “Japanese wine goes well with nuts
and cheese”.There were 15 instances of wine.
6 Evaluation
Figures 4 - 7 show the experimental results under the
four conditions.The x-axis shows the number of users
and the y-axis the time taken.The lowest time is the
case of the JESS systemusing cache (Figure 7) whereas
the longest time is for the JESS system not using cache
(Figure 6);the SWRLQuery system for both the case of
using (Figure 5) and not using cache (Figure 4) fall be-
tween the two JESS cases.
From Figures 6 and 7,it can be seen that using the
cache has a major effect on the time taken.In the case of
using cache (Figures 5 and 7),all users share the system
whereas in the case of not using cache (Figures 4 and
6) all users are provided with this system.For the using
cache case,the system is already initialized,but in the
case of not using cache the system has to be initialized
each time.
In the case of the SWRLQuery system,the time for
SWRL to RuleML transformation using XSLT is 50 -
300 milliseconds (for each number of rules).SWRL to
OWL transformation time using XSLT is 400 - 1000 mil-
liseconds (for each number of rules).The experiment in
SWRLQuery systemincludes these times.
This experiment shows that when the user wants
knowledge that is commonly known,the cache can be
used and the JESS system works fast;however,in the
case of less frequently known knowledge (such as in a
Semantic Web),the cache cannot be used.In this case,
the SWRLQuery system (Figure 4) better than the JESS
system(Figure 6).
7 Conclusion and Future Works
In this research,SWRL-QL was designed and imple-
mented,and its performance was evaluated based on
time in several rule numbers and users.In this exper-
iment,the system was not very practical but it can get
knowledge fromcomputers.
In the future,it will be necessary to research ontol-
ogy query and rule inference algorithm for system per-
formance,and deal with various knowledge (combine
various SWRL) on the Web.
UniversityofAizu,GraduationThesis.March,2006
s1100165 4
0
10000
20000
30000
40000
50000
60000
70000
0
5
10
15
20
25
30
35
40
45
50
Time (ms)
Number of Users
3 Rules
20 Rules
40 Rules
85 Rules
Figure 4:SWRL Query systemnot using cache
0
10000
20000
30000
40000
50000
60000
0
5
10
15
20
25
30
35
40
45
50
Time (ms)
Number of Users
3 Rules
20 Rules
40 Rules
85 Rules
Figure 5:SWRL Query systemusing cache
0
100000
200000
300000
400000
500000
600000
700000
800000
900000
1e+06
0
5
10
15
20
25
30
35
40
45
50
Time (ms)
Number of Users
3 Rules
20 Rules
40 Rules
85 Rules
Figure 6:Jess systemnot using cache
0
5000
10000
15000
20000
25000
30000
0
5
10
15
20
25
30
35
40
45
50
Time (ms)
Number of Users
3 Rules
20 Rules
40 Rules
85 Rules
Figure 7:Jess systemusing cache
Acknowledgments
I would like to express my thanks to my supervisor Prof.
Paik for his attentive instruction in this thesis.I would
also like to thanks Prof.Gupta for her helpful advice on
draft of this thesis.
References
[1] Ian Horrocks,Peter F.Patel-Schneider,Harold
Boley,Said Tabet,Benjamin Grosof,and Mike
Dean,“A Semantic Web Rule Language Combin-
ing OWL and RuleML” http://www.daml.org/
rules/proposal/2004
[2] Michael K.Smith,Chris Welty,and Deborah L.
McGuinness,“OWL Web Ontology Language
Guide” http://www.w3.org/TR/owl-guide/
2004
[3] David Hirtle,Harold Boley,Benjamin Grosof,
Michael Kifer,Michael Sintek,Said Tabet,and
Gerd Wagner “Schema Specification of RuleML
0.9” http://www.ruleml.org/0.9/
[4] OWL-QL Project for the Stanford Knowledge
Systems Laboratory http://ksl.stanford.edu/
projects/owl-ql/
[5] Yuuki Ooishi,Ontology Querying System with Pro-
cess of Rules on Semantic Web.Master’s Thesis,
University of Aizu,2005.
[6] Ernest J.Friedman-Hill,“Jess,The Rule Engine
for the Java Platform” http://herzberg.ca.
sandia.gov/jess/docs/61/
[7] Dan Brickley,and R.V.Guha “RDF Vocabulary De-
scription Language 1.0:RDF Schema” http://
www.w3.org/TR/rdf-schema/2004
UniversityofAizu,GraduationThesis.March,2006
s1100165 5
[8] jDREW:A Java Deductive Reasoning Engine for
the Web http://www.jdrew.org/jDREWebsite/
jDREW.html
[9] Fabien L.Gandon,and Norman M.Sadeh “OWL
inference engine using XSLT and JESS” Mo-
bile Commerce Laboratory,School of Com-
puter Science,Carnegie Mellon University
http://mycampus.sadehlab.cs.cmu.edu/
public_pages/OWLEngine.html2003
Appendix A
Part of Ontology example in SWRL
<owl:Class rdf:ID="Wine">
<rdfs:subClassOf rdf:resource="&food;PotableLiquid"/>
<owl:Restriction>
<owl:onProperty rdf:resourse="#MadeIn"/>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resourse="#GetPrice"/>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resourse="#hasSugar"/>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resourse="#GetColor"/>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resourse="#hasBody"/>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resourse="#hasFlavor"/>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
</owl:Class>
<!-- Wine Instance-->
<Wine rdf:ID="JapaneseWine11">
<wine:MadeIn rdf:datatype="xsd:string">Japan</wine:MadeIn>
<wine:GetPrice rdf:datatype="xsd:nonNegativeInteger">120</wine:GetPrice>
<wine:hasSugar rdf:datatype="xsd:string">Sweet</wine:hasSugar>
<wine:GetColor rdf:datatype="xsd:string">Red</wine:GetColor>
<wine:hasBody rdf:datatype="xsd:string">Full</wine:hasBody>
<wine:hasFlavor rdf:datatype="xsd:string">Strong</wine:hasFlavor>
</Wine>
Appendix B
Part of Rule example in SWRL
<swrl:Imp rdf:ID="GoesWellNutsAndCheese">
<swrl:head>
<swrl:ClassAtom>
<swrl:classPredicate rdf:resource="#GoesWellNutsAndCheese"/>
<swrl:argument1 rdf:resource="#x"/>
</swrl:ClassAtom>
</swrl:head>
<swrl:body>
<swrl:ClassAtom>
<swrl:classPredicate rdf:resource="#CourseCheeseNutsDessert"/>
<swrl:argument1 rdf:resource="#x"/>
</swrl:ClassAtom>
</swrl:body>
</swrl:Imp>
<swrl:Imp rdf:ID="CourseCheeseNutsDessert">
<swrl:head>
<swrl:ClassAtom>
<swrl:classPredicate rdf:resource="#CourseCheeseNutsDessert"/>
<swrl:argument1 rdf:resource="#x"/>
</swrl:ClassAtom>
</swrl:head>
<swrl:body rdf:parseType="Collection">
<swrl:IndividualPropertyAtom>
<swrl:propertyPredicate rdf:resource="#hasSugar"/>
<swrl:argument1 rdf:resource="#x"/>
<swrl:argument2 swrlb:matches="#Sweet"/>
</swrl:IndividualPropertyAtom>
<swrl:IndividualPropertyAtom>
<swrl:propertyPredicate rdf:resource="#GetColor"/>
<swrl:argument1 rdf:resource="#x"/>
<swrl:argument2 swrlb:matches="#Red"/>
</swrl:IndividualPropertyAtom>
<swrl:IndividualPropertyAtom>
<swrl:propertyPredicate rdf:resource="#hasBody"/>
<swrl:argument1 rdf:resource="#x"/>
<swrl:argument2 swrlb:matches="#Full"/>
</swrl:IndividualPropertyAtom>
<swrl:IndividualPropertyAtom>
<swrl:propertyPredicate rdf:resource="#hasFlavor"/>
<swrl:argument1 rdf:resource="#x"/>
<swrl:argument2 swrlb:matches="#Strong"/>
</swrl:IndividualPropertyAtom>
</swrl:body>
</swrl:Imp>
UniversityofAizu,GraduationThesis.March,2006
s1100165 6
Appendix C
SWRLQuery example
[Query]: GoesWellNutsAndCheese(JapaneseWine11)
Reasoning Start
[->]: CourseCheeseNutsDessert(JapaneseWine11)
[->]: hasSugar(JapaneseWine11)
[Ontology Query]: hasSugar, JapaneseWine11, ?x
[Ontology Answer]: ?x = Sweet
[<-]: hasSugar(JapaneseWine11) ... true
[->]: GetColor(JapaneseWine11)
[Ontology Query]: GetColor, JapaneseWine11, ?x
[Ontology Answer]: ?x = Red
[<-]: GetColor(JapaneseWine11) ... true
[->]: hasBody(JapaneseWine11)
[Ontology Query]: hasBody, JapaneseWine11, ?x
[Ontology Answer]: ?x = Full
[<-]: hasBody(JapaneseWine11) ... true
[->]: hasFlavor(JapaneseWine11)
[Ontology Query]: hasFlavor, JapaneseWine11, ?x
[Ontology Answer]: ?x = Strong
[<-]: hasFlavor(JapaneseWine11) ... true
[<-]: CourseCheeseNutsDessert(JapaneseWine11) ... true
[<-]: GoesWellNutsAndCheese(JapaneseWine11) ... true
[Answer]: Yes