LarKC Tutorial at ISWC 2009 - Urban Computing

28
Understanding and Understanding and Manipulating the Urban Manipulating the Urban Computing workflows Computing workflows http://wiki.larkc.eu/UrbanComputing/ http://wiki.larkc.eu/UrbanComputing/ Daniele Dell’Aglio Emanuele Della Valle [email protected] [email protected] Joint work with: CEFRIEL: I. Celino, D.Dell’Aglio SALTLUX: K. Kim, S. Park VUA: Z. Huang SIEMENS: V.Tresp, Y. Huang, F. Steinke H. Werner

description

The aim of the EU FP 7 Large-Scale Integrating Project LarKC is to develop the Large Knowledge Collider (LarKC, for short, pronounced “lark”), a platform for massive distributed incomplete reasoning that will remove the scalability barriers of currently existing reasoning systems for the Semantic Web. The LarKC platform is available at larkc.sourceforge.net. This talk, is part of a tutorial for early users of the LarKC platform, and describes a particular use case aimed at Urban Computing.

Transcript of LarKC Tutorial at ISWC 2009 - Urban Computing

Page 1: LarKC Tutorial at ISWC 2009 - Urban Computing

Understanding and Manipulating Understanding and Manipulating the Urban Computing workflowsthe Urban Computing workflows

http://wiki.larkc.eu/UrbanComputing/ http://wiki.larkc.eu/UrbanComputing/

Daniele Dell’Aglio Emanuele Della Valle [email protected] [email protected]

Joint work with:CEFRIEL: I. Celino, D.Dell’Aglio SALTLUX: K. Kim, S. Park VUA: Z. Huang SIEMENS: V.Tresp, Y. Huang, F. Steinke H. Werner

Page 2: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

[source IEEE Pervasive Computing,July-September 2007 (Vol. 6, No. 3)]

Context – Urban Computing

2Terra Cognita Workshop, 26-10-2009

The integration of computing, sensing, and actuation technologies into everyday urban settings and lifestyles.

Page 3: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Context – Urban Data Availability

• Some years ago, due to the lack of data, Urban Computing looked like a Sci-Fi idea.

• Nowadays, a large amount of the required informationlarge amount of the required information can be made available on the Internetavailable on the Internet at almost no cost. We are running a survey [1,2] and we have collected more than 50 sources of data:

– mapsmaps (Google,Yahoo!, Wikimapia, OpenStreetMap ),– eventsevents scheduled (Eventful, Upcoming…),– voluntarily-provided usersusers locationlocation (Google Latitude),– multimediamultimedia data with information about location (Flickr…)– relevant placesplaces (schools, bus stops, airports...)– traffictraffic information (accidents, problems of public transportation...)– citycity lifelife (job ads, pollution, health care...)

[1] http://wiki.larkc.eu/UrbanComputing/ShowUsABetterWay [2] http://wiki.larkc.eu/UrbanComputing/OtherDataSources

32nd Early Adopters Workshop, 25-10-2009

Page 4: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Sample Usage Scenario: Alpha Urban LarKC

• A user is in a (potentially unknown) city and would like to organize a organize a day/nightday/night by visiting some places, meeting his friends, attending a music concert, etc.

• He therefore needsneeds to:– Find interesting destinationsinteresting destinations

• Monuments or relevant places opened at the right time• People he knows who happen to be in the same city• Music or cultural events scheduled for that day

– Understand the most suitable way to reach themmost suitable way to reach them• Shortest path or “sightseeing” path• Most suitable combination of transportation means (car, parking,

subway, pedestrian)

• To solve the problem today, the user would have to use multiple applicationsapplications, manually checkcheck his requirements, manuallymanually passing intermediateintermediate resultsresults from a service to another one

42nd Early Adopters Workshop, 25-10-2009

Page 5: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Alpha Urban LarKC challenges

• IntegrationIntegration of multiple distributed data sources

• Overcoming data and system heterogeneityheterogeneity

• Selection of the relevantrelevant subsetsubset of data to be processed (problem of scalescale)

• Dealing with real-timereal-time requirements

• (Potentially) profilation and personalizationpersonalization of the service based on user preferences

• …

52nd Early Adopters Workshop, 25-10-2009

Page 6: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Alpha Urban LarKC at a glace

DataRequest

Web RetrievedData

PROBLEM: Which Milano

monuments or events can I

quickly get to from here?

PROBLEM: Which Milano

monuments or events can I

quickly get to from here?

StreetsMonumentsEventsData & Tools

PLATFORMSPARQLquery

SPARQLresult

Live Demo of the client application: http://seip.cefriel.it/alpha-Urban-LarKC/ A demonstration video: http://seip.cefriel.it/alpha-Urban-LarKC/alpha-Urban-LarKC-demo.htm

62nd Early Adopters Workshop, 25-10-2009

Page 7: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Alpha Urban LarKC workflows

• The Alpha Urban LarKC is composed by 3 different workflows:

