agents and knowledge interoperability in the semantic web era

Click here to load reader

Upload: zlata

Post on 25-Feb-2016

36 views

Category:

Documents


0 download

DESCRIPTION

Tutorial. Agents and Knowledge Interoperability in the Semantic Web Era. Nick Bassiliades Logic Programming & Intelligent Systems Group Dept . of Informatics Aristotle University of Thessaloniki Greece. Topic of the Tutorial. How Semantic Web affects: - PowerPoint PPT Presentation

TRANSCRIPT

Agents and Knowledge Interoperability in the Semantic Web Era

Nick BassiliadesLogic Programming & Intelligent Systems GroupDept. of InformaticsAristotle University of ThessalonikiGreeceAgents and Knowledge Interoperability in the Semantic Web Era

Tutorial

Topic of the TutorialHow Semantic Web affects:knowledge and information interchange reasoning interoperabilityamong intelligent agents in multi-agent systemsParts of the tutorial:Interaction between semantic web rules and ontologies Agents internal knowledge baseInteroperability between reasoning systems for agents Examples of actual implemented tools for semantic web reasoning in multi-agents systems. WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era2Tutorial OverviewRULES AND ONTOLOGIESHomogeneous approachEntailment-Based OWL ReasoningThe O-DEVICE SystemHybrid approachThe CLIPS-OWL FrameworkThe DLE FrameworkREASONING INTEROPERABILITYThe EMERALD FrameworkReasoning Services - ReasonersThe KC-AGENTS PrototypesUse Case: A Brokering ScenarioWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era3Tutorial OverviewRULES AND ONTOLOGIESHomogeneous approachEntailment-Based OWL ReasoningThe O-DEVICE SystemHybrid approachThe CLIPS-OWL FrameworkThe DLE FrameworkREASONING INTEROPERABILITYThe EMERALD FrameworkReasoning Services - ReasonersThe KC-AGENTS PrototypesUse Case: A Brokering ScenarioWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era4Rules and Ontologies in the SWIntroduction (1/3)Semantic Web (SW): vision of a universal medium for data and knowledge exchange. Current technologies offer data and knowledge interoperability: metadata RDF, ontologies - OWL 2Research shifts to higher layers: logic and proofsCritical for agents: infer new knowledge and explain actionsIncrease trust in the SWResearchers focusing mainly on integration of rules and ontologies OWL2 RL: Intersection of Horn logic and description logicsSWRL: Union of Horn logic and description logicsStandardization of rule representation: RuleML, RIFWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era5Rules and Ontologies in the SWIntroduction (2/3)RDF and OWL are subsets of predicate logicTrade-off between expressive power and computational complexityHorn logic is another subset of predicate logic with efficient proof systems a.k.a. rule systems, definite logic programsDescription logics and Horn logic are orthogonalBoth needed in expressing different kinds of knowledge in SWThey use different reasoning enginesPart 1 of tutorial discusses how SW rules and ontologies interact Agents internal KB for environment awareness and decision makingVarious ways of interaction, interoperation and integrationWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era6Rules and Ontologies in the SWIntroduction (3/3)Rules are important for the logic layer of SWExtensions or alternatives to DL based ontology languages Can be used to develop declarative systems on top of ontologiesThere is a lot of debate about the suitability of Logic Programming (LP) in the domain of the SWHowever, problems emerged during the development of practical OWL applications To overcome these, many research efforts focused on:the mapping of DLs into LP, oron the combination of DLs and LPWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era7Rules and Ontologies in the SWUsesQuerying: DL reasoning engines have low ABOX reasoning and querying performance.Combining DLs with the rule paradigm to state expressive instance queries provides increased performanceNon-monotonicity: DLs follow the principle of the open world assumption. Sometimes it is preferable to introduce non-monotonicity in DLse.g. negation as failureDLs expressivity: Rules can extend ontology languages.Integrity constraints: With rules we can define arbitrary integrity constraints over the ABOX. WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era8Mapping Ontologies into RulesSince DLs and Horn Logic are orthogonal, this means that not everything in DL can be expressed using rulesIn order to map ontologies into rules, a subset of OWL DL must be found, so that OWL constructs can be mapped to LPDLP (Description Logic Programs) and the OWL2 RL profile of OWL2 define the intersection of LP and DLLargest syntactic fragment of OWL DL that is implementable using rules. Simpler than OWL LiteEnables interaction between description logics and rulesWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era9OWL 2 RLOWL 2 is based on Description Logic. A fragment of first-order logicInherits the open-world assumption and non-unique-name assumption of Description LogicsOWL 2 RL is an interesting sublanguage of OWL 2 DL The largest fragment of OWL 2 on which the choice for CWA and UNA does not matterOWL 2 RL is weak enough so that the differences between the choices dont show up. Still large enough to enable useful representation and reasoning tasks.WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era1010Open-World Assumption (OWA)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era11We cannot conclude some statement x to be false simply because we cannot show x to be true. The opposite assumption (closed world, CWA) would allow deriving falsity from the inability to derive truth.OWL is strictly committed to the OWAIn some applications is not the right choiceExample in favor of OWAQuestion: Did it rain in Tokyo yesterday?Answer: I dont know that it rained, but thats not enough reason to conclude that it didnt rain.Example in favor of CWAQuestion: Was there a big earthquake disaster in Tokyo yesterday?Answer: I dont know, but if there had been such a disaster, Id have heard about it. Therefore I conclude that there wasnt such a disaster.11Unique-Name Assumption (UNA)When two individuals are known by different names, they are in fact different individuals. Sometimes works well and sometimes notIn favor: when two products in a catalog are known by different codes, they are differentAgainst: two people in our social environment initially known with different identifiers (e.g., Prof. van Harmelen and Frank) are sometimes the same personOWL does not make the unique-name assumptionIt is possible to explicitly assert of a set of identifiers that they are all unique using owl:allDifferentWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era1212OWL 2 RL AdvantagesThe semantics can be implemented using rule-based technologiesforward or backward chaining rule enginesThe reasoning is performed based on a predefined set of entailment rulesknown as OWL 2 RL/RDF rulesBenefitsScalable reasoning on a quite expressive subset of OWL 2Implemented by many state of the art large scale reasonersEven parallel implementations can be usedEnables the definition of rule-based applications on top of ontologiesWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era13Entailment RulesSimple if-then rules that assert new triples based on existing onescondition-triples conclusion-triplesConditions contain triple patterns with variablestriple patterns match existing triples (facts)Conclusions derive new triplesbased on the variable bindings in the conditionsSafe Rules: a variable in the conclusion should exist in the condition

WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era14OWL 2 RL constructsClass and property equivalenceEquality- inequality between individualsInverse, transitive, symmetric and functional propertiesIntersection of classesExcluded constructors: Union, existential quantification, and arbitrary cardinality constraintsIn general, it cannot infer new individuals not explicitly present in the KBWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era1515RDF constructsA triple (a, P, b) is expressed as a fact P(a, b)Instance declaration type(a, C)a is an instance of class Cexpressed as C(a)C is a subclass of D: C(X) D(X)Similarly for subproperty: P(X,Y) Q(X,Y)Domain and Range Restrictions C is the domain of property P: P(X, Y) C(X)C is the range of property P: P(X, Y) C(Y)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era1616OWL ConstructsequivalentClass(C, D) / pair of rulesC(X) D(X) / D(X) C(X)Similarly for equivalentProperty(P, Q)P(X,Y) Q(X,Y) / Q(X,Y) P(X,Y)Transitive Properties: P(X, Y), P(Y, Z) P(X, Z)Boolean operators. The intersection of C1 and C2 is a subclass of DC1(X), C2(X) D(X)C is a subclass of the intersection of D1 and D2C(X) D1(X)C(X) D2(X)The union of C1 and C2 is a subclass of D (not opposite)C1(X) D(X) / C2(X) D(X)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era1717OWL RestrictionsallValuesFrom(P, D)the anonymous class of all x such that y must be an instance of D whenever P(x, y)C subClassOf allValuesFrom(P, D) (not opposite)C(X), P(X, Y) D(Y)someValuesFrom(P, D) the anonymous class of all x for which there exists at least one y instance of D, such that P(x, y). someValuesFrom(P, D) subClassOf C (not opposite)P(X, Y), D(Y) C(X)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era1818Mapping Ontologies into RulesDisadvantagesThe mapping approaches result in languages with restricted expressiveness (semantics)Combination of DL and LP solve expressivity problemHomogeneous or hybrid approachWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era19Tutorial OverviewRULES AND ONTOLOGIESHomogeneous approachEntailment-Based OWL ReasoningThe O-DEVICE SystemHybrid approachThe CLIPS-OWL FrameworkThe DLE FrameworkREASONING INTEROPERABILITYThe EMERALD FrameworkReasoning Services - ReasonersThe KC-AGENTS PrototypesUse Case: A Brokering ScenarioWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era20Mapping Ontologies into RulesHomogeneous approachRule and ontology predicates are treated homogeneously, as a new single logic language. Rules can use:unary and binary predicates from the ontology (classes and properties)predicates that occur only in rules (rules predicates)To maintain decidability, the safety condition is neededRestricts variables occurring in the head of a rule to those that occur in at least one positive rule predicate in the body of the rule. WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era21Mapping Ontologies into RulesHomogeneous approachThe homogeneous approaches can be used either for building rule programs on top of ontologies or ontologies on top of rules. OWL semantics are mapped into a rule-based formalism that coexist in the KB with rule predicatesA new reasoner is needed, able to handle the new homogeneous languageThe mapping approaches can be considered as the first step for building a homogeneous systemWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era22Semantic Web Rule Language (SWRL)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era23W3C member submission rule languageExtends OWL/OWL 2 DL with first-order rules to overcome the limited expressivity of ontologiesFunction-free Horn logic, written in Datalog RuleML Allows class and property predicates to occur in the head and body of a ruleunrestricted combination of ontologies and rulesfollows the OWA and non-UNA but it is undecidableDL-safe rulesapply only on known individualshave limited expressivity but regain decidability

