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 3
' |
  vitrify sparql --endpoint https://qlever.dev/api/wikidata \
  --query - \
  --format turtle \
  --to select-turtle

Success0.32 s551 bytes

Response bytes

select-turtle/
├── results.ttl
├── 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

Download results.ttl

results.ttl

{
  "@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:02:09.799137787+00:00",
      "description": "SPARQL retrieval materialized by Vitrify.",
      "hasPart": [
        {
          "@id": "results.ttl"
        },
        {
          "@id": "query.rq"
        }
      ],
      "license": "No license asserted by Vitrify; consult the source endpoint's terms of use.",
      "name": "results.ttl",
      "publisher": {
        "@id": "https://qlever.dev/api/wikidata"
      }
    },
    {
      "@id": "results.ttl",
      "@type": "File",
      "additionalProperty": [
        {
          "@id": "#row-count"
        }
      ],
      "contentSize": "551",
      "encodingFormat": "application/sparql-results+json",
      "sha256": "6a5fed0245daefab16b3627a2bec0f604c9332e48f34d76bdadf33d71f81690b"
    },
    {
      "@id": "query.rq",
      "@type": "File",
      "contentSize": "169",
      "encodingFormat": "application/sparql-query",
      "sha256": "47300242cfaa497f2b78404a96c9d5a170846e43038d9e7b9edc7a7cbd2fd81e"
    },
    {
      "@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/turtle",
      "endTime": "2026-10-16T08:02:09.799137787+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.ttl"
      },
      "startTime": "2026-10-16T08:02:09.466959410+00:00"
    },
    {
      "@id": "#retrieval-duration",
      "@type": "PropertyValue",
      "name": "Retrieval duration",
      "propertyID": "retrieval-duration",
      "unitCode": "SEC",
      "value": 0.323214033
    },
    {
      "@id": "#row-count",
      "@type": "PropertyValue",
      "name": "Row count",
      "propertyID": "row-count",
      "unitText": "rows",
      "value": 1
    }
  ]
}

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 3

Download query.rq

query.rq