SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
Visualizing Open Data with Plone
a practical guide on how to query and visualize Linked Open Data
                      with eea.daviz product




                                       Antonio De Marinis
                                         Web Technology Management
                                         European Environment Agency
                                                   www.eea.europa.eu
Linked Data evolution




     2007




                                          as per 2011
     keeps growing...
     > 1 million datasets
     Watch video STRATA conference 2013
Open Data - what is it?

    Open data is a philosophy and practice requiring
    that certain data be freely available to everyone,
    without restrictions from copyright, patents or
    other mechanisms of control.


    Linked Open Data (LOD) or simply Linked
    Data is a technique to interlink all open datasets
    into a web of data, aka semantic web, using
    technologies like RDF and SPARQL.
Linked Data vs classic ODBC
SPARQL query structure

 A SPARQL query comprises, in order:
 ● Prefix declarations, for abbreviating URIs
 ● Dataset definition, stating what RDF graph(s) are being queried
 ● A result clause, identifying what information to return from the query
 ● The query pattern, specifying what to query for in the underlying dataset
 ● Query modifiers, slicing, ordering, and otherwise rearranging query results
 # prefix declarations
 PREFIX foo: <http://example.com/resources/>
 ...
 # dataset definition
 FROM ...
 # result
              clause
 SELECT ...
 # query pattern
 WHERE {
     ...
 }
 # query modifiers
 ORDER BY ...
Real example querying DBpedia


SELECT * WHERE {
?subject rdf:type <http://dbpedia.org/ontology/City>.
?subject rdfs:label ?label.
?subject rdfs:comment ?abstract.
?subject <http://dbpedia.org/ontology/populationTotal> ?populationTotal.
FILTER (lang(?label) = "en" && lang(?abstract) = "en")
} LIMIT 5
Let's dive into a real example


 SELECT * WHERE {
 ?subject rdf:type <http://dbpedia.org/ontology/City>.
 ?subject rdfs:label ?label.
 ?subject rdfs:comment ?abstract.
 ?subject <http://dbpedia.org/ontology/populationTotal> ?populationTotal.
 FILTER (lang(?label) = "en" && lang(?abstract) = "en" && (?populationTotal >= "5000000"^^xsd:
 integer))
 } LIMIT 5
Let's dive into a real example

 PREFIX o: <http://dbpedia.org/ontology/>
 PREFIX p: <http://dbpedia.org/property/>
 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>

 SELECT DISTINCT * WHERE {
 ?subject a o:City.
 ?subject rdfs:label ?label.
 OPTIONAL {?subject rdfs:comment ?abstract.}
 ?subject p:populationTotal ?populationTotal.
 OPTIONAL {?subject geo:lat ?latitude.}
 OPTIONAL {?subject geo:long ?longitude.}
 FILTER (lang(?label) = "en" && lang(?abstract) = "en" && (?populationTotal >= "5000000"^^xsd:integer
 && ?populationTotal < "60000000"^^xsd:integer))
 }
 ORDER BY DESC(?populationTotal)

      find all properties by exploring dbpedia e.g.
      dbpedia http://dbpedia.org/page/Tokyo

      Example without duplicates http://daviz.eionet.
      europa.eu/data/local-sparql-queries/most-
      populated-cities
Corresponding data visualisation with
Daviz




 We have been able to create a data visualisation of
 open linked data with filters/facets entirely through
 the web in about 10 minutes!

 live demo http://www.eea.europa.eu/sandbox/plog2013/most-populated-cities-
 with-coordinates-plus
Removing redundancies
TIP: In order to get rid of some rednundancy you can use "SAMPLE" or "SELECT DISTINCT"

PREFIX   o: <http://dbpedia.org/ontology/>
PREFIX   p: <http://dbpedia.org/property/>
PREFIX   rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX   geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>

SELECT ?subject (sql:SAMPLE(?subject) as ?city)
(sql:SAMPLE(?label) as ?label)
(sql:SAMPLE(?latitude) as ?latitude)
                                                        live example http://daviz.eionet.europa.
(sql:SAMPLE(?longitude) as ?longitude)
 max(?populationTotal) as ?maxPopulation
                                                        eu/visualisations/most-populated-cities
 max(?rainyDays) as ?rainyDays

WHERE {
?subject a o:City.
?subject rdfs:label ?label.
OPTIONAL {?subject rdfs:comment ?abstract.}
?subject p:populationTotal ?populationTotal.
OPTIONAL {?subject geo:lat ?latitude.}
OPTIONAL {?subject geo:long ?longitude.}
OPTIONAL {?subject p:yearPrecipitationDays ?rainyDays.}
FILTER (lang(?label) = "en" && lang(?abstract) = "en" && (?populationTotal >= "5000000"^^xsd:integer))
}
GROUP BY ?subject
ORDER BY DESC(?maxPopulation)
More examples at Daviz show room
      daviz.eionet.europa.eu