Rules in SWRLB1, ,Bn A1, , Amcommas denote conjunction on both sides of the arrowA1, , Am, B1, , Bn can be C(x), P(x, y), sameAs(x, y), differentFrom(x, y)C is an OWL class description, P is an OWL property, x, y are Datalog variables, OWL individuals, or OWL data values.If the head of a rule has more than one atom the rule can be transformed to an equivalent set of rules with one atom in the head conjunction of atoms without shared variablesA(X,Y) B(X), C(Y)A(X,Y) B(X) , A(X,Y) C(Y)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era2424Complexity of SWRL Arbitrary OWL expressions (e.g. restrictions), can appear in the head or body of a rule. This adds significant expressive power to OWL, but at the high price of undecidability There can be no inference engine that draws exactly the same conclusions as the SWRL semantics.SWRL vs. OWL 2 RLOWL 2 RL tries to combine the advantages of both languages in their common sublanguageSWRL takes a more maximalist approach and unites their respective expressivities.

WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era2525Example SWRL RulesReclassificationMan(?m) Person(?m) / subclassOf relation in OWL Person(?m) hasSex(?m, male) Man(?m)Possible in OWL hasValue (sufficient) restrictionNot all such reclassifications are possible in OWLProperty Value AssignmenthasParent(?x, ?y) hasBrother(?y, ?z) hasUncle(?x, ?z)Property chainingPossible in OWL 2 - Not possible in OWL 1.0 Person(?p) hasSibling(?p,?s) Man(?s) hasBrother(?p,?s)Not possible in OWLWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era2626Example SWRL Rules: Built-insBuilt-ins dramatically increase expressivity most rules are not expressible in OWL 1Some built-ins can be expressed in OWL 2

Person(?p) hasAge(?p, ?age) swrlb:greaterThan(?age, 17) Adult(?p)

