next
previous
items

Data table via SPARQL

Homicides per million inhabitants

Data table via SPARQL Published 31 Dec 2012 Last modified 09 Dec 2024
This query combines the Eurostat crim_gen, demo_pjanbroad and WHO WHS9_86 population datasets to show homicides per million inhabitants. The WHO dataset is used because it has data for countries outside EU. (UK is reported per region and therefore doesn't appear) Russia and South Africa are excluded from query

Download this dataset

Dataset preview

(Live Query)

country date Homicides
"Croatia" "1993-01-01"^^<http://www.w3.org/2001/XMLSchema#date> "53"^^<http://www.w3.org/2001/XMLSchema#int>
"Cyprus" "1993-01-01"^^<http://www.w3.org/2001/XMLSchema#date> "14"^^<http://www.w3.org/2001/XMLSchema#int>
"Denmark" "1993-01-01"^^<http://www.w3.org/2001/XMLSchema#date> "15"^^<http://www.w3.org/2001/XMLSchema#int>
"Finland" "1993-01-01"^^<http://www.w3.org/2001/XMLSchema#date> "25"^^<http://www.w3.org/2001/XMLSchema#int>
"Germany (until 1990 former territory of the FRG)" "1993-01-01"^^<http://www.w3.org/2001/XMLSchema#date> "15"^^<http://www.w3.org/2001/XMLSchema#int>
"Greece" "1993-01-01"^^<http://www.w3.org/2001/XMLSchema#date> "14"^^<http://www.w3.org/2001/XMLSchema#int>
"Hungary" "1993-01-01"^^<http://www.w3.org/2001/XMLSchema#date> "28"^^<http://www.w3.org/2001/XMLSchema#int>
"Italy" "1993-01-01"^^<http://www.w3.org/2001/XMLSchema#date> "19"^^<http://www.w3.org/2001/XMLSchema#int>
"Lithuania" "1993-01-01"^^<http://www.w3.org/2001/XMLSchema#date> "134"^^<http://www.w3.org/2001/XMLSchema#int>
"Norway" "1993-01-01"^^<http://www.w3.org/2001/XMLSchema#date> "8"^^<http://www.w3.org/2001/XMLSchema#int>

Received 661 rows in 0.060 seconds.


https://www.eea.europa.eu/data-and-maps/daviz/eionet/data/local-sparql-queries/homicides-per-million-inhabitants/daviz.json

For system integrators

The following info can be used by a system developer / database administrator in order to retrieve this dataset programmatically over the web using a SPARQL client.

Are you new to Linked Data technology? visit http://linkeddata.org



http://semantic.eea.europa.eu/sparql

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX sdmx-measure: <http://purl.org/linked-data/sdmx/2009/measure#>
PREFIX sdmx-dimension: <http://purl.org/linked-data/sdmx/2009/dimension#>
PREFIX sdmx-attribute: <http://purl.org/linked-data/sdmx/2009/attribute#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX property: <http://rdfdata.eionet.europa.eu/eurostat/property#>
PREFIX wproperty: <http://rdfdata.eionet.europa.eu/who/property#>

SELECT ?country ?date
  (xsd:int(if( bound(?epopulation),
       ?homicide * 1000000 / ?epopulation,
       ?homicide * 1000 / ?wpopulation)) AS ?Homicides)
WHERE {
 GRAPH <http://rdfdata.eionet.europa.eu/eurostat/data/crim_gen.rdf.gz> {
    _:crim_gen qb:dataSet <http://rdfdata.eionet.europa.eu/eurostat/data/crim_gen>.
    _:crim_gen sdmx-dimension:freq <http://purl.org/linked-data/sdmx/2009/code#freq-A> .
    _:crim_gen property:crim <http://rdfdata.eionet.europa.eu/eurostat/dic/crim#HOM> .
    _:crim_gen property:unit <http://rdfdata.eionet.europa.eu/eurostat/dic/unit#NBR> .
    _:crim_gen property:geo ?geo .
    _:crim_gen sdmx-dimension:timePeriod ?date .
    _:crim_gen sdmx-measure:obsValue ?homicide
 }
 FILTER(!?geo IN (<http://rdfdata.eionet.europa.eu/eurostat/dic/geo#RU>, <http://rdfdata.eionet.europa.eu/eurostat/dic/geo#ZA>))
 ?geo rdfs:label ?country

 OPTIONAL {
 ?ucountry owl:sameAs ?geo

  GRAPH <http://rdfdata.eionet.europa.eu/who/data/WHS9_86.rdf.gz> {
    _:WHS9_86 qb:dataSet <http://rdfdata.eionet.europa.eu/who/data/WHS9_86>.
    _:WHS9_86 sdmx-dimension:freq <http://purl.org/linked-data/sdmx/2009/code#freq-A> .
    _:WHS9_86 sdmx-dimension:timePeriod ?date .
    _:WHS9_86 sdmx-dimension:refArea ?ucountry .
    _:WHS9_86 sdmx-measure:obsValue ?wpopulation
    FILTER((?ucountry != <http://rdfdata.eionet.europa.eu/who/dic/country#ISL> && ?wpopulation < 400000)
        || (?ucountry = <http://rdfdata.eionet.europa.eu/who/dic/country#ISL> && ?wpopulation < 500) )
  }
 }
 OPTIONAL {
  GRAPH <http://rdfdata.eionet.europa.eu/eurostat/data/demo_pjanbroad.rdf.gz> {
    _:demo_pjanbroad qb:dataSet <http://rdfdata.eionet.europa.eu/eurostat/data/demo_pjanbroad>.
    _:demo_pjanbroad sdmx-dimension:freq <http://purl.org/linked-data/sdmx/2009/code#freq-A> .
    _:demo_pjanbroad property:age <http://rdfdata.eionet.europa.eu/eurostat/dic/age#TOTAL> .
    _:demo_pjanbroad property:sex <http://rdfdata.eionet.europa.eu/eurostat/dic/sex#T> .
    _:demo_pjanbroad sdmx-dimension:timePeriod ?date .
    _:demo_pjanbroad property:geo ?geo .
    _:demo_pjanbroad sdmx-measure:obsValue ?epopulation
  }
 }
 FILTER(BOUND(?wpopulation) || BOUND(?epopulation))
} ORDER BY ?date ?country

Error when running query:

Error. Traceback (most recent call last):
  File "/plone/buildout-cache/eggs/Products.ZSPARQLMethod-2.3-py2.7.egg/Products/ZSPARQLMethod/Method.py", line 287, in run_with_timeout
    ret = func(*args, **kwargs)
  File "/plone/buildout-cache/eggs/Products.ZSPARQLMethod-2.3-py2.7.egg/Products/ZSPARQLMethod/Method.py", line 215, in query_and_get_result
    result = sparql.query(*args, timeout = kwargs.get("timeout", 0) or 0)
  File "/plone/buildout-cache/eggs/sparql_client-3.8-py2.7.egg/sparql.py", line 747, in query
    return s.query(query, timeout, raw=raw)
  File "/plone/buildout-cache/eggs/sparql_client-3.8-py2.7.egg/sparql.py", line 416, in query
    return q.query(query, timeout, raw=raw)
  File "/plone/buildout-cache/eggs/sparql_client-3.8-py2.7.egg/sparql.py", line 571, in query
    response = self._request(statement, timeout)
  File "/plone/buildout-cache/eggs/sparql_client-3.8-py2.7.egg/sparql.py", line 558, in _request
    response = self._build_response(query, opener, buf, timeout)
  File "/plone/buildout-cache/eggs/sparql_client-3.8-py2.7.egg/sparql.py", line 543, in _build_response
    timeout if timeout > 0 else None)
  File "/plone/buildout-cache/eggs/sparql_client-3.8-py2.7.egg/sparql.py", line 514, in _get_response
    response = opener.open(request, timeout=timeout)
  File "/usr/local/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/local/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/local/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python2.7/urllib2.py", line 1228, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/local/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno -2] No address found>


Permalinks

Document Actions