Example 2: Large companies (DBpedia)

 PREFIX o: <http://dbpedia.org/ontology/>
 PREFIX p: <http://dbpedia.org/property/>
 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>

 SELECT * WHERE {
 ?subject rdf:type <http://dbpedia.org/ontology/Company>.
 ?subject rdfs:label ?label.
 ?subject rdfs:comment ?abstract.
 ?subject p:numEmployees ?employees.
 ?subject o:location ?location.
 ?location geo:lat ?latitude.
 ?location geo:long ?longitude.
 FILTER (lang(?label) = "en" && lang(?abstract) = "en" && ?employees > 10000)
 }
 ORDER BY DESC(?employees)
 LIMIT 20
Example 3: Energy plants (Enipedia)

 SPARQL Endpoint:http://enipedia.tudelft.nl/sparql


 BASE <http://enipedia.tudelft.nl/wiki/>
 PREFIX a: <http://enipedia.tudelft.nl/wiki/>
 PREFIX prop: <http://enipedia.tudelft.nl/wiki/Property:>
 PREFIX cat: <http://enipedia.tudelft.nl/wiki/Category:>
 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 select ?Name ?Point ?Generation_capacity where {
 ?powerPlant prop:Country a:Italy .
 ?powerPlant rdfs:label ?Name .
 ?powerPlant prop:Point ?Point .
 ?powerPlant prop:Generation_capacity_electrical_MW ?Generation_capacity .
 }
More resources



 ●   SPARQL endpoints and their status: http://labs.mondeca.
     com/sparqlEndpointsStatus/index.html
 ●   SPARQL tutorial by example: http://www.cambridgesemantics.com/semantic-
     university/sparql-by-example
 ●   eea.sparql package gives you a sparql client and data holder for plone
     available on pypi
 ●   eea.daviz bundle includes eea.sparql and the visualisations tools
Data table manipulation via drag and drop
Modular framework
EEA Daviz




       And much more...
EEA Daviz




            Live Demo
EEA Daviz - Resources


More live examples

   ○   Eionet
       http://daviz.eionet.europa.eu


   ○   EEA
       http://www.eea.europa.eu/data-and-maps/daviz

Contenu connexe

Similaire à Visualize open data with Plone - eea.daviz PLOG 2013

Querying the Web of Data
Querying the Web of DataQuerying the Web of Data
Querying the Web of DataRinke Hoekstra
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLMyungjin Lee
 
Linked Data in Learning Analytics Tools
Linked Data in Learning Analytics ToolsLinked Data in Learning Analytics Tools
Linked Data in Learning Analytics ToolsMathieu d'Aquin
 
Accessing the Linked Open Data Cloud via ODBC
Accessing the Linked Open Data Cloud via ODBCAccessing the Linked Open Data Cloud via ODBC
Accessing the Linked Open Data Cloud via ODBCKingsley Uyi Idehen
 
2009 0807 Lod Gmod
2009 0807 Lod Gmod2009 0807 Lod Gmod
2009 0807 Lod GmodJun Zhao
 
State of the Semantic Web
State of the Semantic WebState of the Semantic Web
State of the Semantic WebIvan Herman
 
A Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsA Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsDr. Neil Brittliff
 
Linked Open Data (LOD) part 2
Linked Open Data (LOD)  part 2Linked Open Data (LOD)  part 2
Linked Open Data (LOD) part 2IPLODProject
 
Functional manipulations of large data graphs 20160601
Functional manipulations of large data graphs 20160601Functional manipulations of large data graphs 20160601
Functional manipulations of large data graphs 20160601David Wood
 
RDF Analytics... SPARQL and Beyond
RDF Analytics... SPARQL and BeyondRDF Analytics... SPARQL and Beyond
RDF Analytics... SPARQL and BeyondFadi Maali
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialAdonisDamian
 
Consuming open and linked data with open source tools
Consuming open and linked data with open source toolsConsuming open and linked data with open source tools
Consuming open and linked data with open source toolsJoanne Cook
 
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Eric D. Boyd
 
Information Intermediaries
Information IntermediariesInformation Intermediaries
Information IntermediariesDave Reynolds
 
Open (linked) bibliographic data edmund chamberlain (university of cambridge)
Open (linked) bibliographic data   edmund chamberlain (university of cambridge)Open (linked) bibliographic data   edmund chamberlain (university of cambridge)
Open (linked) bibliographic data edmund chamberlain (university of cambridge)RDTF-Discovery
 

