Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF...

23
Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS

Transcript of Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF...

Page 1: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Semantically Processing The Semantic Web

Presented by:

Kunal Patel

Dr. Gopal Gupta

UNIVERSITY OF TEXAS AT DALLAS

Page 2: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Agenda

• Introduction• Problem & Solution• Proposed Framework

• Denotational Semantics• Horn Logic

• Application of Framework• Current Status • Conclusion

Page 3: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Introduction

• With the advent of Semantic Web, web communities have started publishing their formal data

• Different description formats are being used for representation of this data– Example: RDF, RDF Schema, DAML+OIL, etc.

• Various query languages have also been developed to query this data– Example: RDQL, RQL, SQUISH, etc.

Page 4: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Problem

DAML

RDF

RDFS

• Different Design Methodologies

• Different Design Goals

Difficult to Integrate DataDifficult to Query Data

Difficult to Infer New Data

No single query language that can handle the multiple semantics represented by these heterogeneous data models

Page 5: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Solution

Executable Notations

DAML

RDQL RQL

RDFS

SQUISH

RDFTranslate Description Formats and Query Languages into Executable Notations

Making a language executable means mapping the language into a notation whose semantics is mathematical

Information that is implied can then be inferred automatically from this mathematical semantics

RAPID

Main Requirement

Page 6: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Proposed Framework

A framework based on Denotational Semantics & Horn Logic

L1 L2

Translate

Denotational Semantics of L1 Language Constructs of L2

terms of

All components of this semantics are coded in Horn Logic rendering it executable

Page 7: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Denotational Semantics

• A well established methodology for design, description and analysis of programming languages

• The denotational semantics of language L has three components:

• Syntax Specification: Map sentences of Language L into syntax trees

• Semantic Algebra: Represents the Mathematical objects and associated operations

• Valuation Functions: Functions to map syntax tree to elements of semantic algebra

Page 8: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Horn Logical Semantics

Traditional Denotational Definitions:

Syntax BNF Grammars

Semantic Algebra

Valuation FunctionsLambda Calculus

Horn Logical Semantics:

Syntax

Semantic Algebra

Valuation Functions

Horn Logic

Page 9: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Advantage of using Horn Logical Semantics

• Parser can be easily obtained:

BNF specification of language L

Definite Clause Grammar

PARSER Prolog System

Semantic Algebra and Valuation Functions can also be coded in Horn Logic

Page 10: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Semantics-based Language Translation

Valuation Functions

DCG for Ls DCG for Lt

Language Ls Language Lt

Parse Trees

Page 11: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Application to the web

• Current Web:– Translate one XML to another

– Convert HTML to voiceXML

• Semantic Web:– RDF, RDFS, DAML+OIL and other query languages

like RDQL, RQL, etc. can be rapidly translated into executable notations

• This paper mainly focuses on RDF and RDQL

Page 12: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Denotational Semantics of RDF

The statements of the RDF data model (triples) can be thought of as the equivalent of ground facts in a logic based language

RDF Statements property(S, P, O)

S has property P with value O

DCG for RDF Semantic Specification

Page 13: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

DCG for RDF(Syntax Specification)

Automatically yields a parser

DCG rules for RDF can easily be obtained from the BNF specification of the RDF grammar

propAttr ::= propName ‘=“’ string ‘”’

propAttr(propAttr(PN,S)) propname(PN),[‘=“’],string(S),[‘”’].

BNF rule:

DCG rule:

Page 14: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Example OutputRDF STATEMENT:

<rdf:RDF><rdf:Description about="http://www.w3.org">

<s:Publisher>World Wide Web Consortium</s:Publisher><s:Title>W3C Home Page</s:Title>

</rdf:Description></rdf:RDF>

PARSE TREE:

r(o (description(idaboutattr(aboutattr(uriref(string(“http://www.w3.org”)))),(propertyel(propname(qname(nsprefix(s), name(publisher))), value(string(“World Wide Web Consortium”)),

propname(qname(nsprefix(s), name(publisher)))),

propertyelt(propname(qname(nsprefix(s), name(title))), value(string(“W3C Home Page”)), propname(qname(nsprefix(s), name(publisher)))),

) ) ) ) )

Page 15: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Semantic Specification for RDF

The semantic function maps the parse tree to a database of ground facts (property relations)

Property(S,P,O)

Property(S,P,O)

… … … … …

… … … … …

The output parse tree is semantically processed to identify the subject, predicate and object which in turn are used to generate the ground facts

propertyelts((PE,PEs),PSTR,VSTR,IASTR) :- propertyelt(PE,IASTR,PSTR,VSTR), assemble(IASTR,PSTR,VSTR),

propertyelts(PEs,PSTR1,VSTR1,IASTR).

Page 16: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Example OutputPARSE TREE:

r(o (description(idaboutattr(aboutattr(uriref(string(“http://www.w3.org”)))),(propertyelt(propname(qname(nsprefix(s), name(publisher))), value(string(“World Wide Web Consortium”)),

propname(qname(nsprefix(s), name(publisher)))),

propertyelt(propname(qname(nsprefix(s), name(title))), value(string(“W3C Home Page”)), propname(qname(nsprefix(s), name(publisher)))),

) ) ) ) )

DENOTATION:

property(“http://www/w3.org”, publisher, “World Wide Web Consortium”).property(“http://www/w3.org”, title, “W3C Home Page”).

Page 17: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Syntax and Semantic specification of RDQL

• SQL like query language for RDF developed by HP labs

• Query of the formSELECT varsFROM documentsWHERE expressionsAND filtersUSING Namespace declarations

• Syntax and semantics can be specified in the same way as that of RDF

Page 18: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Example Output

RDQL Query: SELECT ?a ?bWHERE(?a, pred, ?b)AND ?b > 250

Denotation: :-property(X, pred, Y), Y > 250.•

r(query(slctclause(scvar(ridentifier(x)), commascvar(scvar(ridentifier(y)))), trptnclause(trpattern(varOruri(var(ridentifier(x))), varOruri(uri(uri2)), varOrliteral(var(ridentifier(y))))), constraintclause(expr(condOrexpr(condXorexpr(condAndexpr(valuelogical(streqexpr(numlogical(inclOrexpr(exclOrexpr(andexpr(aritcond(eqexpr(ltrelationalexpr(numericexpr(shiftexpr(addexpr(multexpr(unaryexpr(unaryexprntplmi(primaryexpr(var(ridentifier(y))))))))), numericexpr(shiftexpr(addexpr(multexpr(unaryexpr(unaryexprntplmi(primaryexpr(literal(numliteral(2)))))))))))))))))))))))))

Parse Tree:•

Page 19: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Querying the Data

property(S,P,O)property(S,P,O)

… … … …

RDF DATA RDQL QUERIES

property(S,P,O)property(S,P,O)

… … … …

RESULTS

PROLOG

Page 20: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Current Status

• Developed a complete Horn Logic denotational executable semantics for RDF

• This took less than 2 weeks of work

• Tested the semantics on almost all the test cases present in RDF Test Cases working draft

• Change in syntax and semantics can be made with negligible effort

Page 21: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

• Developed the syntax specification part of RDQL

• Working on the semantics specification part of RDQL

Current Status

Page 22: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.

Conclusion• This approach of querying RDF documents illustrates

the power of logic• Not only is the executable notation based on logic, but

the means of semantically translating RDF and Query Languages into logic also relies on logic

• The main advantage of this is that semantic translators can be rapidly developed

• As a result as the markup languages rapidly evolve as they have from HTML to XML to RDF and DAML, they can be processed and queried with the same rapidity

Page 23: Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.