Web Data and Declarative Programming

Similar documents
Ontology Querying and Reasoning with XQuery

An Encoding of XQuery in Prolog

XQuery within Logic Programming 1

Deep integration of Python with Semantic Web technologies

Table of Contents. iii

Web Ontology Language: OWL

An RDF Query Language based on Logic Programming

Semantic Web. Ontology and OWL. Morteza Amini. Sharif University of Technology Fall 95-96

Limitations of the WWW

Semantic Web Technologies: Web Ontology Language

KDI OWL. Fausto Giunchiglia and Mattia Fumagallli. University of Trento

Integrating XQuery and Logic Programming

An Introduction to the Semantic Web. Jeff Heflin Lehigh University

Contents. G52IWS: The Semantic Web. The Semantic Web. Semantic web elements. Semantic Web technologies. Semantic Web Services

Chapter 2 AN INTRODUCTION TO THE OWL WEB ONTOLOGY LANGUAGE 1. INTRODUCTION. Jeff Heflin Lehigh University

A Prolog library for OWL RL

Short notes about OWL 1

OSM Lecture (14:45-16:15) Takahira Yamaguchi. OSM Exercise (16:30-18:00) Susumu Tamagawa

RDF Schema. Mario Arrigoni Neri

Reasoning with the Web Ontology Language (OWL)

The Semantic Web. Mansooreh Jalalyazdi

For return on 19 January 2018 (late submission: 2 February 2018)

Semantic Web Test

OWL and tractability. Based on slides from Ian Horrocks and Franz Baader. Combining the strengths of UMIST and The Victoria University of Manchester

The Semantic Web RDF, RDF Schema, and OWL (Part 2)

Integrating XQuery and Logic Programming

Semantic Technologies

Description Logic. Eva Mráková,

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

Semantic Web In Depth: Resource Description Framework. Dr Nicholas Gibbins 32/4037

DEVELOPING AN OWL ONTOLOGY FOR E- TOURISM

Querying Data through Ontologies

Web Ontology Language: OWL

Forward Chaining Reasoning Tool for Rya

Web Ontology Language: OWL

An RDF-based Distributed Expert System

Web Ontology Language: OWL by Grigoris Antoniou Frank van Harmelen

Querying XML 4/2/2008. USC - CSCI585 - Spring Farnoush Banaei-Kashani

Mustafa Jarrar: Lecture Notes on RDF Schema Birzeit University, Version 3. RDFS RDF Schema. Mustafa Jarrar. Birzeit University

Controlled Natural Language as Interface Language to the Semantic Web

Semantic Web and Linked Data

Integrating XQuery and Logic Programming

Efficient Querying of Web Services Using Ontologies

Schema-Agnostic Query Rewriting in SPARQL 1.1

XML and Semantic Web Technologies. III. Semantic Web / 1. Ressource Description Framework (RDF)

Formalising the Semantic Web. (These slides have been written by Axel Polleres, WU Vienna)

Semistructured Data Management Part 3 (Towards the) Semantic Web

The Semantic Web Revisited. Nigel Shadbolt Tim Berners-Lee Wendy Hall

Chapter 4 Web Ontology Language: OWL

OWL a glimpse. OWL a glimpse (2) requirements for ontology languages. requirements for ontology languages

The Semantic Web. What is the Semantic Web?

LINKING BACKGROUND INFORMATION

OWL & SPARQL - 웹정보시스템

Adding formal semantics to the Web

Making BioPAX SPARQL

Ontological Modeling: Part 11

Introducing Linked Data

Publishing OWL ontologies with Presto

XQuery: a typed functional language for querying XML

Semantic Web Technologies: RDF + RDFS

Development of University Ontology for aspocms

Semantic Web. MPRI : Web Data Management. Antoine Amarilli Friday, January 11th 1/29

Extracting Ontologies from Standards: Experiences and Issues