Similaire à Visualize open data with Plone - eea.daviz PLOG 2013 (20)

Querying the Web of Data
Querying the Web of DataQuerying the Web of Data
Querying the Web of Data
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQL
 
Linked Data in Learning Analytics Tools
Linked Data in Learning Analytics ToolsLinked Data in Learning Analytics Tools
Linked Data in Learning Analytics Tools
 
Accessing the Linked Open Data Cloud via ODBC
Accessing the Linked Open Data Cloud via ODBCAccessing the Linked Open Data Cloud via ODBC
Accessing the Linked Open Data Cloud via ODBC
 
Bio2RDF@BH2010
Bio2RDF@BH2010Bio2RDF@BH2010
Bio2RDF@BH2010
 
2009 0807 Lod Gmod
2009 0807 Lod Gmod2009 0807 Lod Gmod
2009 0807 Lod Gmod
 
State of the Semantic Web
State of the Semantic WebState of the Semantic Web
State of the Semantic Web
 
A Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsA Little SPARQL in your Analytics
A Little SPARQL in your Analytics
 
Data access
Data accessData access
Data access
 
Linked Open Data (LOD) part 2
Linked Open Data (LOD)  part 2Linked Open Data (LOD)  part 2
Linked Open Data (LOD) part 2
 
Functional manipulations of large data graphs 20160601
Functional manipulations of large data graphs 20160601Functional manipulations of large data graphs 20160601
Functional manipulations of large data graphs 20160601
 
RDF Analytics... SPARQL and Beyond
RDF Analytics... SPARQL and BeyondRDF Analytics... SPARQL and Beyond
RDF Analytics... SPARQL and Beyond
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
 
Consuming open and linked data with open source tools
Consuming open and linked data with open source toolsConsuming open and linked data with open source tools
Consuming open and linked data with open source tools
 
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
 
Information Intermediaries
Information IntermediariesInformation Intermediaries
Information Intermediaries
 
BioSD Tutorial 2014 Editition
BioSD Tutorial 2014 EdititionBioSD Tutorial 2014 Editition
BioSD Tutorial 2014 Editition
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Open (linked) bibliographic data edmund chamberlain (university of cambridge)
Open (linked) bibliographic data   edmund chamberlain (university of cambridge)Open (linked) bibliographic data   edmund chamberlain (university of cambridge)
Open (linked) bibliographic data edmund chamberlain (university of cambridge)
 

Dernier

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
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 MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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.pptxHampshireHUG
 