– monument destinationselection workflow

– event destination selection workflow

– path finding workflow

72nd Early Adopters Workshop, 25-10-2009

DataRequest

Web RetrievedData

PLATFORMSPARQLquery

SPARQLresult

StreetsEvents

Page 8: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Monument Destination Selection Worflow

• To select monuments in Milano: – a Transformer analyzes the query to get the triple patterns to be

passed to the Identifier – the Identifier queries Sindice to get relevant RDF documents – a Selector filters the documents to extract information about

relevant monuments and – a Reasoner answers the query

82nd Early Adopters Workshop, 25-10-2009

Page 9: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Alpha Urban LarKC workflows

• The alpha Urban LarKC is composed by 3 different workflows:

– monument destinationselection workflow

– event destination selection workflow

– path finding workflow

92nd Early Adopters Workshop, 25-10-2009

DataRequest

Web RetrievedData

PLATFORMSPARQLquery

SPARQLresult

StreetsEvents

Page 10: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Events retrieval

• Actually in the Web a big amount of information related to events of every kind is available:

– Music

– Sport

– Education

– …

• There are several Web 2.0 sites where communities contribute inserting and managing event notifications

• In addition, these sites offer REST/SOAP services allowing interaction with applications and services

• We tried to integrate these data sources in the Alpha Urban LarKC

102nd Early Adopters Workshop, 25-10-2009

Page 11: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Events representation

• Every site uses a custom model to represent the events (usually described in the API documentation) and offers the information in XML and JSON formats

• On the other side, the Semantic Web community has developed several vocabularies useful to represent events descriptions in RDF:

– RDF Calendar – an RDF representation of iCalendar– Talis Address schema – to represent information about

locations (country, cities, postal codes...) – Geo – a vocabulary to express geo-location

coordinates– SKOS – to represent the events categories

112nd Early Adopters Workshop, 25-10-2009

Page 12: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Query: SPARQL query to get the events

• Using the vocabularies described above it’s possible to write a query to retrieve events. SELECT ?e ?s ?summary ?cat ?desc ?l ?lab ?lat ?lngWHERE{

?e rdf:type rdfcal:Vevent.?e rdfcal:summary ?summary. ?e rdfcal:description ?desc. ?e skos:subject ?cat. ?e geo:location ?l. ?l addr:localityName “Washington".?l rdfs:label ?lab. ?l geo:lat ?lat. ?l geo:long ?lng. ?e rdfcal:dtstart ?s . FILTER(

?s > xsd:dateTime("2009-10-25T00:00:00Z") && ?s < xsd:dateTime("2009-10-25T23:59:59Z")).

}

122nd Early Adopters Workshop, 25-10-2009

Page 13: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Event Selection Workflow

• In order to retrieve events in LarKC we developed a workflow composed by:

– a query Transformer processes the input SPARQL query and extracts location and time information

– an Identifier queries Eventful to get a list of events and passes the references to

– a Transformer, which translates the REST service XML response in RDF

– a Selector passes on all the triples to

– a Reasoner, which answers the query

132nd Early Adopters Workshop, 25-10-2009

Page 14: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

SparqlToCityQuery Transformer (1/2)

• The query Transformer processes the input SPARQL query to extract the location and time information.

• The time information (red part) is a temporal range and it is simply extracted from the FILTER constraints

• Regarding the location information (blue part), in the query only the name of the city (and optionally the name of the country) is available.

– Using only the name some events could not be retrieved (“Milano” vs “Milan”).

– It will be possible to obtain more complete and precise responses if city coordinates are used

– To get the coordinates of a city the plug-in interacts with GeoNames Web service

142nd Early Adopters Workshop, 25-10-2009

Query:...?e geo:location ?l. ?l rdfs:label ?lab. ?l geo:lat ?lat. ?l geo:long ?lng. ?l addr:localityName “Washington D.C.".

?e rdfcal:dtstart ?s . FILTER(?s > xsd:dateTime("2009-10-25T00:00:00Z") && ?s < xsd:dateTime("2009-10-25T23:59:59Z"))....

Page 15: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

SparqlToCityQuery Transformer (2/2)

CODE INSPECTIONeu.larkc.plugin.transform.urbancomputing.ubl.SparqlToCityQueryTransformer

(from row 120)

152nd Early Adopters Workshop, 25-10-2009

Page 16: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Event Identifier (1/2)

• The Identifier receives the location and time information from the Transformer.

• It uses this information to preparare an invokation for the Eventful REST service and to get the list of the events

• Starting from this list, the plug-in build a set of XMLDocument objects containing:

– the link of the XML describing the event

– a pointer to a XSLT file to perform the translation in RDF/XML

162nd Early Adopters Workshop, 25-10-2009

Page 17: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Event Identifier (2/2)

CODE INSPECTIONeu.larkc.plugin.identify.urbancomputing.ubl.EventIdentifier

(from row 95)

172nd Early Adopters Workshop, 25-10-2009

Page 18: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

