Of 35 lecture 17: semantic web rules. of 35 ece 627, winter ‘132 logic importance - high-level language for expressing knowledge - high expressive power

Embed Size (px)

DESCRIPTION

of 35 ece 627, winter ‘133 logic importance (2) - proof systems for which semantic logical consequence coincides with syntactic derivation within the proof system soundness & completeness - predicate logic is unique in the sense that sound and complete proof systems do exist not the case for more expressive logics (higher-order logics)

Citation preview

of 35 lecture 17: semantic web rules of 35 ece 627, winter 132 logic importance - high-level language for expressing knowledge - high expressive power - well-understood formal semantics - precise notion of logical consequence - systems that can automatically derive statements syntactically from a set of premises of 35 ece 627, winter 133 logic importance (2) - proof systems for which semantic logical consequence coincides with syntactic derivation within the proof system soundness & completeness - predicate logic is unique in the sense that sound and complete proof systems do exist not the case for more expressive logics (higher-order logics) of 35 ece 627, winter 134 logic importance (3) - trace the proof that leads to a logical consequence - logic can provide explanations for answers by tracing a proof of 35 ece 627, winter 135 specializations of logic RDF and OWL - RDF/S and OWL (Lite and DL) are specializations of predicate logic they correspond (roughly) to a description logic - they define reasonable subsets of logic - trade-off between the expressive power and the computational complexity (the more expressive the language, the less efficient the corresponding proof systems) of 35 ece 627, winter 136 specializations of logic Horn logic a rule has the form: A1,..., An B - Ai and B are atomic formulas of 35 ece 627, winter 137 specializations of logic Horn logic there are two ways of reading such a rule - deductive if A1,..., An are known to be true, then B is also true - reactive if the conditions A1,..., An are true, then carry out the action B of 35 ece 627, winter 138 logic: description vs Horn OWL vs rules it is impossible to assert that a person X who is brother of Y is uncle of Z (where Z is child of Y) in OWL this can be done easily using rules: brother(X,Y), childOf(Z,Y) uncle(X,Z) of 35 ece 627, winter 139 logic: description vs Horn OWL vs rules (2) rules cannot assert the information that a person is either a man or a woman this information is easily expressed in OWL using disjoint union OWL needs rules !!! of 35 ece 627, winter 1310 rule languages rule languages define how to synthesize new facts form those stored in the knowledge base - rule markup language RuleML - semantic web rule language - SWRL of 35 ece 627, winter 1311 rule markup language RuleML - effort to standardize inference rules - RuleML is a markup language for publishing and sharing rule bases on the World Wide Web - focus is on rule interoperation between industry standards - provides an XML syntax for Datalog clauses of 35 ece 627, winter 1312 rule markup language Datalog its alphabet is a set of predicate symbols, constants, and variables atom is an expression of the form P(t1, t2, , tn), where P is an n-ary predicate symbol and t1, , tn are terms term is a variable or constant of 35 ece 627, winter 1313 rule markup language Datalog examples (1):book(Semantic Web, U.K., 2007) (2):book(title, counry, 2005) of 35 ece 627, winter 1314 rule markup language Datalog clause clause is either a fact or a rule fact is an expression of the form B where B is a variable-free atom rule is an expression of the form A1, , Am C where A1, , Am atoms are called antecedents, C atom is called the consequent or head of 35 ece 627, winter 1315 rule markup language Datalog example (3):book(x, U.K., y) UKbook(x) of 35 ece 627, winter 1316 rule markup language RuleML example (1) book(Semantic Web, U.K., 2007) book Semantic Web U.K. 2007 of 35 ece 627, winter 1317 rule markup language RuleML example (2) book(tilte, country, 2005) book title country 2007 of 35 ece 627, winter 1318 rule markup language RuleML example (3) book(x, U.K., y) UKbook(x) UKbook x of 35 ece 627, winter 1319 rule markup language RuleML example (3) continuation book x U.K. y of 35 ece 627, winter 1320 SWRL - SWRL is an acronym for Semantic Web Rule Language - SWRL is intended to be the rule language of the Semantic Web - SWRL is based on OWL: all rules are expressed in terms of OWL concepts (classes, properties, individuals, literals...). of 35 ece 627, winter 1321 SWRL atoms (predicates) C(x)C is an OWL class P(x,y)P is an OWL predicate sameAs(x,y)sameAs belongs to the OWL differentFrom(x,y)differentFrom belongs to the OWL vocabulary builtIn(r,x,)r is a built-in relation x,y are either variables, individuals, or data values of 35 ece 627, winter 1322 SWRL example (1) from Datalog book(Semantic Web, U.K., 2007) 1. Book(B) 2. title(B,Semantic Web) 3. countryOfPub(B,U.K) 4. yearOfPub(B,2007) of 35 ece 627, winter 1323 SWRL atoms (predicates) differences to Datalog - atoms are only unary or binary predicates (no restrictions in RuleML) - OWL class descriptions can be viewed as unary predicates (nothing like that in RuleML) of 35 ece 627, winter 1324 SWRL atoms (predicates) 1 C(x)C is an OWL class holds iff x is an individual of the class description or data range C Person(John) Person(?x) of 35 ece 627, winter 1325 SWRL atoms (predicates) 2 P(x,y)P is an OWL predicate holds iff x is related to y by property P hasBrother(John, Bill) hasBrother(John, ?y) hasBrother(?x, ?y) of 35 ece 627, winter 1326 SWRL atoms (predicates) 3 sameAs(x,y)sameAs belongs to the OWL vocabulary holds iff x is interpreted as the same object y sameAs(?x, ?y) of 35 ece 627, winter 1327 SWRL atoms (predicates) 4 differentFrom(x,y)differentFrom belongs to the OWL vocabulary holds iff x and y are interpreted as different objects differentFrom(?x, ?y) of 35 ece 627, winter 1328 SWRL atoms (predicates) 5 builtIn(r,x,)r is a built-in relation holds iff the built-in relation r holds for the interpretations of the arguments swrlb:greaterThan(?x,?y) (builtIn(greaterThan,?x,?y)) swrlb:startsWith(?x, "+") of 35 ece 627, winter 1329 SWRL rule example reclassification Man(?m) Person(?m) of 35 ece 627, winter 1330 SWRL rule example property value assignment Person(?p) hasSibling(?p, ?s) Man(?s) hasBrother(?p, ?s) of 35 ece 627, winter 1331 SWRL rule example named individuals Person(Fred) hasSibling(Fred, ?s) Man(?s) hasBrother(Fred, ?s) of 35 ece 627, winter 1332 SWRL rule example with individuals & literals Person(Fred) hasSibling(Fred, ?s) Man(?s) hasAge(?s, 40) has40YearOldBrother(Fred, ?s) of 35 ece 627, winter 1333 SWRL rule example with built-ins hasBrother(?x1,?x2) hasAge(?x1,?age1) hasAge(?x2,?age2) swrlb:greaterThan(?age2,?age1) hasOlderBrother(?x1,?x2) of 35 ece 627, winter 1334 SWRL rule example with built-ins (2) hasBrother(?x1,?x2) hasAge(?x1,?age1) hasAge(?x2,?age2) swrlb:subtract(10,?age2,?age1) hasDecadeOlderBrother(?x1,?x2) of 35 ece 627, winter 1335 SWRL characteristics - W3C Submission in rules saved as part of ontology - increasing tool support: Bossam, R2ML, Hoolet, Pellet, KAON2, RacerPro, SWRLTab - can work with reasoners