31
Miel Vander Sande @miel_vds Publish Data as Time consistent Web API

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

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: 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 !

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

Cultural Heritage – Open Data !

ARCHIVE & DESSIMINATE metadata or data !

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

Web

API

R R

API

R R

API

R R

Resource-oriented scalable & easily combined !

Linked Data, Mashups, Web applicationS

HTTP !

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

API

R R

API

R R

Resources’ value (state) change over time !

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

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!

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

Memento

DateTime negotiation over HTTP !

Constant state over resources !

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

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

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

M M M

Memento

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

R TG

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

M M M M

Memento

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

M M M M R TG

GET !Accept-Datetime:!

2014-05-14T00:00:00!

302 Found !Location: URI-M!

Memento

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

M1 M3 M4 M2

Mementos: encapsulated prior states with timestamp !

Memento

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

M1 M3 M4 M2

Select last valid Memento at given Datetime!

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

Memento

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

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

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

Each API works with!

Own Archiving System !Own Storage Access !

Own File Formats !

Custom implementation required !

Memento

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

Publish data as !TIME CONSISTENT API

Storage! API ! Memento !

Data management!

Versioning!

Publishing Resources !

HTTP interaction !

Datetime negotiation !

DYNAMIC + GENERIC ??

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

PROVENANCE !Who, WHEN & WHAT

happened to my resources? !

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

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

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

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.

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

Publish data as !TIME CONSISTENT API

Storage! API ! Memento !

Data management!

Versioning!

Publishing Resources !

HTTP interaction !

Datetime negotiation !

PROVENANCE

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

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!

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

1. Versioning & MANAGING FILES!

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

http://git2prov.org�

Data Commits Provenance

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

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

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

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

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

GIT !

2. CREATING THE API!

API ! L M M M V

Link: provenance! describes !

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

PROV

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

API !

GMP ! R TG M M M M

L PROV M M M V

GET !Link: provenance! describes !

GET ! GET !

3. GENERIC Memento PROXY

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

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!

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

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

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

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

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

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> .

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

Publish data as !TIME CONSISTENT API

Storage! API ! Memento !

Data management!

Versioning!

Publishing Resources !

HTTP interaction !

Datetime negotiation !

DYNAMIC + GENERIC ??

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

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

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

Miel Vander Sande!@miel_vds !