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://query.wikidata.org/sparql \
  --query - \
  --format turtle \
  --to select-turtle

Success0.43 s1,475 bytes

Response bytes

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

person personName
http://www.wikidata.org/entity/Q27255291 (11Z)-11-eicosenyl oleate
http://www.wikidata.org/entity/Q27215373 (1S,5R)-3-methylsulfonyl-7-(4-phenylphenyl)-3,6-diazabicyclo[3.1.1]heptane
http://www.wikidata.org/entity/Q27276974 (1S)-1-(3-methoxyphenyl)-N,N-dimethylethanamine
http://www.wikidata.org/entity/Q27281030 (3R,4S)-3-(4-(4-fluorophenyl)-4-hydroxypiperidin-1-yl)-3,4-dihydro-2H-chromene-4,7-diol
http://www.wikidata.org/entity/Q27140302 (R)-mallotophilippen E

Download results.xml

results.xml

{
  "@context": "https://w3id.org/ro/crate/1.3/context",
  "@graph": [
    {
      "@id": "ro-crate-metadata.json",
      "@type": "CreativeWork",
      "about": {
        "@id": "./"
      },
      "conformsTo": {
        "@id": "https://w3id.org/ro/crate/1.3"
      }
    },
    {
      "@id": "./",
      "@type": "Dataset",
      "additionalProperty": [
        {
          "@id": "#retrieval-duration"
        }
      ],
      "author": {
        "@id": "https://vitrify.iolanta.tech"
      },
      "datePublished": "2026-10-31T11:13:07.359025204+00:00",
      "description": "SPARQL retrieval materialized by Vitrify.",
      "hasPart": [
        {
          "@id": "results.xml"
        },
        {
          "@id": "query.rq"
        }
      ],
      "license": "No license asserted by Vitrify; consult the source endpoint's terms of use.",
      "name": "results.xml",
      "publisher": {
        "@id": "https://query.wikidata.org/sparql"
      }
    },
    {
      "@id": "results.xml",
      "@type": "File",
      "contentSize": "1475",
      "encodingFormat": "application/sparql-results+xml",
      "sha256": "6ecff4d3757a565d548dbc798a17ed7f75541b3c7af7c5c9a278d4b270208226"
    },
    {
      "@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.3"
    },
    {
      "@id": "https://query.wikidata.org/sparql",
      "@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-31T11:13:07.359025204+00:00",
      "identifier": "https://query.wikidata.org/sparql",
      "instrument": {
        "@id": "https://vitrify.iolanta.tech"
      },
      "object": [
        {
          "@id": "https://query.wikidata.org/sparql"
        },
        {
          "@id": "query.rq"
        }
      ],
      "result": {
        "@id": "results.xml"
      },
      "startTime": "2026-10-31T11:13:06.928710723+00:00"
    },
    {
      "@id": "#retrieval-duration",
      "@type": "PropertyValue",
      "name": "Retrieval duration",
      "propertyID": "retrieval-duration",
      "unitCode": "SEC",
      "value": 0.429018499
    }
  ]
}

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