Dernier (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 

Visualize open data with Plone - eea.daviz PLOG 2013

  • 1. Visualizing Open Data with Plone a practical guide on how to query and visualize Linked Open Data with eea.daviz product Antonio De Marinis Web Technology Management European Environment Agency www.eea.europa.eu
  • 2. Linked Data evolution 2007 as per 2011 keeps growing... > 1 million datasets Watch video STRATA conference 2013
  • 3. Open Data - what is it? Open data is a philosophy and practice requiring that certain data be freely available to everyone, without restrictions from copyright, patents or other mechanisms of control. Linked Open Data (LOD) or simply Linked Data is a technique to interlink all open datasets into a web of data, aka semantic web, using technologies like RDF and SPARQL.
  • 4. Linked Data vs classic ODBC
  • 5. SPARQL query structure A SPARQL query comprises, in order: ● Prefix declarations, for abbreviating URIs ● Dataset definition, stating what RDF graph(s) are being queried ● A result clause, identifying what information to return from the query ● The query pattern, specifying what to query for in the underlying dataset ● Query modifiers, slicing, ordering, and otherwise rearranging query results # prefix declarations PREFIX foo: <http://example.com/resources/> ... # dataset definition FROM ... # result clause SELECT ... # query pattern WHERE { ... } # query modifiers ORDER BY ...
  • 6. Real example querying DBpedia SELECT * WHERE { ?subject rdf:type <http://dbpedia.org/ontology/City>. ?subject rdfs:label ?label. ?subject rdfs:comment ?abstract. ?subject <http://dbpedia.org/ontology/populationTotal> ?populationTotal. FILTER (lang(?label) = "en" && lang(?abstract) = "en") } LIMIT 5
  • 7. Let's dive into a real example SELECT * WHERE { ?subject rdf:type <http://dbpedia.org/ontology/City>. ?subject rdfs:label ?label. ?subject rdfs:comment ?abstract. ?subject <http://dbpedia.org/ontology/populationTotal> ?populationTotal. FILTER (lang(?label) = "en" && lang(?abstract) = "en" && (?populationTotal >= "5000000"^^xsd: integer)) } LIMIT 5
  • 8. Let's dive into a real example PREFIX o: <http://dbpedia.org/ontology/> PREFIX p: <http://dbpedia.org/property/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> SELECT DISTINCT * WHERE { ?subject a o:City. ?subject rdfs:label ?label. OPTIONAL {?subject rdfs:comment ?abstract.} ?subject p:populationTotal ?populationTotal. OPTIONAL {?subject geo:lat ?latitude.} OPTIONAL {?subject geo:long ?longitude.} FILTER (lang(?label) = "en" && lang(?abstract) = "en" && (?populationTotal >= "5000000"^^xsd:integer && ?populationTotal < "60000000"^^xsd:integer)) } ORDER BY DESC(?populationTotal) find all properties by exploring dbpedia e.g. dbpedia http://dbpedia.org/page/Tokyo Example without duplicates http://daviz.eionet. europa.eu/data/local-sparql-queries/most- populated-cities
  • 9. Corresponding data visualisation with Daviz We have been able to create a data visualisation of open linked data with filters/facets entirely through the web in about 10 minutes! live demo http://www.eea.europa.eu/sandbox/plog2013/most-populated-cities- with-coordinates-plus
  • 10. Removing redundancies TIP: In order to get rid of some rednundancy you can use "SAMPLE" or "SELECT DISTINCT" PREFIX o: <http://dbpedia.org/ontology/> PREFIX p: <http://dbpedia.org/property/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> SELECT ?subject (sql:SAMPLE(?subject) as ?city) (sql:SAMPLE(?label) as ?label) (sql:SAMPLE(?latitude) as ?latitude) live example http://daviz.eionet.europa. (sql:SAMPLE(?longitude) as ?longitude) max(?populationTotal) as ?maxPopulation eu/visualisations/most-populated-cities max(?rainyDays) as ?rainyDays WHERE { ?subject a o:City. ?subject rdfs:label ?label. OPTIONAL {?subject rdfs:comment ?abstract.} ?subject p:populationTotal ?populationTotal. OPTIONAL {?subject geo:lat ?latitude.} OPTIONAL {?subject geo:long ?longitude.} OPTIONAL {?subject p:yearPrecipitationDays ?rainyDays.} FILTER (lang(?label) = "en" && lang(?abstract) = "en" && (?populationTotal >= "5000000"^^xsd:integer)) } GROUP BY ?subject ORDER BY DESC(?maxPopulation)
  • 11. More examples at Daviz show room daviz.eionet.europa.eu
  • 12. Example 2: Large companies (DBpedia) PREFIX o: <http://dbpedia.org/ontology/> PREFIX p: <http://dbpedia.org/property/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> SELECT * WHERE { ?subject rdf:type <http://dbpedia.org/ontology/Company>. ?subject rdfs:label ?label. ?subject rdfs:comment ?abstract. ?subject p:numEmployees ?employees. ?subject o:location ?location. ?location geo:lat ?latitude. ?location geo:long ?longitude. FILTER (lang(?label) = "en" && lang(?abstract) = "en" && ?employees > 10000) } ORDER BY DESC(?employees) LIMIT 20
  • 13. Example 3: Energy plants (Enipedia) SPARQL Endpoint:http://enipedia.tudelft.nl/sparql BASE <http://enipedia.tudelft.nl/wiki/> PREFIX a: <http://enipedia.tudelft.nl/wiki/> PREFIX prop: <http://enipedia.tudelft.nl/wiki/Property:> PREFIX cat: <http://enipedia.tudelft.nl/wiki/Category:> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?Name ?Point ?Generation_capacity where { ?powerPlant prop:Country a:Italy . ?powerPlant rdfs:label ?Name . ?powerPlant prop:Point ?Point . ?powerPlant prop:Generation_capacity_electrical_MW ?Generation_capacity . }
  • 14. More resources ● SPARQL endpoints and their status: http://labs.mondeca. com/sparqlEndpointsStatus/index.html ● SPARQL tutorial by example: http://www.cambridgesemantics.com/semantic- university/sparql-by-example ● eea.sparql package gives you a sparql client and data holder for plone available on pypi ● eea.daviz bundle includes eea.sparql and the visualisations tools
  • 15. Data table manipulation via drag and drop
  • 17. EEA Daviz And much more...
  • 18. EEA Daviz Live Demo
  • 19. EEA Daviz - Resources More live examples ○ Eionet http://daviz.eionet.europa.eu ○ EEA http://www.eea.europa.eu/data-and-maps/daviz