SlideShare una empresa de Scribd logo
1 de 20
ISWC 2013 SSN Workshop

Demo: tablet-based visualisation
of transport data in Madrid using
SPARQLstream
Jean-Paul Calbimonte, Alejandro
Fernández Carrera, Oscar Corcho
22/10/2013

Ontology Engineering Group
Facultad de Informática, Universidad Politécnica de Madrid
jp.calbimonte@upm.es, ocorcho@fi.upm.es
Sensor Networks and the Web

users

Volume
Sensor Networks

Velocity
Variety

WEB
applications

data streams

Universal Web-based access to Sensor data
2
EMT Bus transport in Madrid
• EMT: Public transport company in Madrid

3
Waiting times
• How long do I wait for the next bus?

Only in a few bus
stops
Have to physically
go and watch

EMT wants to be
more WEB friendly
4
EMT Web Services
Bus stops

EMT
Services
https://servicios.emtmadrid.es:8
443/geo/servicegeo.asmx

getStopsLine

getArriveStop

<Stop>
<IdStop>28</IdStop><PMV>61247</PMV>
<Name>P CASTELLANA-JUZGADOS</Name>
<PostalAdress>P de la Castellana, 187</PostalAdress>
<CoordinateX>-3.68972639781606</CoordinateX>
<CoordinateY>40.4650604583015</CoordinateY>
</Stop>

Bus waiting times
<Arrives>
<Arrive>
<IdStop>30</IdStop>
<idLine>5</idLine>
<IsHead>True</IsHead>
<Destination>CHAMARTIN</Destination>
<IdBus>0000</IdBus>
<TimeLeftBus>0</TimeLeftBus>
<DistanceBus>16</DistanceBus>
<PositionXBus>-1</PositionXBus>
<PositionYBus>-1</PositionYBus>
<PositionTypeBus>0</PositionTypeBus>
</Arrive>

Ad-hoc XML model
Identifiers not web-friendly
Not ready for integration w/
other datasets

Working with EMT to define an Open Data strategy
5
data as RDF

W3C SSN Ontology

static data

Extracting data from EMT
Bus stops
<Stop>
<IdStop>28</IdStop><PMV>61247</PMV>
<Name>P CASTELLANA-JUZGADOS</Name>
<PostalAdress>P de la Castellana, 187</PostalAdress>
<CoordinateX>-3.68972639781606</CoordinateX>
<CoordinateY>40.4650604583015</CoordinateY>
</Stop>

EMT
Services
https://servicios.emtmadrid.es:8
443/geo/servicegeo.asmx

users applications

6
Static part (bus stops)
• Currently at:
• http://linkeddata4.dia.fi.upm.es:8080/sparql
• Graph: http://emt.transporte.linkeddata.es/graph/stops