Person(?p) hasSalaryInPounds(?p, ?pounds) swrlb:multiply(?dollars, ?pounds, 2.0) hasSalaryInDollars(?p, ?dollars)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era2727Tutorial OverviewRULES AND ONTOLOGIESHomogeneous approachEntailment-Based OWL ReasoningThe O-DEVICE SystemHybrid approachThe CLIPS-OWL FrameworkThe DLE FrameworkREASONING INTEROPERABILITYThe EMERALD FrameworkReasoning Services - ReasonersThe KC-AGENTS PrototypesUse Case: A Brokering ScenarioWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era28Entailment-Based OWL ReasoningThe EBOR paradigm enables the materialization of OWL semantics into the KB of a rule engine using OWL entailment (inference) rules. The EBOR paradigm is considered as a first step in realizing a homogeneous combination of OWL and rules Allows to build rule programs on top of ontologies, as well as ontologies on top of rule programsThe rule program coexists with the inference rules Rule execution is interleaved with the inference procedureWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era29

Architecture EBOR paradigmThe asserted knowledge (ontology), is mapped into an internal rule engine representation formatInference rules (OWL entailments), expressed in the language of the rule engine, are applied to deduce new knowledge, orcheck consistency of the ontology

Entailment rules have relatively low computational complexity consistency is in P entailment is NP-completeif there are not blank nodes in PWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era30Entailment Rules The semantics of the ontology can be (partially) captured using entailment rulesFor RDF and RDFS there is a complete set of entailmentshttp://www.w3.org/TR/rdf-mtExample: rdfs9 entailment rule (N-Triple notation)Defines the subsumption characteristic of the rdfs:subClassOf propertyif . . then .WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era31pD* Semantics There is no such a complete set of entailment rules for OWLThe pD* semantics is a weakened variant of OWL Full Realized by 23 entailment rules and 2 inconsistency rules. Inspired the OWL 2 RL profileExample: rdfp4 entailment Handles the values of transitive properties defined using the owl:TransitiveProperty OWL constructif . . . then .P(S, X), P(X, Z) P(S, Z)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era32EBOR System Development IssuesOntology mappingInferencing processQuery support

WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era33EBOR System Development IssuesOntology mappingAn EBOR system should define a mapping procedure of the ontological knowledge into the KB of the rule engineThis mapping is performed over the ontology triples. The purpose is to generate an internal, rule engine-specific representation of the ontological information where the entailment rules will be applied on.WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era34EBOR System Development IssuesInferencing processAn EBOR system should implement the desirable number of entailment rules expressed in the engines rule language. This defines the reasoning completeness of the EBOR system There are implementations of different expressiveness according to the number of implemented entailmentsWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era35EBOR System Development IssuesQuery supportAn EBOR system should be able to answer queries about the derivations of its KB. The query infrastructure is implemented with query rules. Query rules follow either the rule language of the rule engine, or they have a standard-based syntax.WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era36Approaches for developing EBOR systemsExtended approach (E-EBOR) An E-EBOR system is built on top of an existing, general purpose rule engine Augments it with the ability of manipulating ontological informationNeeds:To transform ontology into facts To populate rule base with the appropriate inference rulesNative approach (N-EBOR) A N-EBOR system is built from scratch Draws conclusions directly on the OWL data modelE.g. Jena2, Bossam, OWLIM, BaseVISorWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era37Advantages and DisadvantagesReasoning Performance A N-EBOR system is built directly on the OWL data model and it has increased reasoning performance (speed)An E-EBOR system does not apply any optimization in handling ontological informationOntology UtilizationAn E-EBOR system utilizes the ontology via rule-based applicationsUser-defined rules can operate over the inferred knowledgeAn N-EBOR system throws away established and efficient rule engines.User-defined rules are usually hard to be encodedWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era38Tutorial OverviewRULES AND ONTOLOGIESHomogeneous approachEntailment-Based OWL ReasoningThe O-DEVICE SystemHybrid approachThe CLIPS-OWL FrameworkThe DLE FrameworkREASONING INTEROPERABILITYThe EMERALD FrameworkReasoning Services - ReasonersThe KC-AGENTS PrototypesUse Case: A Brokering ScenarioWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era39The O-DEVICE SystemO-DEVICE is an EBOR systemBuilt on top of the CLIPS production rule engineIt transforms the ontology into the object-oriented model of the COOL language of CLIPS It applies entailment rules on the generated object-oriented schemapd* (in OWL 1), OWL 2 RL (in OWL 2)Entailment rules are implemented as production rulesConditions match objects, instead of RDF triplesActions insert or modify objects, instead of deriving axiomsWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era40CLIPS Production Rule Engine( a few words )A RETE-based production rule engineUtilizes 3 programming paradigmsrule programming, functional programming and object oriented programmingUtilizes 2 data/knowledge modeling paradigmsFact-basedordered and non-ordered (deftemplates) factsrules match factsObject-Orientedthe KB consists of classes with slots (attributes) and objects rules match objectsWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era41CLIPS Object-Oriented Language (COOL)Integrates the production rule paradigm with OO data/knowledge modelingKnowledge is represented in terms ofClasses (defclass)slots: single-field or multi-field (multislot) facets/constraints: describe various features of slotssingle/multiple inheritanceObjects (make-instance or definstances) WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era42Classes and slots: Basic syntax(defclass (is-a +)( *)*( *)*)