XML2RDF Tranformer (1/2)

• The InformationSet Transformer receives a couple: <XML, XSLT> (contained in a XMLDocument object)

• It loads the XML file from Eventful and the XSL file and it performs the XSLT transformation

• The result is an RDF graph containing the event description

• If two or more events are retrieved by the Event Identifier, the LarKC platform will invoke the XML2RDF Transformer several times (one for each XML document)

182nd Early Adopters Workshop, 25-10-2009

Page 19: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

XML2RDF Tranformer (2/2)

CODE INSPECTIONeu.larkc.plugin.transform.urbancomputing.ubl.XML2RDFTransformer

(from row 73)

192nd Early Adopters Workshop, 25-10-2009

Page 20: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Alpha Urban LarKC workflows

• The alpha Urban LarKC is composed by 3 different workflows:

– monument destinationselection workflow

– event destination selection workflow

– path finding workflow

202nd Early Adopters Workshop, 25-10-2009

DataRequest

Web RetrievedData

PLATFORMSPARQLquery

SPARQLresult

StreetsEvents

Page 21: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Input data: Street Topology in RDF

Classes:• Node• LinkProperties (domain / range):• from (Link / Node)• to (Link / Node)• lat (Node / xsd:Float)• long (Node / xsd:Float)• linkWeight (Link / xsd:Float)

A type Node.B type Node.D type Node.A lat 9.456.A long 45.123.

l1 type Link.l1 from A.l1 to B.l1 linkWeight 3.l2 type Link.l2 from B.l2 to D.l2 linkWeight 5.

Node definitions

Link definitions

l1

l3

l2

l4

l7

l8

l5 l6

A

B

C D

EF

3m

2m

3m

5m

4m

6m

4m

4m

9.456A

B

l1l2

D

3

5

from

fromto

tolinkWeight

linkWeight

45.123lat long

212nd Early Adopters Workshop, 25-10-2009

Page 22: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Output data: path definition in RDF

Classes:• Node• Link• Path

Properties (domain / range):• from (Link / Node)• to (Link / Node)• lat (Node / xsd:Float)• long (Node / xsd:Float)• linkWeight (Link / xsd:Float)• contain (Path / Link)• pathWeight (Path / xsd:Float)• pathFrom (Path / Node)• pathTo (Path / Node)

The new schema:

A

B

l1l2

D

3

5

from

fromto

tolinkWeight

linkWeight

p

8pathWeight

pathFrom

pathTo

containcontain

9.456

45.123

lat

long

222nd Early Adopters Workshop, 25-10-2009

Page 23: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Query: SPARQL query to get the path

• Having introduced the notion of Path and counting on a reasoner that can generate paths, the query can be expressed in plain SPARQL

SELECT ?p ?w ?n1 ?l ?n2WHERE{

?p rdf:type Path.?p pathFrom <startingNode>.?p pathTo <endingNode>.?p contain ?l.?l from ?n1.?l to ?n2.?p pathWeight ?w

} ORDER BY ?w

Note: this is a simplification, the query should request also the coordinates of each node

232nd Early Adopters Workshop, 25-10-2009

Page 24: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Alpha Urban LarKC Path Finding Workflow 1

• Decider AlphaUrbanLarkcDecider

• Identifier RemoteGraphLoaderIdentifier

• Selecter GrowingDatasetSelecter

• Reasoner OpResPathFinderReasoner

DeciderDecider

SPARQLResult

SPARQLResult

SPARQL Query

SPARQL Query

LocalPlug-in Manager

LocalPlug-in Manager

IdentifierIdentifier

Plug-in APIPlug-in API

LocalPlug-in Manager

LocalPlug-in Manager

SelectorSelector

Plug-in APIPlug-in API

LocalPlug-in Manager

LocalPlug-in Manager

ReasonerReasoner

Plug-in APIPlug-in API

242nd Early Adopters Workshop, 25-10-2009

Page 25: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Identifier strategy

• Selection of the whole graph (in this case the one of the Milano centre area)

• Implemented in RemoteGraphLoaderIdentifier

252nd Early Adopters Workshop, 25-10-2009

Page 26: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

OpResPathFinder Reasoner (1/2)

• In order to process the most desirable path we choose to follow a Operational Research approach

– the Milano graph described in RDF is converted in a suitable form

– Dijkstra’s algorithm is applied to find a path between the start and the goal node

262nd Early Adopters Workshop, 25-10-2009

Page 27: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

OpResPathFinder Reasoner (2/2)

CODE INSPECTIONeu.larkc.plugin.reason.urbancomputing.ubl. OpResPathFinderReasoner

(from row 85)

272nd Early Adopters Workshop, 25-10-2009

Page 28: LarKC Tutorial at ISWC 2009 - Urban Computing

For more information visit http://wiki.larkc.eu/UrbanComputing

Much more to come!

28

Keep an eye on http://wiki.larkc.eu/UrbanComputing

282nd Early Adopters Workshop, 25-10-2009