a multi-theory logic language for the world wide web

20
A Multi-theory Logic Language for the World Wide Web Giulio Piancastelli and Andrea Omicini 24th International Conference on Logic Programming (ICLP 2008) Udine, December 9-13, 2008

Upload: gpiancastelli

Post on 31-Aug-2014

1.858 views

Category:

Technology


0 download

DESCRIPTION

Despite the recent formalization of the Web in terms of Representational State Transfer (REST) architectural style and Resource-Oriented Architecture (ROA), current tools for Web programming generally misunderstand its design. Based on REST/ROA insights, we claim that logic languages are suited for promoting the Web architecture and principles. The mapping of REST/ROA abstractions onto elements of Contextual Logic Programming also permits runtime modification of resource behavior. In this paper we present Web Logic Programming as a Prolog-based language for the Web embedding REST/ROA principles, meant to be the basis of an application framework for rapid prototyping.

TRANSCRIPT

Page 1: A Multi-theory Logic Language for the World Wide Web

A Multi-theory Logic Language for the World Wide Web

Giulio Piancastelli and Andrea Omicini24th International Conference on Logic Programming (ICLP 2008)

Udine, December 9-13, 2008

Page 2: A Multi-theory Logic Language for the World Wide Web

Purpose

Bring principles, abstractions, and insights from the Web architecture to research on the use of logic programming for Web application prototyping

Page 3: A Multi-theory Logic Language for the World Wide Web

Resource

Any conceptual target of a hypertext reference

Composed of:• identifier (URI)• data• behavior

Page 4: A Multi-theory Logic Language for the World Wide Web

http://example.com/sales/2004/Q4

Page 5: A Multi-theory Logic Language for the World Wide Web

http://example.com/sales/2004/Q4

f(a).r(P, Q) :- s(P), t(Q).

R

T(R)

Page 6: A Multi-theory Logic Language for the World Wide Web

http://example.com/sales/2004/Q4

Rhttp://example.com/sales/2004/

R1

T(R1)

T(R)

Page 7: A Multi-theory Logic Language for the World Wide Web

http://example.com/sales/

R2

http://example.com/sales/2004/Q4

Rhttp://example.com/sales/2004/

R1

T(R1)

T(R)

T(R2)

Page 8: A Multi-theory Logic Language for the World Wide Web

http://example.com/sales/2004/Q4

Rhttp://example.com/sales/2004/

R1

T(R1)

T(R)http://example.com/sales/

R2

T(R2)

Page 9: A Multi-theory Logic Language for the World Wide Web

R

http://example.com/sales/Q42004/

http://example.com/sales/2004/Q4

Rhttp://example.com/sales/2004/

R1

T(R1)

T(R)http://example.com/sales/

R2

T(R2)

Page 10: A Multi-theory Logic Language for the World Wide Web

Implicit Resources

Resources representing recurring concepts in Web development that are always attached to the bottom of any context• the session with the application• the user

• the application itself• the deployment environment

Page 11: A Multi-theory Logic Language for the World Wide Web

HTTP

GET /sales/2004/Q4 HTTP/1.1Host: example.com

Page 12: A Multi-theory Logic Language for the World Wide Web

HTTP

GET /sales/2004/Q4 HTTP/1.1Host: example.com

Method Information: how thereceiver has to process therequest

'/sales/2004/Q4' : get(Request, Response, View).

Page 13: A Multi-theory Logic Language for the World Wide Web

HTTP

GET /sales/2004/Q4 HTTP/1.1Host: example.com

Scope Information: the datawhere the receiver shouldoperate the method

'/sales/2004/Q4' : get(Request, Response, View).

Page 14: A Multi-theory Logic Language for the World Wide Web

/r2/r1/r

get(_, _, V) :- a, b, c(V).a :- p, q, r.

R

T(R)

Page 15: A Multi-theory Logic Language for the World Wide Web

/r2/r1

R1

/r2/r1/r

get(_, _, V) :- a, b, c(V).a :- p, q, r.

R

T(R)

Page 16: A Multi-theory Logic Language for the World Wide Web

/r2

R2

/

root

/r2/r1

R1

/r2/r1/r

get(_, _, V) :- a, b, c(V).a :- p, q, r.

R

T(R)

p :- x, y, z.x.

T(root)

Page 17: A Multi-theory Logic Language for the World Wide Web

/r2

R2

/

root

/r2/r1

R1

/r2/r1/r

get(_, _, V) :- a, b, c(V).a :- p, q, r.

R

T(R)

p :- x, y, z.x.

T(root)

Page 18: A Multi-theory Logic Language for the World Wide Web

Dynamic Resource Behavior (1)

Two or more URIs can be associated to the same resource: resources may live in different contexts at the same time and feature different behavior according to the context where the computation takes place.

Page 19: A Multi-theory Logic Language for the World Wide Web

Dynamic Resource Behavior (2)

Behavioral rules are expressed as first-class abstractions in logic programming languages, where programs can be treated as data: the HTTP protocol allows changing resource data by using the PUT method, so that runtime behavioral changes of a resource in a context are possible.

Page 20: A Multi-theory Logic Language for the World Wide Web

A Multi-theory Logic Language for the World Wide Web

Giulio Piancastelli and Andrea Omicini24th International Conference on Logic Programming (ICLP 2008)

Udine, December 9-13, 2008