The name of the classA lists of its superclasses Definition of the slots of the class (slot, multislot)type, allowed-values, allowed-classes, . WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era43Class Examples(defclass Human(is-a USER)(slot age (type INTEGER)(range 1 100))(slot married (type STRING)(allowed-values yes no))(multislot hasParent(type INSTANCE-NAME)(allowed-classes Human)))(defclass Man(is-a Human))WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era44Instances: Basic Syntax(make-instance [] of [( )]*)

Every object has a name (inside square brackets)A single class as the direct class typeBased on the subclass hierarchy, objects inherit also the class types of the superclassesThe objects can use the slots inherited from the superclassesValues in slots may also be definedWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era45Instance Example(make-instance [george] of Man (age 28)(married no)(hasParent [Peter] [Mary]))WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era46Matching Objects in RulesCLIPS OO rules are defined by:A left hand side (LHS) that matches object patternsA right hand side (RHS) that contains actions to execute (possibly on objects)

(defrule rule-name (object-pattern-1) (object-pattern-2) ...=> (action-1) (action-2) ...)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era47Object Patterns: Basic Syntax ::= (object *) ::= (is-a ) | (name ) | ( *)The is-a constraint is used for specifying class constraintsThe name constraint is used for specifying a specific object on which to pattern-match Constraints are also used in slots/multislots in order to restrict certain type of values. A single-value variable is denoted as ?xA multivalue variable is denoted as $?xWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era48Rule Examplemark checked all adult men

(defrule test-rule(object (is-a Man)(name ?x)(age ?age) (checked no)) (test (> ?age 17))=> (modify-instance ?x (checked yes)))WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era49O-DEVICE ArchitectureWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era50O-DEVICE transformation procedure O-DEVICE loads into main memory OWL ontologies in the form of triples Then, it applies a set of transformation rules in order to generate an object-oriented schema of classes, attributes (slots) and objects. Triples transformed to a initial set of objectsInitial set of objects gradually transformed into the ontological OO modelBoth steps can be incremental

WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era51Transformation rules transitivesymmetricsubproperty inverseequivalentfunctional (and min cardinality)inverse functionaluniversal quantifiers skolem/existentialclassification

WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era52Basic Transformation SemanticsOWL concepts COOL classes (defclass C OWL properties class slots (defclass C (multislot p Properties are no longer first-class citizensOffers increased performance due to less joins (slot p (allowed-classes C))OWL individuals COOL objects (make-instance [a] of C)Class subsumption class inheritance (defclass C (is-a D))Generation of domain-dependent OO entailment rulese.g. for class intersection, symmetric properties, restriction classes .Offers increased performance due to less joinsWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era53Ontology Example (RDF/XML)

WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era54Ontology Example (N-Triples)t1: .t2: .t3: .t4: .t5: .t6: .t7: .t8: .t9: .WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era55Transformed Ontology in O-DEVICE(defclass Region(is-a owl:Thing)(multislot subRegionOf (type INSTANCE-NAME) (allowed-classes Region)))(make-instance [region1] of Region)(make-instance [region2] of Region subRegionOf [region1])(make-instance [region3] of Region subRegionOf [region2])WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era56Multiclass instances . .In OO languages an object can be an instance of a single class onlyO-DEVICE handles this by creating a subclass T of the two classes and defines x to be an instance of T(defclass T(is-a Class1 Class2))(make-instance [x] of T)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era57A-Box ReasoningThe reasoning procedure of O-DEVICE separates TBOX and ABOX reasoningT-Box reasoning uses static production rules A-Box reasoning follows a template-based methodologyDynamically generated domain-dependent entailment rules Match degree of expressiveness of the loaded ontologyWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era58O-DEVICE A-Box Entailment RulesProperty Transitivity (rdfp4)Domain independent template rule(defrule (object (is-a ) (name ?o1) ( $? ?o2 $?))=> (bind $?v1 (send ?o1 get-)) (bind $?v2 (send ?o2 get-)) (send ?o1 put- (union $?v1 $?v2))) Domain-dependent entailment rule(defrule subRegionOf (object (is-a Region) (name ?o1) (subRegionOf $? ?o2 $?))=> (bind $?v1 (send ?o1 get-subRegionOf)) (bind $?v2 (send ?o2 get-subRegionOf)) (send ?o1 put-subRegionOf (union $?v1 $?v2))) WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era59O-DEVICE Query LanguageQuerying through the deductive rule language of O-DEVICERule conclusions represent derived classesDerived objects are generated by evaluating rules over the current set of objectsEach deductive rule is implemented as a CLIPS production rule Creates a derived object when the condition of the deductive rule is satisfiedQuery example: retrieve the instances of the Region class that are subregions of region1(deductiverule region-instances ?id (DERIVED (result ?id)))The query will generate two objects of the DERIVED class OID, with the region2 and region3 instances in their result slot.WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era60Tutorial OverviewRULES AND ONTOLOGIESHomogeneous approachEntailment-Based OWL ReasoningThe O-DEVICE System (Related Systems: OWLJessKB, F-OWL)Hybrid approachThe CLIPS-OWL FrameworkThe DLE FrameworkREASONING INTEROPERABILITYThe EMERALD FrameworkReasoning Services - ReasonersThe KC-AGENTS PrototypesUse Case: A Brokering ScenarioWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era61OWLJessKBBuilt on top of JESSA production rule engine developed in JavaUnique features: backwards chaining, working memory queries, direct manipulation of Java objects.Functionality:Translation of OWL ontologies into RDF triples Transformation into JESS facts Application of the OWL entailment rules over these facts(deftemplate triple (slot predicate) (slot subject) (slot object))WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era62OWLJessKB Triple Facts - Example(triple (predicate "rdf:type") (subject "Region") (object "owl:Class"))(triple (predicate "rdf:type") (subject "subRegionOf") (object "owl:TransitiveProperty"))(triple (predicate "rdfs:domain") (subject "subRegionOf") (object "Region"))(triple (predicate "rdfs:range") (subject "subRegionOf") (object "Region"))(triple (predicate "rdf:type") (subject "region1") (object "Region"))(triple (predicate "rdf:type") (subject "region2") (object "Region"))(triple (predicate "rdf:type") (subject "region3") (object "Region"))(triple (predicate "subRegionOf") (subject "region2") (object "region1"))(triple (predicate "subRegionOf") (subject "region3") (object "region2"))WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era63OWLJessKB A-Box Entailment RulesProperty Transitivity (rdfp4)(defrule transitive-property (triple (predicate "rdf:type") (subject ?prop) (object "owl:TransitiveProperty")) (triple (predicate ?prop) (subject ?x) (object ?y)) (triple (predicate ?prop) (subject ?y) (object ?z))=> (assert (triple (predicate ?prop) (subject ?x) (object ?z))))Derivation:(triple (predicate "subRegionOf") (subject "region3") (object "region1"))WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era64OWLJessKB Query LanguageBased on the defquery construct of JESSA special kind of rule with no right-hand-side (RHS). A query is a pattern that is used to search the working memory and the matched facts are returned in a list. Example query:(defquery region-instances (triple (subject ?s) (predicate "rdf:type") (object "Region")) (triple (subject ?s) (predicate "subRegionOf") (object "region1")))The example query matches 2 sets of facts which can be retrieved using the OWLJessKB Java API. WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era65OWLJessKB Triple Facts - Example(triple (predicate "rdf:type") (subject "Region") (object "owl:Class"))(triple (predicate "rdf:type") (subject "subRegionOf") (object "owl:TransitiveProperty"))(triple (predicate "rdfs:domain") (subject "subRegionOf") (object "Region"))(triple (predicate "rdfs:range") (subject "subRegionOf") (object "Region"))(triple (predicate "rdf:type") (subject "region1") (object "Region"))(triple (predicate "rdf:type") (subject "region2") (object "Region"))(triple (predicate "rdf:type") (subject "region3") (object "Region"))(triple (predicate "subRegionOf") (subject "region2") (object "region1"))(triple (predicate "subRegionOf") (subject "region3") (object "region2"))(triple (predicate "subRegionOf") (subject "region3") (object "region1"))

WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era66F-OWLWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era67Built on top of Flora2 an implementation of F-Logic Makes use of XSB PrologTransforms ontology triples into F-logic Knowledge representation paradigm of framesF-Logic extends first-order logic with:Objects with complex internal structureClass hierarchies and inheritanceTyping, EncapsulationF-logic integrates logic programming with OO programming Natural candidate for an ontology language Direct support for OO concepts, frame-based syntax, extensive support for meta-programmingOntology conceptsF-logic supports definition of concepts and hierarchy A :: B (A is subclass of B)Example ontology: Region[subRegionOf *=>> Region]=>> symbol: a multivalue* symbol: inheritable instance attributeHierarchical relationships imply property inheritance and class membership transitivity.WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era68Ontology instancesDeclaration of the concept where instance belongs (: notation)Declaration of values in the corresponding properties. Example ontology:

region1:Region.region2:Region.region3:Region.region2[subRegionOf =>> region1].region3[subRegionOf =>> region2].WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era69F-OWL Transformation ProcedureF-OWL achieves a compact and human-friendly representation of the ontological information Ontology triples are mapped into Flora2 triple(s, p, o) facts A set of transformation rules generate F-logic codeExamples:Ontology triples transformed into Flora2 statementsS[P->>O] :- triple(S, P, O).Instance definitionsA:B :- A[rdf_type ->> B].WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era70F-OWL A-Box Entailment RulesProperty Transitivity (rdfp4)OWL semantics are implemented as Flora2 Prolog-like rules that operate over the generated KB.

S[P->>V] :- P[rdf_type->>owl_TransitiveProperty], S[P->>X], X[P->>V].

The following F-logic statement is inferred in the region ontologyregion3[subRegionOf =>> region1].WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era71F-OWL Query LanguageBoth schema and individual objects can be queried by putting variables in the appropriate positions in the Prolog-like rules. Example query:X : Region [subRegionOf ->> region1].WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era72Tutorial OverviewRULES AND ONTOLOGIESHomogeneous approachEntailment-Based OWL ReasoningThe O-DEVICE SystemHybrid approachThe CLIPS-OWL FrameworkThe DLE FrameworkREASONING INTEROPERABILITYThe EMERALD FrameworkReasoning Services - ReasonersThe KC-AGENTS PrototypesUse Case: A Brokering ScenarioWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era73Hybrid ApproachModular architecture of 2 subsystemsEach deals with a distinct portion of the KBCombination of Reasoning capabilities of a DL reasoner Rule execution capabilities of a rule engine in order to define rules on top of the ontological informationRule and ontology predicates are strictly separated Ontology predicates can be used as constraints in rules The hybrid approaches can be further classified into bidirectional and unidirectionalAccording to whether the derived knowledge flows from the rule module to the DL module or not. WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era74Bidirectional vs. UnidirectionalBidirectional hybrid approach:DL constraints can be used in the head of the rules The ontological knowledge is altered, allowing the development of ontologies on top of rulesUnidirectional hybrid approach:Information flows only from DL component to rule component Allows only rule predicates to be used in rule heads Ontological information remains unchangedCan be implemented as a one-time mapping of the results of the external OWL reasoner to the data model of the rule engine Rule engine can operate without calling further the ontology reasonerWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era75Tutorial OverviewRULES AND ONTOLOGIESHomogeneous approachEntailment-Based OWL ReasoningThe O-DEVICE SystemHybrid approachThe CLIPS-OWL FrameworkThe DLE FrameworkREASONING INTEROPERABILITYThe EMERALD FrameworkReasoning Services - ReasonersThe KC-AGENTS PrototypesUse Case: A Brokering ScenarioWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era76The CLIPS-OWL FrameworkCLIPSOWL is a unidirectional hybrid approachRepresents the extensional results of DL reasoning on OWL ontologies as OO models in CLIPSCLIPS uses these OO models as static query models Motivation: Answer extensional ontology queries using RETE Develop production rule programs, without runtime interfacing an external DL reasonerAny CLIPS-based application may enhance its functionality by incorporating ontological knowledge without modifying the architecture of the CLIPS rule engineCurrent implementation uses Pellet DL reasonerWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era77CLIPS-OWL ArchitectureWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era78CLIPS-OWL vs. O-DEVICEThe object-oriented data model of CLIPSOWL is exactly the same as that of O-DEVICE The reasoning process is different O-DEVICE uses a rule-based ontology reasonerIt is incompleteCLIPS-OWL uses a DL-reasonerIt is completeCLIPS-OWL is better when a one-time transformation is neededSpeed (especially of A-Box) reasoning is not importantO-DEVICE is better when ontology is updated continuouslyRule-based incremental reasoningA-Box reasoning is fasterWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era79CLIPS-OWL vs. DL-ReasonersWhy not using the rule facilities of an existing DL-Reasoner, to build rule programs on top of ontologies?CLIPS-OWL intention is NOT to substitute DL-ReasonersMain intention is to extend CLIPS (a popular rule engine) with the ability to use ontologies for rule-based applicationsWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era80Advantages of one-time mappingThe complete ontological knowledge is accessible by rulesStraightforward development of rule-based applications that use ontological knowledgeA continuous interaction between the RETE-based rule engine and the DL-reasoner would require a great amount of changes to RETE, with unpredictable resultsOntology changes should be propagated to the RETE structure incrementallyIf rules just read the ontology and dont change it, then this is an unnecessary complicationCLIPSOWL has been successfully used to develop an expert system in the domain of software engineeringSoftware AntiPatterns - software project management knowledgeWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era81Tutorial OverviewRULES AND ONTOLOGIESHomogeneous approachEntailment-Based OWL ReasoningThe O-DEVICE SystemHybrid approachThe CLIPS-OWL FrameworkThe DLE FrameworkREASONING INTEROPERABILITYThe EMERALD FrameworkReasoning Services - ReasonersThe KC-AGENTS PrototypesUse Case: A Brokering ScenarioWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era82The DLE FrameworkIn many practical applications:TBox is not (or rarely) modified by applications at run-timeABox is continuously modified or enriched with new individualsNeed for scalable implementationsDL reasoners do not scale-up well (exponential complexity). The DLE framework combines:completeness of DL reasoners for TBox reasoning low complexity of a production rule engine for ABox reasoningWIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era83Benefits and Pitfalls of EBOR(e.g. O-DEVICE)Reasoning IncompletenessIncomplete set of (TBox/ABox) entailmentsHandles a subset of OWLThe reuse of general-purpose rule engines The ability to handle large extensional knowledge (ABox)WIMS 2012, June 13-15, Craiova, RomaniaNick Bassiliades, Agents and Knowledge Interoperability in the Semantic Web Era8484DLE FrameworkDisengage the TBox EBOR procedure from any TBox entailment implementationIt can be done seamlessly and efficiently by DL reasonersExample:if