350 likes | 523 Views
Jan Maluszynski Linköping University Sweden. On Integrating Rules into the Semantic Web. Overview. “Semantic Web” – do we need it? XML and web languages Rules on the web: the RuleML approach The W3C vision of the Semantic Web Towards typed rules Summary. Do we need ”Semantic Web”?.
E N D
Jan Maluszynski Linköping University Sweden On Integrating Rules intothe Semantic Web WFLP'03, Valencia
Overview • “Semantic Web” – do we need it? • XML and web languages • Rules on the web: the RuleML approach • The W3C vision of the Semantic Web • Towards typed rules • Summary WFLP'03, Valencia
Do we need ”Semantic Web”? • Google query: FLP ? gives ~170 000 answers: Forever Living Products Family Living Program Forest Legacy Program Finish Line Performance … I admit, the query is not smart… • Functional Logic Programming Conference ? Michael Hanus Conferences related to FLP …WFLP … WFLP'03, Valencia
Adding semantics to the contents • Annotate web content with a description of its meaning => metadata FLP – is a branch of CS Workshop is a Conference Symposium is a Conference • Use metadata for reasoning/querying FLP conference / CS? => WFLP, FLOPS • Logical foundations? • Various web languages needed: how to define them? what is their semantics? WFLP'03, Valencia
Rules • Can a software agent plan my travel to WFLP ?Constraints/preferences expressed as rules? • Database views • Bussiness rules • … Using them on the web? WFLP'03, Valencia
Web needs standards • Standard notation for data: XML • Standard for creating unique names: Namespaces • Standard for defining web languages (sets of XML elements): XML Schema, (DTD) • … WFLP'03, Valencia
XML person 15 <person age=“25”> <name>John Smith </name> <address> <street> Dalav. 21 </street> <city> Lund </city> </address> </person> name address street city John Smith Dalav. 21 Lund Tags, Attributes, • Standard format facilitates: • Definition of self-describing structured data • Integration from various sources WFLP'03, Valencia
Is XML element a term ? <CD price="10.90$" year="1985"> Empire Burlesque <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> </CD> CD[&{price[10.90$],year[1985]}, Empire Burlesque, artist[Bob Dylan], country[USA], company[Columbia] ] Arity of function symbols is not predefined;unordered subterms WFLP'03, Valencia
Creating unique names • Universal Resource Identifier: URI identifies unique resource special case: URL • Used for creating unique names Namespaces The URL may point to a description of the names (unique meaning?). <contact xmlns:work="http://www.liu.ida.se/"> <name>John Smith</name> <phone>013/175347</phone> <work:phone>013/281400</work:phone> </contact> WFLP'03, Valencia
Defining a web language: syntax • Language: a set of XML elements • Elements ~ trees Define language as a tree-grammar (DTD), place on web could we define language in XML? • XML Schema language: elements are XML documents for any XML Schema document S: • The meaning of S is a set of XML documents L(S) the function L is the semantics of XML Schema • standard on-line validator can check whether any given XML document is in L(S); • The validator implements the semantics of the XML Schema WFLP'03, Valencia
A flavour of XML Schema <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> < xsd: element name=“purchaseOrder” type=“POT” /> < xsd: complexType name=“POT”/> < xsd: sequence> < xsd: element name=“addr” type=“USAddress”/> < xsd: element name=“items” type=“Items”/> < /xsd: sequence> < xsd: attribute name=“orderDate” type=“xsd:date”/> < /xsd: complexType> …. < / xsd: schema> Roughly reflected by a rule: POT purchaseOrder(USAddress Items) WFLP'03, Valencia
Regular tree grammars for XML languages ERTG: Nonterminals X in N{POT, USAddr,…} Terminals t{pOrder, addr,…}/XML tags Start S in NPOT Rules X t ( R) R - a regular expression over N <pOrder> <addr> ... </addr> <items> <it> ... </it> <it> ... </it> </items> </pOrder> POT pOrder( USAddr Items) USAddr addr( Mail Street ZIP City State) Items items( Item*) Item it(Artno Quantity) …. pOrder addr… items it it … art … qua … WFLP'03, Valencia
Regular tree languages • RTG: each function symbol has fixed arity ERTG: arguments of a function symbol defined by a regular expression • Regular tree language: a language defined by an RTG • Regular tree languages are closed under: • intersection • union • … Inclusion is decidable • The same holds for languages defined by ERTG WFLP'03, Valencia
Defining web languages: summary • XML schema S defines syntax of L L=L(S) • Saccessible by a URL • A document x can be validated wrt S x L ? XML Schema validators • Operational semantics: an interpreter for L accessible on the web • Declarative semantics ? WFLP'03, Valencia
RuleML: rules on the web • Rule Markup Language Initiative: => Standardize mark-up for selected rule languages! A small family sufficient to embed various applications (?) • Develop XML schema for XML encoding of a rule language L e.g. for Datalog • Put it on the web: URL • Operational semantics: rule engine(s) • Declarative semantics, XML code XML code XML schema for L L Rules in syntax 1 L Rules in syntax 2 WFLP'03, Valencia
Logic on the web • Define XML syntax for logic languages (different logics) Model-theoretic semantics, Automatic reasoners • Proposed logics include: • Description logics (work in progress DAML+OIL, OWL) • Datalog…. In a chosen logic: • Provide a set of formulae (encoded in XML) specific axioms • Automatic reasoning system answers queries WFLP'03, Valencia
W3C view of the Semantic Web • Layers of tightly connected langugages. XML provides the syntactic basis for all layers • What are the connections between the layers? Rules Ontology RDF Schema RDF XML + NS + XML Schema URI Unicode WFLP'03, Valencia
RDF + RDF Schema • A (still evolving) notation encoded in XML [Beckett D. (ed.) 2002] • For modeling application domains Classes, Subclasses, Properties(Slots), Literals • Basic construct: sentence:Subject Predicate Object • Encoded in XML, • Can be seen as ground atomic formula, • Represented as graph • Model theoretic semantics [P. Hayes (ed.) 2003] • Editors, query tools exist WFLP'03, Valencia
A flavour of RDF Schema rdfs:Resource s = rdfs:subClassOf t = rdf:type s t s t rdfs:Class t xyz:MotorVehicle t t t s s s xyz:Van xyz:Truck t s xyz:PassengerVehicle xyz:MiniVan s WFLP'03, Valencia
Description Logics • A family of KR formalisms, based on FOPL decidable, supported by automatic reasoning systems • Used for modelling of application domains • Classification of concepts and individuals concepts (unary predicates), subconcept (subsumption), roles (binary predicates), individuals (constants), constructors for building concepts, equality … [Baader et al. 2002] WFLP'03, Valencia
R atomic role, A atomic concept C,D A | (atomic concept) T | (universal concept) | (bottom concept) A | (atomic negation) C D | (intersection) R.C |(value restriction) R.T | limited ex. Quantification Add more constructors: another DL RI I I AI I TI = I I = Ø (A)I = I \ AI (CD)I = CIDI ( R.C)I = {a I|b.(a,b) RIb CI } ( R.T)I = {a I| b.(a,b) RI} Example DL: AL WFLP'03, Valencia
Modelling with DLs • A set of equational axioms T(terminology, T-box)Woman Person Female Man Person Female • Automated check for (C, D concepts): • Satisfiability of C: is there a model I of T such that CI nonempty? Man Woman ? • Subsumption: CI DI for every model I of T ? Reduces to unsatisfiability C D • Add assertions about individuals: Man(Peter) … Query the obtained knowledge base K. Ground membership query: Person(Peter)? Find all the individuals in K that are instances of a given concept WFLP'03, Valencia
W3C Ontology Language OWL • An expressive description logic Under development [Dean et al. (eds) 2002] • Encoded in XML • Extending (?) RDFS Some problems with that [Patel-Schneider, Fensel 2002] Ontology: a conceptual model of the application domain; OWL ontology: a set of OWL statements – XML encoding of a set of DL axioms WFLP'03, Valencia
Class : Atomic concept Property: Atomic role A is a subclass of B: A B P is a subproperty of R: P R A is a range of R : T R.A A is a domain of R T R-.A RDF Schema primitives in DL perspective A,B atomic concepts P,R atomic roles, T universal concept ( R.C)I = {a I|b.(a,b) RIb CI } R- inverse WFLP'03, Valencia
Ontologies and XML Schema • Ontology: a conceptual model of the application domain • Data will be represented in XML; document structure must be imposed • A systematic approach for translating an ontology into a specific XML Schema [Klein, Fensel et al. 2000]: • represent: a class C by an element definition; • the properties of C correspond to subelements • subclasses modelled by XML Schema extension • multiple inheritance cannot be directly expressed WFLP'03, Valencia
Modeling Ontology with RT Grammar ? Person p(S (M|W)? T?) TaxP p(S (M|W)? T) M p( sex(m) W? T?) W p( sex(f) M? T?) T tax(#Pcdata) S sex(m|f) Man Person Woman Person Taxpayer Person S T sex partner tax WFLP'03, Valencia
Adding rule level • Should build-up on the ontology level How ontologies relate to XML data on the web? • What kind of rules? Datalog, (extensions: negation, prioritized rules, fuzzy,…) Query rules for XML-data ….. • What kind of integration? How to add rules on top of ontologies (RDFS, DLs) ? Integrate Description Logic(s) with Datalog WFLP'03, Valencia
Integration of Datalog with DL (1) CARIN [Levy, Rousset 1998], a family of languages Two sets of axioms are provided: (1) T-box in a description logic (2)Rules and ground facts: p1(X1),…,pn(Xn) q(Y) Xi Y vectors of variables • concept predicates, role predicates, can be used in the body but not in the head; the other: ordinary predicates • all variables of the head appear in the body; no/limited recursion • Ground atomic queries only; special inference procedure needed/provided WFLP'03, Valencia
Integration of Datalog with DL (2) Description Logic Programs [Grosof et al. 2003] • A restricted DL language, where DL axioms can be transformed into logically equivalent Horn clauses., e.g. PQ Q(X) P(X) • The syntactic restrictions are somewhat complex • DLP is less expressive than DAML+OIL but can model a subset of RDFS The advantage: use of LP engines for query answering; non-monotonic extensions possible WFLP'03, Valencia
Typing Datalog with DLs • Rationale: An ontology describes classes of application data; Rules describe data manipulation; Man Person Woman Person Taxpayer Person lives(X,M), couple(X,Y), interestpaid(Y,Z) taxdeduction(X,Z,M) TYPES: lives: Person, Municipality couple:Man,Woman interestpaid:Person, Amount taxdeduction: Taxpayer, Amount, Municipality X:Person X:Man Check in DL : (Man Person) Taxpayer NO! Clear separation of reasoning in DL from answering Datalog queries; WFLP'03, Valencia
Typechecking of rules T(q1) T(qn) T(r) T(r(X …Y)) q1(X … Y) … qn(X … Y) r(X … Y) T1(X)…T1(Y) Tn(X)…Tn(Y) T(X)…T(Y) T(X) = T1(X)…Tn(X) T(Y) = T1(Y)…Tn(Y) WFLP'03, Valencia
Conceptual vs. Concrete XML encoding Ontology XML Schema typed typed Datalog rules XML rules ? WFLP'03, Valencia
Towards a typed XML rule language • Query and transformation rule: q1,…, qn c inproc[[ author[X],title[Y] ]], article[[ author[X],title[Y] ]] multi[X] [[…]] – allows matching term to include additional subterms Xcerpt: Query and Transformation Language [Bry, Schaffert 2002] • Types: approximate the XML databaseby a regular tree language T : • Matching qi ,c against T gives T(qi ), T(c) Matching : intersection of regular tree languages • T(qi ) binds variables: T(Xi ) • Compute T(X)=T(X1 ) …T(Xn), construct T’(c) • Check T’(c) T(c) WFLP'03, Valencia
Summary • A perspective of the ongoing development • Research issues: • Integration of rules and ontologies • Deriving XML schemata from ontologies • Type checking of rules • Datalog rules typed by DLs • XML transformation rules typed by RTLs derived from XML schemata WFLP'03, Valencia
References F.Baader, D. Calvanese, D. McGuiness, D.Nardi and P. Patel-Schneider (eds) The Description Logic Handbook. Cambridge University Press, 2002. D. Beckett (ed.) RDF/XML Syntax Specification (Revised) W3C November 2002. F.Bry and S. Schaffert. Towards a Declarative Query and Transformation Language for XML and Semistructured Data. Proc. ICLP2002 H.Comon, M.Dauchet, R.Gilleron, F.Jacquemard, D.Lugiez, S.Tison and M. Tommasi. Tree Automata Techniques and Applications. http://www.grappa.univ-lille3.fr/tata M.Dean, D.Connolly, F.van Harmelen, J.Hendler, I.Horrocks, D.L.McGuiness, P.F.Patel-Scheider and L.A.Stein (Eds.). OWL Web Ontology Language, Reference Version 1.0, W3C,Working Draft November 2002 B. N. Grosof, I. Horrocks, R.Volz and S.Decker. Description Logic Programs: Combining Logic Programs with Description Logic. Proc. of WWW2003, Budapest. P.Hayes (ed.) RDF Semantics, W3C Working Draft January 2003 M. Klein, D. Fensel, F. van Harmelen andI. Horrocks, The relation between ontologies and schema-languages: translating OIL specifications in XML Schema.Proc of the Workshop on Ontologies and Problem Solving Methods, ECAI 2000 A.Levy and M-C.Rousset. CARIN: A Representation Language Combining Horn rules and Description Logics. Artificial Intelligence 104(1-2), 1998, 165-209. P.F. Patel-Schneider and D.Fensel. Layering the Semantic Web: Problems and Directions. Proc. ISWC2002, LNCS2342 pp. 16-29 Rule Markup Language Initiative. http://www.ruleml.org WFLP'03, Valencia