Skip to content

EU capitals

This Wikidata query returns EU-capital labels in English.

printf '%s' 'PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?label
WHERE {
  ?country wdt:P463 wd:Q458 ;
           wdt:P36 ?capital .
  ?capital rdfs:label ?label .
  FILTER(LANG(?label) = "en")
}
ORDER BY ?label
LIMIT 5
' |
  vitrify sparql --endpoint https://qlever.dev/api/wikidata \
  --query - \
  --format csv \
  --to eu-capitals

Success0.29 s50 bytes

Response bytes

eu-capitals/
├── results.csv
├── ro-crate-metadata.json
└── query.rq

label
Amsterdam
Athens
Berlin
Bratislava
Brussels

Download results.csv

results.csv

{
  "@context": "https://w3id.org/ro/crate/1.2/context",
  "@graph": [
    {
      "@id": "ro-crate-metadata.json",
      "@type": "CreativeWork",
      "about": {
        "@id": "./"
      },
      "conformsTo": {
        "@id": "https://w3id.org/ro/crate/1.2"
      }
    },
    {
      "@id": "./",
      "@type": "Dataset",
      "additionalProperty": [
        {
          "@id": "#retrieval-duration"
        }
      ],
      "author": {
        "@id": "https://vitrify.iolanta.tech"
      },
      "datePublished": "2026-10-16T08:03:36.494284876+00:00",
      "description": "SPARQL retrieval materialized by Vitrify.",
      "hasPart": [
        {
          "@id": "results.csv"
        },
        {
          "@id": "query.rq"
        }
      ],
      "license": "No license asserted by Vitrify; consult the source endpoint's terms of use.",
      "name": "results.csv",
      "publisher": {
        "@id": "https://qlever.dev/api/wikidata"
      }
    },
    {
      "@id": "results.csv",
      "@type": "File",
      "additionalProperty": [
        {
          "@id": "#row-count"
        }
      ],
      "contentSize": "50",
      "encodingFormat": "text/csv",
      "sha256": "1e6f47a378e895921700dd75f087152bd39ecf54ea35b6bd416d4788060fde7d"
    },
    {
      "@id": "query.rq",
      "@type": "File",
      "contentSize": "319",
      "encodingFormat": "application/sparql-query",
      "sha256": "68974f8807346f05c7df9f9784440af6904a6b4254c3f2e3b73965e92b8860b9"
    },
    {
      "@id": "https://vitrify.iolanta.tech",
      "@type": "SoftwareApplication",
      "name": "Vitrify",
      "url": "https://vitrify.iolanta.tech",
      "version": "0.1.1"
    },
    {
      "@id": "https://qlever.dev/api/wikidata",
      "@type": "Organization"
    },
    {
      "@id": "#retrieval",
      "@type": "CreateAction",
      "actionStatus": {
        "@id": "http://schema.org/CompletedActionStatus"
      },
      "agent": {
        "@id": "https://vitrify.iolanta.tech"
      },
      "description": "HTTP 200; Accept: text/csv",
      "endTime": "2026-10-16T08:03:36.494284876+00:00",
      "identifier": "https://qlever.dev/api/wikidata",
      "instrument": {
        "@id": "https://vitrify.iolanta.tech"
      },
      "object": [
        {
          "@id": "https://qlever.dev/api/wikidata"
        },
        {
          "@id": "query.rq"
        }
      ],
      "result": {
        "@id": "results.csv"
      },
      "startTime": "2026-10-16T08:03:36.193128649+00:00"
    },
    {
      "@id": "#retrieval-duration",
      "@type": "PropertyValue",
      "name": "Retrieval duration",
      "propertyID": "retrieval-duration",
      "unitCode": "SEC",
      "value": 0.289229582
    },
    {
      "@id": "#row-count",
      "@type": "PropertyValue",
      "name": "Row count",
      "propertyID": "row-count",
      "unitText": "rows",
      "value": 7
    }
  ]
}

Download ro-crate-metadata.json

ro-crate-metadata.json

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?label
WHERE {
  ?country wdt:P463 wd:Q458 ;
           wdt:P36 ?capital .
  ?capital rdfs:label ?label .
  FILTER(LANG(?label) = "en")
}
ORDER BY ?label
LIMIT 5

Download query.rq

query.rq