Comparison of Semantic Web serialization syntaxes

SEMANTIC WEB 05 RDF SCHEMA MODELLING SEMANTICS IMRAN IHSAN ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD

Semantic Web Solutions

Jorge Cardoso University of Coimbra, Portugal & KSRI/Karlsruhe Institute of Technology, Germany

Semantic Web Ontologies

Opus: University of Bath Online Publication Store

H1 Spring B. Programmers need to learn the SOAP schema so as to offer and use Web services.

Ontological Modeling: Part 7

Stream Reasoning For Linked Data

Cyrus Shahabi Computer Science Department University of Southern California

OWL Web Ontology Language

Semantic Web. RDF and RDF Schema. Morteza Amini. Sharif University of Technology Spring 90-91

ARISTOTLE UNIVERSITY OF THESSALONIKI. Department of Computer Science. Technical Report

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

Main topics: Presenter: Introduction to OWL Protégé, an ontology editor OWL 2 Semantic reasoner Summary TDT OWL

Semantic web. Tapas Kumar Mishra 11CS60R32

Semistructured Data Management Part 3 (Towards the) Semantic Web

Appendix B: The LCA ontology (lca.owl)

A Federated Query Answering System for Semantic Web Data

JOURNAL OF OBJECT TECHNOLOGY

RDF. Resource Description Framework

INF3580/4580 Semantic Technologies Spring 2017

Lecture 8 OWL: Web Ontology Language

Ontological Modeling: Part 14

Semantic Web Fundamentals

Why Ontologies? RRDIU - Semantic Web 2

ROWLBAC Representing Role Based Access Control in OWL

INF3580 Semantic Technologies Spring 2012

Design and Implementation of an RDF Triple Store

What is the Semantic Web?

OWL-based reasoning with retractable inference

RDF AND SPARQL. Part III: Semantics of RDF(S) Dresden, August Sebastian Rudolph ICCL Summer School

Part II. Representation of Meta-Information

Semantic Web Technologies Web Ontology Language (OWL) Part II. Heiko Paulheim

Flexible Tools for the Semantic Web

08 OWL SEMANTIC WEB ONTOLOGY WEB LANGUAGE IMRAN IHSAN ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD

TRIPLE An RDF Query, Inference, and Transformation Language

Transcription:

and Declarative Programming Universidad de Almería. jalmen@ual.es March 2, 2010

Table of contents 1 2 XML RDF OWL 3 Querying and Reasoning with SPARQL 4 with 5

Querying and Reasoning with Research Lines Data on the Web XML Ontology languages: RDF OWL Description Logic Querying and Reasoning with Database Programming Languages and SPARQL Rule Based Languages Prolog SWRL and Declarative Programming

Querying and Reasoning with XML and Logic Programming and Logic Programming and Logic Programming with Prolog and and Declarative Programming

Querying and Reasoning with Semantic Web Figure: Tim Berners-Lee Semantic Web Stack and Declarative Programming

Querying and Reasoning with XML RDF OWL Representation of Data: XML, RDF, OWL Querying of XML Reasoning with RDF and OWL Description Logic Efficient storing and retrieval Complete reasoning and Declarative Programming

XML Querying and Reasoning with XML RDF OWL XML Tree Based Representation Books, People, Papers,... Year, Identifier, Link to Web Page, Impact Factor,... Name, Title, Authors, Price,... More than one author, Missing Price, Mix of Books and Papers Non relational database and Declarative Programming

XML Querying and Reasoning with XML RDF OWL Example <books> <book year= 2003 > <author>abiteboul</author> <author>buneman</author> <author>suciu</author> <title>data on the Web</title> <review>a <em>fine</em> book.</review> </book> <book year= 2002 > <author>buneman</author> <title>xml in Scottland</title> <review><em>the <em>best</em> ever!</em></review> </book> </books> and Declarative Programming

