ecolod.org › SPARQL

How to query ecolod.org

A read-only SPARQL 1.1 endpoint over the ecolod economic-statistics graph — 3,544,395 triples of country-level indicators (RDF Data Cube observations with units, provenance and multilingual labels). No auth, CORS open to every origin. The examples below run as-is — just copy-paste the curl.

Licence & attribution

The data is published under CC BY 4.0. Attribute Team KitaSan / ecolod.org. Questions, corrections and bulk-access requests: info@ecolod.org. Every observation carries its own prov:wasDerivedFrom and dcterms:mediator, so upstream sources stay attributable per-number (see cookbook example 5).

Endpoint

GET  https://q.ecolod.org/sparql?query={SPARQL}
POST https://q.ecolod.org/sparql        (application/sparql-query, or a form-encoded query=)

Visiting with no query shows this page. Long queries are cut off at 30s by default (tune with ?timeout=SECONDS; the server applies its own upper cap). Write surfaces (/update, /graph, /data, /upload, /patch) always answer 405.

Cookbook

Each line describes the shape of the answer. Country URIs are https://ecolod.org/country/{ISO-3166-1 alpha-3} (e.g. JPN, LAO); indicator URIs are https://ecolod.org/concept/indicator/{slug}. Browse both from the ecolod.org portal.

1. Smoke test — count every triple

curl -s https://q.ecolod.org/sparql \
  -H 'Accept: application/sparql-results+json' \
  --data-urlencode 'query=SELECT (COUNT(*) AS ?n) WHERE { ?s ?p ?o }'

→ ?n = 3544395 (measured 2026-07-28; grows with each data refresh. COUNT(*) walks the whole graph — ~9 s; targeted queries below run in a fraction of that)

2. A time series — Japan's nominal GDP in USD, every year

curl -s https://q.ecolod.org/sparql \
  -H 'Accept: text/csv' \
  --data-urlencode 'query=
PREFIX eco: <https://ecolod.org/ontology/>
SELECT ?year ?value WHERE {
  ?obs eco:refArea <https://ecolod.org/country/JPN> ;
       eco:indicator <https://ecolod.org/concept/indicator/gdp-nominal-usd> ;
       eco:timePeriod ?year ;
       eco:obsValue ?value .
} ORDER BY ?year'

→ one row per (year, source): 48.42 in 1960 (World Bank) through 4435.16 in 2024. Years covered by several sources return one row each — scope with qb:dataSet as in example 3 to pick one

3. Top 10 economies in the latest year with actual (non-forecast) data

curl -s https://q.ecolod.org/sparql \
  -H 'Accept: text/csv' \
  --data-urlencode 'query=
PREFIX qb:   <http://purl.org/linked-data/cube#>
PREFIX eco:  <https://ecolod.org/ontology/>
PREFIX ecoi: <https://ecolod.org/concept/indicator/>
SELECT ?country ?value WHERE {
  { SELECT ?latest WHERE {
      ?o qb:dataSet <https://ecolod.org/data/dataset/ecodb-imf-weo> ;
         eco:indicator ecoi:gdp-nominal-usd ;
         eco:obsStatus "A" ;
         eco:timePeriod ?latest .
    } ORDER BY DESC(?latest) LIMIT 1 }
  ?obs qb:dataSet <https://ecolod.org/data/dataset/ecodb-imf-weo> ;
       eco:indicator ecoi:gdp-nominal-usd ;
       eco:obsStatus "A" ;
       eco:timePeriod ?latest ;
       eco:refArea ?country ;
       eco:obsValue ?value .
} ORDER BY DESC(?value) LIMIT 10'

→ USA 30767.08 / CHN 19626.25 / DEU 5048.06 / JPN 4435.16 / GBR 4003.02 … (2025, USD billions). The qb:dataSet line picks ONE source; without it every economy appears once per source. The sub-select uses ORDER BY DESC LIMIT 1 on purpose — see the engine notes above

4. Indicator labels in Lao and Japanese

curl -s https://q.ecolod.org/sparql \
  -H 'Accept: application/sparql-results+json' \
  --data-urlencode 'query=
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX ecoi: <https://ecolod.org/concept/indicator/>
SELECT ?label WHERE {
  ecoi:gdp-nominal-usd skos:prefLabel ?label
  FILTER(lang(?label) = "lo" || lang(?label) = "ja")
}'

→ "GDP ຕາມລາຄາປັດຈຸບັນ (USD)"@lo and "名目GDP (USドル)"@ja — every indicator carries prefLabels in all ten portal languages

5. Where does one number come from? (provenance of a single observation)

curl -s https://q.ecolod.org/sparql \
  -H 'Accept: application/sparql-results+json' \
  --data-urlencode 'query=
PREFIX eco:     <https://ecolod.org/ontology/>
PREFIX prov:    <http://www.w3.org/ns/prov#>
PREFIX dcterms: <http://purl.org/dc/terms/>
SELECT ?source ?via ?generated WHERE {
  <https://ecolod.org/data/obs/ecodb/JPN/gdp-nominal-usd/2017>
      prov:wasDerivedFrom ?source ;
      dcterms:mediator    ?via ;
      prov:generatedAtTime ?generated .
}'

→ source = https://data.imf.org/en/datasets/IMF.RES:WEO, via = https://ecodb.net/country/JP/imf_gdp.html, generated = 2026-07-24T20:49:54Z. Observations under /data/obs/imf-weo-*/ and /data/obs/wb-wdi/ come straight from the publisher and carry no dcterms:mediator

6. Forecasts only — future values are flagged, not hidden

curl -s https://q.ecolod.org/sparql \
  -H 'Accept: text/csv' \
  --data-urlencode 'query=
PREFIX qb:   <http://purl.org/linked-data/cube#>
PREFIX eco:  <https://ecolod.org/ontology/>
PREFIX ecoi: <https://ecolod.org/concept/indicator/>
SELECT ?year ?value WHERE {
  ?obs qb:dataSet <https://ecolod.org/data/dataset/imf-weo/2026-04> ;
       eco:refArea <https://ecolod.org/country/LAO> ;
       eco:indicator ecoi:gdp-nominal-usd ;
       eco:timePeriod ?year ;
       eco:obsValue   ?value ;
       eco:obsStatus  "F" .
} ORDER BY ?year'

→ Laos, straight from the April 2026 WEO edition: 18.959 in 2026 through 24.522 in 2031 (USD billions, all flagged "F" = IMF projection). Swap "F" for "A" to see outturns; the vintaged dataset URI means October editions will sit alongside, not overwrite

Result formats

Pick the format with the Accept header.

See also