Skip to content

SELECT with Turtle requested

This example requests Turtle for a SELECT query. The endpoint may return another response format or reject the request. Vitrify records the actual response type and chooses the filename extension from it — for example results.xml or results.json — falling back to .ttl only if that media type is missing or unrecognized. Older history entries still use results.ttl from before that naming rule.

printf '%s' 'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?person ?personName WHERE {
  ?person rdfs:label ?personName .
  FILTER(LANG(?personName) = "en")
}
LIMIT 5
' |
  vitrify sparql --endpoint https://qlever.dev/api/wikidata \
  --query - \
  --format turtle \
  --to select-turtle

Success0.55 s862 bytes

Response bytes

select-turtle/
├── results.json
├── ro-crate-metadata.json
└── query.rq

person personName
http://www.wikidata.org/entity/L10 describe
http://www.wikidata.org/entity/L1000000-S1 etymology
http://www.wikidata.org/entity/L1000001-S1 dialectology
http://www.wikidata.org/entity/L1000002-S1 dialectology
http://www.wikidata.org/entity/L1000003-S1 Egyptology

Download results.json

results.json

{
  "@context": "https://w3id.org/ro/crate/1.3/context",
  "@graph": [
    {
      "@id": "ro-crate-metadata.json",
      "@type": "CreativeWork",
      "conformsTo": {
        "@id": "https://w3id.org/ro/crate/1.3"
      },
      "about": {
        "@id": "./"
      }
    },
    {
      "@id": "./",
      "@type": "Dataset",
      "name": "results.json",
      "description": "SPARQL retrieval materialized by Vitrify.",
      "datePublished": "2026-11-28T12:41:12.978987985+00:00",
      "additionalProperty": [
        {
          "@id": "#retrieval-duration"
        }
      ],
      "license": "No license asserted by Vitrify; consult the source endpoint's terms of use.",
      "hasPart": [
        {
          "@id": "results.json"
        },
        {
          "@id": "query.rq"
        }
      ],
      "publisher": {
        "@id": "https://qlever.dev/api/wikidata"
      },
      "author": {
        "@id": "https://vitrify.iolanta.tech"
      }
    },
    {
      "@id": "results.json",
      "@type": "File",
      "contentSize": "862",
      "sha256": "623c7fff0671b98be222e9a4713980cb07f1630b7452f2c30e4c6834d9fe7869",
      "encodingFormat": "application/sparql-results+json"
    },
    {
      "@id": "query.rq",
      "@type": "File",
      "contentSize": "169",
      "encodingFormat": "application/sparql-query",
      "sha256": "3acdaa62963ed92b36c330aafbc456a285530126bcb5b0d555f6e589758c5b37"
    },
    {
      "@id": "https://vitrify.iolanta.tech",
      "@type": "SoftwareApplication",
      "name": "Vitrify",
      "url": "https://vitrify.iolanta.tech",
      "version": "0.1.4"
    },
    {
      "@id": "https://qlever.dev/api/wikidata",
      "@type": "Organization"
    },
    {
      "@id": "#retrieval",
      "@type": "CreateAction",
      "actionStatus": {
        "@id": "http://schema.org/CompletedActionStatus"
      },
      "startTime": "2026-11-28T12:41:12.430726143+00:00",
      "endTime": "2026-11-28T12:41:12.978987985+00:00",
      "instrument": {
        "@id": "https://vitrify.iolanta.tech"
      },
      "agent": {
        "@id": "https://vitrify.iolanta.tech"
      },
      "object": [
        {
          "@id": "https://qlever.dev/api/wikidata"
        },
        {
          "@id": "query.rq"
        }
      ],
      "result": {
        "@id": "results.json"
      },
      "identifier": "https://qlever.dev/api/wikidata",
      "description": "HTTP 200; Accept: text/turtle"
    },
    {
      "@id": "#retrieval-duration",
      "@type": "PropertyValue",
      "propertyID": "retrieval-duration",
      "name": "Retrieval duration",
      "value": 0.547303903,
      "unitCode": "SEC"
    }
  ]
}

Download ro-crate-metadata.json

ro-crate-metadata.json

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?person ?personName WHERE {
  ?person rdfs:label ?personName .
  FILTER(LANG(?personName) = "en")
}
LIMIT 5

Download query.rq

query.rq