User:IgorNikolic

From Enipedia
Jump to: navigation, search

Contents

[edit] Igors corner for learning Sparql

Learning Sparql

[edit] Making Sense of EPRTR / EUETS

Using EPRTR and EUETS datasets with SPARQL

Notes from Chris to Igor

[edit] Lets explore the EPRTR database

[edit] Metal Emissions

Metals Emissions In Europe

[edit] Some funny issues

These may not actually be the same. The first thing to check is if amounts are specified for everything. However, I'm trying to figure out how to find the number of entries where amount is not set, but I'm running into syntax issues, which we need to fix. The two ways you should be able to do this are:

OPTIONAL { ?emission eprtr:TotalQuantity ?amount . }. 
FILTER (!bound(?amount)).

or

NOT EXIST { ?emission eprtr:TotalQuantity ?amount . }. 

I might need to rebuild some parts of 4store to make sure that this is enabled. ChrisDavis 19:33, 2 April 2011 (CEST)

This query should be the same as the one below :

This one gives a different number:

Only difference is that the first has a ?emission eprtr:TotalQuantity ?amount . line in it.

[edit] Local emissions

Where are all the facilities that have reports in Delft

Fatal error: Parameter coordinates must be one or more valid locations.


However, if I ask for all facilities that have lat/lon in square

Bottom right Top left
lat 51.979481 lat 52.007793
lon 4.406118 lon 4.344790

I will also get Gelatine delft ( http://enipedia.tudelft.nl/wiki/EPRTR/Facility/5743 ) which does not specify the city it is in.

The above query is broken as the SPARQLExtension can not handle warnings in the JSON file

[edit] All facilities in Zuid - Holland knownt to the EPRTR

Fatal error: Parameter coordinates must be one or more valid locations.


[edit] Mercury emissions

Total recorded mercury emissions in the EPRTR database, in "kilogram", for all years, all reported emissions

[edit] How many facilities emit Mercury ?

[edit] Total number of people employed in facilities that emit mercury

[edit] Mercury emissions per country

[edit] Give me top 200 facilities that emit mercury and put them on a map

Fatal error: Parameter coordinates must be one or more valid locations.


[edit] All things that have an Property:Operating_cost


select ?plant ?cost where {
?plant <http://enipedia.tudelft.nl/wiki/Property:Operating_cost> ?cost .
} order  by desc(?cost)


[edit] Total Electricity consumption vs. Land area


[edit] As a bar chart

(Items with empty or 0 cost value removed)

[edit] Incomplete data points

  * missing ("") value 
  * 0 value

[edit] Give me all the pollutants that also have a quantity

select ?pollutant ?quantity where {
?x prop:Pollutantname ?pollutant . 
?x prop:Pollutantaccidentalquantity ?quantity . 
} 

[edit] Number of toxic releases that have a mass of 0

select count(?pollutant) ?quantity where {
?x prop:Pollutantname ?pollutant . 
?x prop:Pollutantaccidentalquantity ?quantity . 
filter (?quantity = 0)
} 



[edit] Unique names of all emissions that have nonzero amounts

select distinct ?pollutant  where {
?x prop:Pollutantname ?pollutant . 
?x prop:Pollutantaccidentalquantity ?quantity . 
filter (?quantity != 0)
} 

[edit] On a pie chart

Note that this only considers Property:Pollutantaccidentalquantity and not Property:Pollutantquantity. This query should be improved to sum both of these properties together.

Attempt at combinig them

To do this easily without going way deep into the sparql documentation, you should look at passing the results of the query into a template, so
| format=template |template=mytemplate
. In this template, you will be able to do some basic math operations and reformat the data. See http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions for some of the super awesome things you can do. Also see http://www.mediawiki.org/wiki/Help:Templates and http://semantic-mediawiki.org/wiki/Help:Semantic_templates. These are incredibly powerful things to learn.
Personal tools
Namespaces

Variants
Actions
Navigation
Portals
Advanced
Toolbox