XML Querying and Reasoning with XML RDF OWL Where? Exported from RDBMS Web resources (DBLP, http://dblp.uni-trier.de/xml/dblp.xml) W3C recommendation and Declarative Programming

RDF Querying and Reasoning with XML RDF OWL RDF/RDFS Graph based Representation (Subject,Property,Object) Metadata Subclass: An student is a person Subproperty: A girlfriend is a friend Type: Jesus is a teacher Domain and Range: The range and domain of friend is a person and Declarative Programming

RDF Querying and Reasoning with XML RDF OWL RDF <rdf:description rdf:about= http://www.amazon.com/12345 > <author rdf:resource= Abiteboul > </rdf:description> <rdf:description rdf:about= http://www.amazon.com/12345 > <author rdf:resource= Suciu > </rdf:description> <rdf:description rdf:about= http://www.amazon.com/12345 > <author rdf:resource= Buneman > </rdf:description> <rdf:description rdf:about= http://www.amazon.com/12345 > <title rdf:resource= Data on the Web > </rdf:description> and Declarative Programming

RDF Querying and Reasoning with XML RDF OWL RDFS <rdf:property rdf:id= author / > <rdf:property rdf:id= title / > <rdf:class rdf:id= paper / > <rdf:class rdf:id= manuscript / > <rdf:description rdf:about= #paper > <rdfs:subclassof rdf:resource= #manuscript / > </rdf:description> <rdf:description rdf:about= Abiteboul > <rdf:type rdf:resource= #man / > < /rdf:description> <rdf:description rdf:about= #girlfriend > <rdfs:subpropertyof rdf:resource= #friend / > < /rdf:description> and Declarative Programming

OWL Querying and Reasoning with XML RDF OWL OWL Extension of RDF Based on Description Logic RDF-based representation: Graph based representation Metadata: Subclass, Subproperty, Type, Domain and Range from RDF(S) Union, intersection Symmetric (Friend), Inverse (Husband and Wife) and Transitive Properties (Friend, Facebook) Class and property equivalence and Complex subclass relationships: married are husband or wife of persons More complex relationships, more complex description logic: OWL DL, OWL Lite, OWL Full and Declarative Programming

OWL Querying and Reasoning with XML RDF OWL OWL <owl:class ID= Husband or Wife > <owl:unionof rdf:parsetype= Collection > <owl:restriction> <owl:onproperty rdf:resource= #husband /> <owl:somevaluesfrom rdf:resource= #Person /> </owl:restriction> <owl:restriction> <owl:onproperty rdf:resource= #wife /> <owl:somevaluesfrom rdf:resource= #Person /> </owl:restriction> </owl:unionof> </owl:class> <owl:class rdf:about= #Husband or Wife > <rdfs:subclassof rdf:resource= #Married /> </owl:class> <rdf:property rdf:about= #husband > <owl:inverseof rdf:resource= #wife /> </rdf:property> and Declarative Programming

Querying and Reasoning with SPARQL Typed Functional Language for XML Querying For Let Order By Where Return, FLOWR expressions Join of Multiple Documents Sublanguage: : Querying the tree structure of XML and Declarative Programming

Querying and Reasoning with SPARQL /books/book/author /books/book[@year=2002]/author /books/book/author/.. /books/book/* and Declarative Programming

Querying and Reasoning with SPARQL <result> for $Book in doc( ex.xml )/bib/book return let $Year := $Book/@year where $Year < 1995 return let $Title := $Book/title return <mybook> { $Year } { $Title } </mybook> < /result> and Declarative Programming

Querying and Reasoning with SPARQL <result> <mybook year= 1994 ><title>tcp/ip Illustrated< /title>< /mybook> <mybook year= 1992 ><title>advanced Programming in the Unix environment</title>< /mybook> < /result> and Declarative Programming

SPARQL Querying and Reasoning with SPARQL SPARQL PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX ns: <http://example.org/ns#> SELECT?title?price WHERE {?x ns:price?price. FILTER (?price 30.5)?x dc:title?title. } and Declarative Programming

Querying and Reasoning with with XML and Representation of XML documents in Prolog Facts for leaves of the XML tree, Rules for structure of the XML tree (TPLP 08) A Prolog term for XML tree (XSym 09, SWI-Prolog) Implementation of in Prolog Facts/Rules: Program specialization of Prolog rules (TPLP 08) Prolog term: Traversal of the Prolog term (XSym 09) and Declarative Programming

Querying and Reasoning with with Facts and Rules for the XML Tree Rules (Schema): books(bookstype(book, []), NBooks,1,Doc) :- book(book, [NBook NBooks],2,Doc). book(booktype(author, Title, Review, [year=year]),nbook,2,doc) :- author(author, [NAu NBook],3,Doc), title(title, [NTitle NBook],3,Doc), review(review, [NRe NBook],3,Doc), year(year, NBook,3,Doc). review(reviewtype(un,em,[]),nreview,3,doc):- unlabeled(un,[nun NReview],4,Doc), em(em,[nem NReview],4,Doc). review(reviewtype(em,[]),nreview,3,doc):- em(em,[nem NReview],5,Doc). em(emtype(unlabeled,em,[]),nems,5,doc) :- unlabeled(unlabeled,[nun NEms],6,Doc), em(em, [NEm NEms],6,Doc). and Declarative Programming

Querying and Reasoning with with Facts and Rules for the XML Tree Facts (Document): year( 2003, [1, 1], 3, books.xml"). author( Abiteboul, [1, 1, 1], 3, books.xml"). author( Buneman, [2,1, 1], 3, books.xml"). author( Suciu, [3,1,1], 3, books.xml"). title( Data on the Web, [4, 1, 1], 3, books.xml"). unlabeled( A, [1, 5, 1, 1], 4, books.xml"). em( fine, [2, 5, 1, 1], 4, books.xml"). unlabeled( book., [3, 5, 1, 1], 4, books.xml"). year( 2002, [2, 1], 3, books.xml"). author( Buneman, [1, 2, 1], 3, books.xml"). title( XML in Scottland, [2, 2, 1], 3, books.xml"). unlabeled( The, [1, 1, 3, 2, 1], 6, books.xml"). em( best, [2, 1, 3, 2, 1], 6, books.xml"). unlabeled( ever!, [3, 1, 3, 2, 1], 6, books.xml"). and Declarative Programming

Querying and Reasoning with with Prolog term of the XML tree [element(bib, [], [element(book, [year=1994], [element(title, [], [TCP/IP Illustrated]), element(author, [], [element(last, [], [Stevens]), element(first, [], [W.])]), element(publisher, [], [Addison-Wesley]), element(price, [], [65.95]) ]), element(book, [year=1992], [element(title, [], [Advanced Programming in the Unix environment]), element(author, [], [element(last, [], [Stevens]), element(first, [], [W.])]), element(publisher, [], [Addison-Wesley]), element(price, [], [65.95]) ]), element(book, [year=2000],... ]) ] and Declarative Programming

Querying and Reasoning with with Query /books/book[@year=2002]/author Specialized Program book(booktype(author,[year=year]),nbook,2,doc) :- author(author, [NAu NBook],3,Doc), year(year, NBook,3,Doc). Goal?- book(booktype(author, [year=2002]),nbook,2, ex.xml ). and Declarative Programming

Querying and Reasoning with with Predicate xpath([label],[element(label,attr,sublabel) Relement], [element(label,attr,sublabel) Relement2]):-!, xpath([label],relement,relement2). xpath([label],[ Relement],Relement2):-!,xpath([Label],Relement,Relement2).... Goal?- xpath([books,book,author],[element(books,...)],author). and Declarative Programming

Querying and Reasoning with with implementation based on facts and rules representation (WLP 07) implementation based on Prolog term representation (XSym 09) and Declarative Programming

Querying and Reasoning with with for $book in document ( books.xml )/books/book return let $year := $book/@year where $year<2003 return <mybook>{$year, $book/title}</mybook> Encoding of mybook(mybooktype(title,[year]),[node],[type],[doc]):- join(title,year,node,type,doc). join(title,year,[node],[type],[doc]):- vbook(title,year,node,type,doc), constraints(vbook(title,year)). vbook(title,year,[node,node],[ttitle,tyear], books.xml ):- title(title,[ntitle Node],TTitle, books.xml ), year(year,node,tyear, books.xml ). and Declarative Programming

Querying and Reasoning with with <result> for $Book in doc( ex.xml )/bib/book return let $Year := $Book/@year where $Year < 1995 return <mybook> { $Year } { $Book/title } </mybook> < /result> Encoding of xquery([element(result, [], Result)], 1) :- xquery(result, 2). xquery(mybooks, 2) :- findall(mybook, xquery([mybook], 3), MyBooks). xquery([element(mybook, [], YearTitle)], 3) :- xquery(yeartitle, 6). xquery(yeartitle, 6) :- findall(year, xquery([year], 7), Years), findall(title, xquery(title, 8), Titles), combine([years, Titles], YearsTitles), member(yeartitle, YearsTitles).... and Declarative Programming

Querying and Reasoning with with RDF(S) and OWL RDF/RDF(S) Entailment OWL Reasoning: Description Logic Complete reasoning SWI-Prolog: RDF library Description Logic Programming and Declarative Programming

Querying and Reasoning with with RDF(S) and OWL RDF Entailment: Prolog Rules (WWv 07) OWL Reasoning: Prolog Rules (WWv 09) Inference Calculus and Complete Reasoning (WWv 09) triple predicate in Prolog and Declarative Programming

Querying and Reasoning with with Description Logic C D (rdfs:subclassof) E F (owl:equivalentclass) P Q (rdfs:subpropertyof) P Q (owl:equivalentproperty) P Q (owl:inverseof) P P (owl:symmetricproperty) P + P (owl:transitiveproperty) P.D (rdfs:domain) P.D (rdfs:range) P(A, B) (property filler) C(A) (individual assertion) and Declarative Programming

Querying and Reasoning with with Description Logic TBox (1) Man Person (2) Woman Person (3) Person author of.manuscript Writer (4) Paper Book Manuscript (5) Book topic.{ XML } XMLbook (6) Manuscript reviewed by.person Reviewed (7) Manuscript rating.score (8) Manuscript topic.topic (9) author of writes (10) average rating rating (11) authored by author of (12) author of.manuscript (13) author of.person (14) reviewed by.person (15) reviewed by.manuscript ABox (1) Man( Abiteboul ) (2) Man( Buneman ) (3) Man( Suciu ) (4) Book( Data on the Web ) (5) Book( XML in Scottland ) (6) Paper( Growing ) (7) Person( Anonymous ) (8) author of( Abiteboul, Data on the Web ) (9) authored by( Data on the Web, Buneman ) (10) author of( Suciu, Data on the Web ) (11) author of( Buneman, XML in Scottland ) (12) writes( Simeon, Growing ) (13) reviewed by( Data on the Web, Anonymous ) and Declarative Programming

Querying and Reasoning with with Inference Calculus Rule Name Inference (Eq1) OI E E (Eq2) E F, F G OI E G (Eq3) E F OI F E (Eq4) C D, D C OI C D (Sub1) E F OI E F (Sub2) C D, D E OI C E (Sub3) C D E OI C E (Sub4) E C D OI E C (Sub5) C 1 C 2 D, E C 1 OI E C 2 D (Sub6) C 1 C 2 D, E C 1 OI E C 2 D (Sub7) C D 1 D 2, D 1 E OI C E D 2 (Sub8) P.{O} D, Q P OI Q.{O} D (Sub9) P.C D, Q P OI Q.C D (Sub10) P.C D, E C OI P.E D (Sub11) C P.{O}, P Q OI C Q.{O} (Sub12) C P.D, Q P OI C Q.D (Sub13) C P.D, D E OI C P.E and Declarative Programming

Querying and Reasoning with with Prolog Rules Rule Name Prolog Rule (Eq1) triple(e, owl : equivalentclass, E) : class(e). (Eq2) triple(e, owl : equivalentclass, G) : triple(e, owl : equivalentclass, F ), triple(f, owl : equivalentclass, G). (Eq3) triple(e, owl : equivalentclass, F ) : triple(f, owl : equivalentclass, E). (Eq4) triple(e, owl : equivalentclass, F ) : triple(e, rdfs : subclassof, F ), triple(f, rdfs : subclassof, E). (Sub1) triple(e, rdfs : subclassof, F ) : triple(e, owl : equivalentclass, F ). (Sub2) triple(c, rdfs : subclassof, E) : triple(c, rdfs : subclassof, D), triple(d, rdfs : subclassof, E). (Sub3) triple(d, rdfs : subclassof, E) : triple(union(u), rdfs : subclassof, E), member(d, U). (Sub4) triple(e, rdfs : subclassof, C) : triple(e, rdfs : subclassof, inter(i )), member(c, I ). (Sub5) triple(inter(i2), rdfs : subclassof, D) : triple(inter(i1), rdfs : subclassof, D), member(c, I1), triple(e, rdfs : subclassof, C), replace(i 1, C, E, I 2). (Sub6) triple(union(u2), rdfs : subclassof, D) : triple(union(u1), rdfs : subclassof, D), member(c, U1), triple(e, rdfs : subclassof, C), replace(u1, C, E, U2). (Sub7) triple(c, rdfs : subclassof, inter(i2)) : triple(c, rdfs : subclassof, inter(i1)), member(d, I1), triple(d, rdfs : subclassof, E), replace(i 1, D, E, I 2). (Sub8) triple(hasvalue(q, O), rdfs : subclassof, D) : triple(q, owl : subpropertyof, P), triple(hasvalue(p, O), rdfs : subclassof, D). and Declarative Programming

Querying and Reasoning with with with with RDF(S) and OWL for Ontology Querying and Reasoning [WWv 07,PLAN-X 09,INAP 09] RDF(S) and OWL reasoning Built-in boolean functions for XML/RDF(S)/OWL as input and as output Prolog-based implementation and Declarative Programming

Querying and Reasoning with with with extension < list > { for ($Writer,$Property,$Manus) in owldocument( ex.owl ) return for ($Manus,$Property2,$Type) in owldocument( ex.owl ) where rdfs:subpropertyof($property,writes) and $Property2=rdf:typeOf and rdfs:subclassof($type,reviewed) return <item>{ <manuscript> { $Manus } </ manuscript > <writer>{ $Writer } </writer > } </item> } </ list > and Declarative Programming

Querying and Reasoning with with with Prolog-based implementation list(listtype(item,[]),nl,1,doc):- item(item,[nitem N],2,Doc). item(itemtype(manuscripttype(manus,[]), writertype(writer,[]),[]),nitem,2, result.xml ):- join(manus,writer,nitem). join(manuscript,writer,[nm,[1]]):- triple(writer,property,manuscript,nm, ex.owl ), triple(manuscript,property2,type,, ex.owl ), triple(property,rdfs:subpropertyof,writes,, ex.owl ), Property2=rdf:typeOf, triple(type,rdfs:subclassof,reviewed,, ex.owl ). and Declarative Programming

Querying and Reasoning with implementation extension in OWL extensions: More complex description logic GML: Geographic Markup Language: XML for Geographic Data Ontologies for Geographic Data GQuery? GPath? and Declarative Programming