Publish data as Time Consistent Web API based on Provenance (WS-REST 2014)

Post on 05-Dec-2014

1.299 views 0 download

description

 

Transcript of Publish data as Time Consistent Web API based on Provenance (WS-REST 2014)

Miel Vander Sande!@miel_vds !

Publish Data as !Time consistent !

Web API !

Cultural Heritage – Open Data !

ARCHIVE & DESSIMINATE metadata or data !

Web

API

R R

API

R R

API

R R

Resource-oriented scalable & easily combined !

Linked Data, Mashups, Web applicationS

HTTP !

API

R R

API

R R

Resources’ value (state) change over time !

APIs only publish most recent state!

Resource state changes lead to inconsistenties in mashup results !

http://example.com/average-income!http://example.com/unemployment-rate!

2004

2012 InaccuRate MASHUP!

Memento

DateTime negotiation over HTTP !

Constant state over resources !

Van de Sompel et al.!http://mementoweb.org!

R TG M Original Resource! TimeGate! Memento(s)!

M M M

Memento

R TG

GET ! 200 OK!Link: URI-TG;!type=timegate!

M M M M

Memento

M M M M R TG

GET !Accept-Datetime:!

2014-05-14T00:00:00!

302 Found !Location: URI-M!

Memento

M1 M3 M4 M2

Mementos: encapsulated prior states with timestamp !

Memento

M1 M3 M4 M2

Select last valid Memento at given Datetime!

GET URI-TG !Accept-Datetime: 2014-05-15T00:00:00!

Memento

M M M M R

GET !

TG

200 OK!Link: URI-R;type=original!

Link: URI-Mn;type=next!Link: URI-Mp;type=previous !

Memento

Each API works with!

Own Archiving System !Own Storage Access !

Own File Formats !

Custom implementation required !

Memento

Publish data as !TIME CONSISTENT API

Storage! API ! Memento !

Data management!

Versioning!

Publishing Resources !

HTTP interaction !

Datetime negotiation !

DYNAMIC + GENERIC ??

PROVENANCE !Who, WHEN & WHAT

happened to my resources? !

M1 M3 M4 M2

Provenance !describes when resource values change!Was revision of Was revision of Was revision of

A2 A4 A3 A1 generated generated generated generated

PROV-O!provenance in RDF!

<Resource> prov:wasRevisionOf <Resource/M3>; prov:wasGeneratedBy :rev4.

:rev4 prov:endedAtTime "2014-06-10T14:30:00Z"^^xsd:dateTime.

<Resource/M3> prov:wasRevisionOf <Resource/M2>; prov:wasGeneratedBy :rev3.

:rev3 prov:endedAtTime "2014-05-14T14:30:00Z"^^xsd:dateTime.

Publish data as !TIME CONSISTENT API

Storage! API ! Memento !

Data management!

Versioning!

Publishing Resources !

HTTP interaction !

Datetime negotiation !

PROVENANCE

7+(�'$7$7$1.

$L �D���������/

85,�$L �F�������85,�/�G��3 �

85,�0L 85,�* 85,�5

�E��3Provenance!

Provenance*!

File versions !

Version Resources !

File!

File Resource!

1. Versioning & MANAGING FILES!

PROV CSV CSV-Cx CSV-Cx CSV-Cx CSV-Cx

http://git2prov.org�

Data Commits Provenance

2. CREATING THE API!POST !/api/definitions !{ “uri”: file-url, “type”: “text/csv”, “Delimiter”: “,” }

The DataTank: instant REST API for heteregeneous data !

file-url

commit-url

PROV

7+(�'$7$7$1.

$L �D���������/

85,�$L �F�������85,�/�G��3 �

85,�0L 85,�* 85,�5

�E��3

2. CREATING THE API!

200 OK!Location: URI-L!

The DataTank: instant REST API for heteregeneous data !

PROV

L 7+(�'$7$7$1.

$L �D���������/

85,�$L �F�������85,�/�G��3 �

85,�0L 85,�* 85,�5

�E��3

GIT !

2. CREATING THE API!

API ! L M M M V

Link: provenance! describes !

CSV CSV-Cx CSV-Cx CSV-Cx CSV-Cx

PROV

API !

GMP ! R TG M M M M

L PROV M M M V

GET !Link: provenance! describes !

GET ! GET !

3. GENERIC Memento PROXY

Decision Engine

GENERIC Memento PROXY

TG

PROV

GET !Accept-Datetime:!

2014-05-14T00:00:00!

N3 rules

EYE Reasoner

M

+ V

302 Found !Location: URI - M!

DeCISION LOGIC WITH SEMANTIC REASONING!EYE reasoner and N3 rules select memento !

prov:wasRevisionOf rdfs:subPropertyOf :memento.

:memento a owl:TransitiveProperty.

:request :datetime "2014-05-15T00:00:00Z"^^xsd:dateTime

DeCISION LOGIC WITH REASONING!EYE reasoner and N3 rules select the memento !

{ :request :datetime ?req_datetime. [] e:findall (?datetime { ?rev prov:endedAtTime ?datetime . (?datetime ?req_datetime) pred:dateTime- less-than-or-equal true. } ?datetime_list) .

?datetime_list e:max ?current_datetime. ?current prov:endedAtTime ?current_datetime. } => { :response :memento ?current. }.

IF prov:endedAtTime is largest prior to given ?req_datetime

THEN !Selected memento is the !?current one

DeCISION LOGIC WITH REASONING!EYE reasoner and N3 rules select the memento !

:response :memento <Resource/M1> .

:response :next-memento <Resource/M2> .

:response :last-memento <Resource> .

Publish data as !TIME CONSISTENT API

Storage! API ! Memento !

Data management!

Versioning!

Publishing Resources !

HTTP interaction !

Datetime negotiation !

DYNAMIC + GENERIC ??

Publish data as !TIME CONSISTENT API

Storage! API ! Memento !

Data management!

Versioning!

Publishing Resources !

HTTP interaction !

Datetime negotiation !

PROVENANCE

7+(�'$7$7$1.

$L �D���������/

85,�$L �F�������85,�/�G��3 �

85,�0L 85,�* 85,�5

�E��3

7+(�'$7$7$1.

$L �D���������/

85,�$L �F�������85,�/�G��3 �

85,�0L 85,�* 85,�5

�E��3

Miel Vander Sande!@miel_vds !