• All bus stops (query)
• select distinct ?x where
{?x a <http://transporte.linkeddata.es/emt#BusStop>}

• URI:
• http://transporte.linkeddata.es/emt/busstop/id/104
• (in the process of defining the URIs)
• Could also be:
http://datos.emtmadrid.es/recurso/BusStop/104 or similar

7
data as RDF

W3C SSN Ontology

static data

Extracting data from EMT
Bus stops
<Stop>
<IdStop>28</IdStop><PMV>61247</PMV>
<Name>P CASTELLANA-JUZGADOS</Name>
<PostalAdress>P de la Castellana, 187</PostalAdress>
<CoordinateX>-3.68972639781606</CoordinateX>
<CoordinateY>40.4650604583015</CoordinateY>
</Stop>

EMT
Services
Streaming data

?

users applications

https://servicios.emtmadrid.es:8
443/geo/servicegeo.asmx

Bus waiting
times

Transform Bus waiting times to RDF Stream?
8
EMT Live data streams

Streaming data

Morphstreams

SPARQLStream queries

users

applications

9

EMT
Services
https://servicios.emtmadrid.es:8
443/geo/servicegeo.asmx

Bus waiting
times
Endpoint available

• We’ll be using this server for the hands-on:

• http://linkeddata2.dia.fi.upm.es:9000
• The instructions of a demo are on the github wiki:
• https://github.com/jpcik/morph-web/wiki/Tutorial:-Morphstreams
• Register queries
• Pull Data
• Push data through websockets
• Simple SPARQLStream endpoint

10
Querying live data streams
• Currently at:
• http://streams.linkeddata.es/emt/sparqlstream

• Example
• SELECT DISTINCT ?timeto ?obs
FROM NAMED STREAM <http://emt.linkeddata.es/data#busstops.srdf>
[NOW - 59 S]
WHERE
{ ?obs a <http://emt.linkeddata.es/data#BusObservation>.
?obs
<http://purl.oclc.org/NET/ssnx/ssn#observedBy><http://transporte.linkedd
ata.es/emt/busstop/id/2018>.
?obs <http://purl.oclc.org/NET/ssnx/ssn#observationResult> ?output.
?output <http://emt.linkeddata.es/data#timeToBusValue> ?av.
?av <http://data.nasa.gov/qudt/owl/qudt#numericValue> ?timeto. }

11
Some commands in Linux
• encoded_value=$(python -c "import urllib; print
urllib.quote('''SELECT DISTINCT ?timeto ?obs FROM
NAMED STREAM
<http://emt.linkeddata.es/data#busstops.srdf>
[NOW - 30 S] WHERE { ?obs a
<http://emt.linkeddata.es/data#BusObservation>.
?obs
<http://purl.oclc.org/NET/ssnx/ssn#observedBy><ht
tp://transporte.linkeddata.es/emt/busstop/id/2018>.
?obs
<http://purl.oclc.org/NET/ssnx/ssn#observationResul
t> ?output. ?output
<http://emt.linkeddata.es/data#timeToBusValue>
?av. ?av
<http://data.nasa.gov/qudt/owl/qudt#numericValue
12
Sample result
{
"head": {
"vars": [ "timeto" , "obs" ]
},
"results": {
"bindings": [
{
"timeto": { "datatype": "http://www.w3.org/2001/XMLSchema#string" ,
"type": "typed-literal" , "value": "0" } ,
"obs": { "type": "uri" , "value":
"http://transporte.linkeddata.es/emt/busstop/id/2018/busline/9/observation/20/09/
2013%2010:28:19%20%2B0200" }
}
]
}
}

13
Configuring Morph-streams
• Main ingredients:
1. Data streams
Link both models

2. Ontology (network)
3. R2RML mappings

14
SSN Ontology with other ontologies

W3C SSN Ontology

tool for modeling our sensor data
combine with domain ontologies
15
R2RML mappings
busObservation a rr:TriplesMap;
rr:logicalTable :emtStream;
rr:subjectMap [
rr:template "http://transporte.linkeddata.es/emt/busstop/id/{stopid}/busline/{lineid}/observation/{timed}";
rr:class emt:BusObservation;
rr:graph emt:busstops.srdf ];
rr:predicateObjectMap [
rr:predicateMap [ rr:constant ssn:observedProperty ];
rr:objectMap [ rr:constant emt:time_to_bus ]];
rr:predicateObjectMap [
rr:predicateMap [ rr:constant ssn:observationResult ];
rr:objectMap [ rr:parentTriplesMap :busOutput; rr:joinCondition "" ]];

busOutput a rr:TriplesMap;
rr:logicalTable :emtStream;
…

16
morph-streams: Ontology-based query rewriting
SELECT ?waittime ?stop
FROM NAMED STREAM
<http://emt.linkeddata.es/data#busstops.srdf> [NOW 300 S]
WHERE {
?obs a emt:BusObservation;
ssn:observedBy ?stop.
ssn:observationResult ?result.
?result emt:timeToBusValue ?av.
?av qudt:numericValue ?waittime.
}

ω 300 second

emt
SELECT timetobus, stopid
FROM emt.win:time(300 second)

Query
rewriting

SPARQLStream

Client

π Timetobus,stopid

Algebra
expression

R2RML
Mappings

[triples/bin
dings]

Esper

Query
Processing

Data
translation

[tuples]

GSN

pull/push

Cosm

Other

SPARQLStream query processing

17
SPARQLStream query
Get Bus waiting times
for a stop URI

SPARQL
endpoint

Map4RDF
iOS

SPARQLStream
endpoint

EMT Map4RDF iOS

SPARQL query

Get Bus stops data
and location

18

Morph-streams
EMT Live
Services
R2RML
Mappings

Waiting
times feed
Map4RDF iOS

19
Conclusions
• A bit of evangelization at EMT
•
•
•
•
•

Use of Web standards for Open Data
Use URIs for identifying stops, bus lines, etc
Use well defined sensor ontologies (SSN)
Use standard geolocation vocabularies
Mix static and streaming dat through URIs

• From the developer point of view
• JSON results easy to consume
• SPARQLstream endpoint through HTTP GET

• The Demo is a very simple but practical example of
how this can be done fairly easily
20

Más contenido relacionado

Similar a Demo: tablet-based visualisation of transport data in Madrid using SPARQLstream

Laporan Praktikum Keamanan Siber - Tugas 4 -Kelas C - Kelompok 3.pdf
Laporan Praktikum Keamanan Siber - Tugas 4 -Kelas C - Kelompok 3.pdfLaporan Praktikum Keamanan Siber - Tugas 4 -Kelas C - Kelompok 3.pdf
Laporan Praktikum Keamanan Siber - Tugas 4 -Kelas C - Kelompok 3.pdf
IGedeArieYogantaraSu
 
Transport for London: Using data to keep London moving
Transport for London: Using data to keep London movingTransport for London: Using data to keep London moving
Transport for London: Using data to keep London moving
WSO2
 
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
confluent
 
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQLIngesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Guido Schmutz
 
VEHICULAR 2020 Presentation by Kohei Hosono
VEHICULAR 2020 Presentation by Kohei HosonoVEHICULAR 2020 Presentation by Kohei Hosono
VEHICULAR 2020 Presentation by Kohei Hosono
Kohei Hosono
 

Similar a Demo: tablet-based visualisation of transport data in Madrid using SPARQLstream (20)

Visual c
Visual cVisual c
Visual c
 
Final year project working documentation 2020
Final year project working documentation 2020Final year project working documentation 2020
Final year project working documentation 2020
 
Smarter Cities czyli inteligente miasta wg IBM
Smarter Cities czyli inteligente miasta wg IBMSmarter Cities czyli inteligente miasta wg IBM
Smarter Cities czyli inteligente miasta wg IBM
 
BSTM-MM in VISUM
BSTM-MM in VISUMBSTM-MM in VISUM
BSTM-MM in VISUM
 
Transport for London - Using Data to Keep London Moving
Transport for London - Using Data to Keep London MovingTransport for London - Using Data to Keep London Moving
Transport for London - Using Data to Keep London Moving
 
Laporan Praktikum Keamanan Siber - Tugas 4 -Kelas C - Kelompok 3.pdf
Laporan Praktikum Keamanan Siber - Tugas 4 -Kelas C - Kelompok 3.pdfLaporan Praktikum Keamanan Siber - Tugas 4 -Kelas C - Kelompok 3.pdf
Laporan Praktikum Keamanan Siber - Tugas 4 -Kelas C - Kelompok 3.pdf
 
IRJET- Intelligent Traffic Management System
IRJET- Intelligent Traffic Management SystemIRJET- Intelligent Traffic Management System
IRJET- Intelligent Traffic Management System
 
Transport for London: Using data to keep London moving
Transport for London: Using data to keep London movingTransport for London: Using data to keep London moving
Transport for London: Using data to keep London moving
 
Accident Avoidance and Privacy-Preserving in V2R Communication using Chord Al...
Accident Avoidance and Privacy-Preserving in V2R Communication using Chord Al...Accident Avoidance and Privacy-Preserving in V2R Communication using Chord Al...
Accident Avoidance and Privacy-Preserving in V2R Communication using Chord Al...
 
Streaming sql w kafka and flink
Streaming sql w  kafka and flinkStreaming sql w  kafka and flink
Streaming sql w kafka and flink
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
 
FAPESP_Beamer
FAPESP_BeamerFAPESP_Beamer
FAPESP_Beamer
 
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
 
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQLIngesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
 
IRJET- Smart Railway System using Trip Chaining Method
IRJET- Smart Railway System using Trip Chaining MethodIRJET- Smart Railway System using Trip Chaining Method
IRJET- Smart Railway System using Trip Chaining Method
 
VEHICULAR 2020 Presentation by Kohei Hosono
VEHICULAR 2020 Presentation by Kohei HosonoVEHICULAR 2020 Presentation by Kohei Hosono
VEHICULAR 2020 Presentation by Kohei Hosono
 
water resources
water resourceswater resources
water resources
 
Ijcet 06 09_004
Ijcet 06 09_004Ijcet 06 09_004
Ijcet 06 09_004
 
Smart Transport for benefit of employees, logistics & freight carriers
Smart Transport for benefit of employees, logistics & freight carriersSmart Transport for benefit of employees, logistics & freight carriers
Smart Transport for benefit of employees, logistics & freight carriers
 
Railway Reservation System initial django.pptx
Railway Reservation System initial django.pptxRailway Reservation System initial django.pptx
Railway Reservation System initial django.pptx
 

Más de PlanetData Network of Excellence

A Contextualized Knowledge Repository for Open Data about Trentino
A Contextualized Knowledge Repository for Open Data about TrentinoA Contextualized Knowledge Repository for Open Data about Trentino
A Contextualized Knowledge Repository for Open Data about Trentino
PlanetData Network of Excellence
 
Access Control for RDF graphs using Abstract Models
Access Control for RDF graphs using Abstract ModelsAccess Control for RDF graphs using Abstract Models
Access Control for RDF graphs using Abstract Models
PlanetData Network of Excellence
 
Abstract Access Control Model for Dynamic RDF Datasets
Abstract Access Control Model for Dynamic RDF DatasetsAbstract Access Control Model for Dynamic RDF Datasets
Abstract Access Control Model for Dynamic RDF Datasets
PlanetData Network of Excellence
 
Automation in Cytomics: A Modern RDBMS Based Platform for Image Analysis and ...
Automation in Cytomics: A Modern RDBMS Based Platform for Image Analysis and ...Automation in Cytomics: A Modern RDBMS Based Platform for Image Analysis and ...
Automation in Cytomics: A Modern RDBMS Based Platform for Image Analysis and ...
PlanetData Network of Excellence
 
Heuristic based Query Optimisation for SPARQL
Heuristic based Query Optimisation for SPARQLHeuristic based Query Optimisation for SPARQL
Heuristic based Query Optimisation for SPARQL
PlanetData Network of Excellence
 

Más de PlanetData Network of Excellence (20)

Dl2014 slides
Dl2014 slidesDl2014 slides
Dl2014 slides
 
A Contextualized Knowledge Repository for Open Data about Trentino
A Contextualized Knowledge Repository for Open Data about TrentinoA Contextualized Knowledge Repository for Open Data about Trentino
A Contextualized Knowledge Repository for Open Data about Trentino
 
On Leveraging Crowdsourcing Techniques for Schema Matching Networks
On Leveraging Crowdsourcing Techniques for Schema Matching NetworksOn Leveraging Crowdsourcing Techniques for Schema Matching Networks
On Leveraging Crowdsourcing Techniques for Schema Matching Networks
 
Towards Enabling Probabilistic Databases for Participatory Sensing
Towards Enabling Probabilistic Databases for Participatory SensingTowards Enabling Probabilistic Databases for Participatory Sensing
Towards Enabling Probabilistic Databases for Participatory Sensing
 
Privacy-Preserving Schema Reuse
Privacy-Preserving Schema ReusePrivacy-Preserving Schema Reuse
Privacy-Preserving Schema Reuse
 
Pay-as-you-go Reconciliation in Schema Matching Networks
Pay-as-you-go Reconciliation in Schema Matching NetworksPay-as-you-go Reconciliation in Schema Matching Networks
Pay-as-you-go Reconciliation in Schema Matching Networks
 
On the need for a W3C community group on RDF Stream Processing
On the need for a W3C community group on RDF Stream ProcessingOn the need for a W3C community group on RDF Stream Processing
On the need for a W3C community group on RDF Stream Processing
 
Urbanopoly: Collection and Quality Assessment of Geo-spatial Linked Data via ...
Urbanopoly: Collection and Quality Assessment of Geo-spatial Linked Data via ...Urbanopoly: Collection and Quality Assessment of Geo-spatial Linked Data via ...
Urbanopoly: Collection and Quality Assessment of Geo-spatial Linked Data via ...
 
Linking Smart Cities Datasets with Human Computation: the case of UrbanMatch
Linking Smart Cities Datasets with Human Computation: the case of UrbanMatchLinking Smart Cities Datasets with Human Computation: the case of UrbanMatch
Linking Smart Cities Datasets with Human Computation: the case of UrbanMatch
 
SciQL, Bridging the Gap between Science and Relational DBMS
SciQL, Bridging the Gap between Science and Relational DBMSSciQL, Bridging the Gap between Science and Relational DBMS
SciQL, Bridging the Gap between Science and Relational DBMS
 
CLODA: A Crowdsourced Linked Open Data Architecture
CLODA: A Crowdsourced Linked Open Data ArchitectureCLODA: A Crowdsourced Linked Open Data Architecture
CLODA: A Crowdsourced Linked Open Data Architecture
 
Scalable Nonmonotonic Reasoning over RDF Data Using MapReduce
Scalable Nonmonotonic Reasoning over RDF Data Using MapReduceScalable Nonmonotonic Reasoning over RDF Data Using MapReduce
Scalable Nonmonotonic Reasoning over RDF Data Using MapReduce
 
Data and Knowledge Evolution
Data and Knowledge Evolution  Data and Knowledge Evolution
Data and Knowledge Evolution
 
Evolution of Workflow Provenance Information in the Presence of Custom Infere...
Evolution of Workflow Provenance Information in the Presence of Custom Infere...Evolution of Workflow Provenance Information in the Presence of Custom Infere...
Evolution of Workflow Provenance Information in the Presence of Custom Infere...
 
Access Control for RDF graphs using Abstract Models
Access Control for RDF graphs using Abstract ModelsAccess Control for RDF graphs using Abstract Models
Access Control for RDF graphs using Abstract Models
 
Arrays in Databases, the next frontier?
Arrays in Databases, the next frontier?Arrays in Databases, the next frontier?
Arrays in Databases, the next frontier?
 
Abstract Access Control Model for Dynamic RDF Datasets
Abstract Access Control Model for Dynamic RDF DatasetsAbstract Access Control Model for Dynamic RDF Datasets
Abstract Access Control Model for Dynamic RDF Datasets
 
Towards Parallel Nonmonotonic Reasoning with Billions of Facts
Towards Parallel Nonmonotonic Reasoning with Billions of FactsTowards Parallel Nonmonotonic Reasoning with Billions of Facts
Towards Parallel Nonmonotonic Reasoning with Billions of Facts
 
Automation in Cytomics: A Modern RDBMS Based Platform for Image Analysis and ...
Automation in Cytomics: A Modern RDBMS Based Platform for Image Analysis and ...Automation in Cytomics: A Modern RDBMS Based Platform for Image Analysis and ...
Automation in Cytomics: A Modern RDBMS Based Platform for Image Analysis and ...
 
Heuristic based Query Optimisation for SPARQL
Heuristic based Query Optimisation for SPARQLHeuristic based Query Optimisation for SPARQL
Heuristic based Query Optimisation for SPARQL
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Demo: tablet-based visualisation of transport data in Madrid using SPARQLstream

  • 1. ISWC 2013 SSN Workshop Demo: tablet-based visualisation of transport data in Madrid using SPARQLstream Jean-Paul Calbimonte, Alejandro Fernández Carrera, Oscar Corcho 22/10/2013 Ontology Engineering Group Facultad de Informática, Universidad Politécnica de Madrid jp.calbimonte@upm.es, ocorcho@fi.upm.es
  • 2. Sensor Networks and the Web users Volume Sensor Networks Velocity Variety WEB applications data streams Universal Web-based access to Sensor data 2
  • 3. EMT Bus transport in Madrid • EMT: Public transport company in Madrid 3
  • 4. Waiting times • How long do I wait for the next bus? Only in a few bus stops Have to physically go and watch EMT wants to be more WEB friendly 4
  • 5. EMT Web Services Bus stops EMT Services https://servicios.emtmadrid.es:8 443/geo/servicegeo.asmx getStopsLine getArriveStop <Stop> <IdStop>28</IdStop><PMV>61247</PMV> <Name>P CASTELLANA-JUZGADOS</Name> <PostalAdress>P de la Castellana, 187</PostalAdress> <CoordinateX>-3.68972639781606</CoordinateX> <CoordinateY>40.4650604583015</CoordinateY> </Stop> Bus waiting times <Arrives> <Arrive> <IdStop>30</IdStop> <idLine>5</idLine> <IsHead>True</IsHead> <Destination>CHAMARTIN</Destination> <IdBus>0000</IdBus> <TimeLeftBus>0</TimeLeftBus> <DistanceBus>16</DistanceBus> <PositionXBus>-1</PositionXBus> <PositionYBus>-1</PositionYBus> <PositionTypeBus>0</PositionTypeBus> </Arrive> Ad-hoc XML model Identifiers not web-friendly Not ready for integration w/ other datasets Working with EMT to define an Open Data strategy 5
  • 6. data as RDF W3C SSN Ontology static data Extracting data from EMT Bus stops <Stop> <IdStop>28</IdStop><PMV>61247</PMV> <Name>P CASTELLANA-JUZGADOS</Name> <PostalAdress>P de la Castellana, 187</PostalAdress> <CoordinateX>-3.68972639781606</CoordinateX> <CoordinateY>40.4650604583015</CoordinateY> </Stop> EMT Services https://servicios.emtmadrid.es:8 443/geo/servicegeo.asmx users applications 6
  • 7. Static part (bus stops) • Currently at: • http://linkeddata4.dia.fi.upm.es:8080/sparql • Graph: http://emt.transporte.linkeddata.es/graph/stops • All bus stops (query) • select distinct ?x where {?x a <http://transporte.linkeddata.es/emt#BusStop>} • URI: • http://transporte.linkeddata.es/emt/busstop/id/104 • (in the process of defining the URIs) • Could also be: http://datos.emtmadrid.es/recurso/BusStop/104 or similar 7
  • 8. data as RDF W3C SSN Ontology static data Extracting data from EMT Bus stops <Stop> <IdStop>28</IdStop><PMV>61247</PMV> <Name>P CASTELLANA-JUZGADOS</Name> <PostalAdress>P de la Castellana, 187</PostalAdress> <CoordinateX>-3.68972639781606</CoordinateX> <CoordinateY>40.4650604583015</CoordinateY> </Stop> EMT Services Streaming data ? users applications https://servicios.emtmadrid.es:8 443/geo/servicegeo.asmx Bus waiting times Transform Bus waiting times to RDF Stream? 8
  • 9. EMT Live data streams Streaming data Morphstreams SPARQLStream queries users applications 9 EMT Services https://servicios.emtmadrid.es:8 443/geo/servicegeo.asmx Bus waiting times
  • 10. Endpoint available • We’ll be using this server for the hands-on: • http://linkeddata2.dia.fi.upm.es:9000 • The instructions of a demo are on the github wiki: • https://github.com/jpcik/morph-web/wiki/Tutorial:-Morphstreams • Register queries • Pull Data • Push data through websockets • Simple SPARQLStream endpoint 10
  • 11. Querying live data streams • Currently at: • http://streams.linkeddata.es/emt/sparqlstream • Example • SELECT DISTINCT ?timeto ?obs FROM NAMED STREAM <http://emt.linkeddata.es/data#busstops.srdf> [NOW - 59 S] WHERE { ?obs a <http://emt.linkeddata.es/data#BusObservation>. ?obs <http://purl.oclc.org/NET/ssnx/ssn#observedBy><http://transporte.linkedd ata.es/emt/busstop/id/2018>. ?obs <http://purl.oclc.org/NET/ssnx/ssn#observationResult> ?output. ?output <http://emt.linkeddata.es/data#timeToBusValue> ?av. ?av <http://data.nasa.gov/qudt/owl/qudt#numericValue> ?timeto. } 11
  • 12. Some commands in Linux • encoded_value=$(python -c "import urllib; print urllib.quote('''SELECT DISTINCT ?timeto ?obs FROM NAMED STREAM <http://emt.linkeddata.es/data#busstops.srdf> [NOW - 30 S] WHERE { ?obs a <http://emt.linkeddata.es/data#BusObservation>. ?obs <http://purl.oclc.org/NET/ssnx/ssn#observedBy><ht tp://transporte.linkeddata.es/emt/busstop/id/2018>. ?obs <http://purl.oclc.org/NET/ssnx/ssn#observationResul t> ?output. ?output <http://emt.linkeddata.es/data#timeToBusValue> ?av. ?av <http://data.nasa.gov/qudt/owl/qudt#numericValue 12
  • 13. Sample result { "head": { "vars": [ "timeto" , "obs" ] }, "results": { "bindings": [ { "timeto": { "datatype": "http://www.w3.org/2001/XMLSchema#string" , "type": "typed-literal" , "value": "0" } , "obs": { "type": "uri" , "value": "http://transporte.linkeddata.es/emt/busstop/id/2018/busline/9/observation/20/09/ 2013%2010:28:19%20%2B0200" } } ] } } 13
  • 14. Configuring Morph-streams • Main ingredients: 1. Data streams Link both models 2. Ontology (network) 3. R2RML mappings 14
  • 15. SSN Ontology with other ontologies W3C SSN Ontology tool for modeling our sensor data combine with domain ontologies 15
  • 16. R2RML mappings busObservation a rr:TriplesMap; rr:logicalTable :emtStream; rr:subjectMap [ rr:template "http://transporte.linkeddata.es/emt/busstop/id/{stopid}/busline/{lineid}/observation/{timed}"; rr:class emt:BusObservation; rr:graph emt:busstops.srdf ]; rr:predicateObjectMap [ rr:predicateMap [ rr:constant ssn:observedProperty ]; rr:objectMap [ rr:constant emt:time_to_bus ]]; rr:predicateObjectMap [ rr:predicateMap [ rr:constant ssn:observationResult ]; rr:objectMap [ rr:parentTriplesMap :busOutput; rr:joinCondition "" ]]; busOutput a rr:TriplesMap; rr:logicalTable :emtStream; … 16
  • 17. morph-streams: Ontology-based query rewriting SELECT ?waittime ?stop FROM NAMED STREAM <http://emt.linkeddata.es/data#busstops.srdf> [NOW 300 S] WHERE { ?obs a emt:BusObservation; ssn:observedBy ?stop. ssn:observationResult ?result. ?result emt:timeToBusValue ?av. ?av qudt:numericValue ?waittime. } ω 300 second emt SELECT timetobus, stopid FROM emt.win:time(300 second) Query rewriting SPARQLStream Client π Timetobus,stopid Algebra expression R2RML Mappings [triples/bin dings] Esper Query Processing Data translation [tuples] GSN pull/push Cosm Other SPARQLStream query processing 17
  • 18. SPARQLStream query Get Bus waiting times for a stop URI SPARQL endpoint Map4RDF iOS SPARQLStream endpoint EMT Map4RDF iOS SPARQL query Get Bus stops data and location 18 Morph-streams EMT Live Services R2RML Mappings Waiting times feed
  • 20. Conclusions • A bit of evangelization at EMT • • • • • Use of Web standards for Open Data Use URIs for identifying stops, bus lines, etc Use well defined sensor ontologies (SSN) Use standard geolocation vocabularies Mix static and streaming dat through URIs • From the developer point of view • JSON results easy to consume • SPARQLstream endpoint through HTTP GET • The Demo is a very simple but practical example of how this can be done fairly easily 20