WolfgangFahl / snapquery

Frontend to Introduce Named Queries and Named Query Middleware to wikidata
Apache License 2.0
4 stars 1 forks source link

API: endpoint_name=qlever-wikidata -> 404 #10

Closed dpriskorn closed 2 months ago

dpriskorn commented 2 months ago
curl -X 'GET' \
  'https://snapquery.bitplan.com/api/query/wikidata-examples/cats?endpoint_name=qlever-wikidata' \
  -H 'accept: application/json'

-> 404

WolfgangFahl commented 2 months ago

we don't convert queries yet - i intend to try that tommorow using an LLM

HTTPException: 404: QueryBadFormed: A bad request has been sent to the endpoint: probably the SPARQL query is badly formed. Response: b'{\n "exception": "Invalid SPARQL query: Prefix wdt was not registered using a PREFIX declaration",\n "metadata": {\n "line": 5,\n "positionInLine": 8,\n "query": "#\\n\\nSELECT ?item ?itemLabel\\nWHERE {\\n ?item wdt:P31 wd:Q146. # Must be a cat\\n SERVICE wikibase:label { bd:serviceParam wikibase:language \\"[AUTO_LANGUAGE],en\\". }\\n}\\n",\n "startIndex": 43,\n "stopIndex": 49\n },\n "query": "#\\n\\nSELECT ?item ?itemLabel\\nWHERE {\\n ?item wdt:P31 wd:Q146. # Must be a cat\\n SERVICE wikibase:label { bd:serviceParam wikibase:language \\"[AUTO_LANGUAGE],en\\". }\\n}\\n",\n "resultsize": 0,\n "status": "ERROR",\n "time": {\n "computeResult": 0,\n "total": 0\n }\n}'
WolfgangFahl commented 2 months ago
curl -X 'GET' \
  'https://snapquery.bitplan.com/api/query/wikidata-examples/cats.csv'

works as well as:

curl -X 'GET' \
  'https://snapquery.bitplan.com/api/query/wikidata-examples/cats.github?limit=5'

cats

query


SELECT ?item ?itemLabel
WHERE {
  ?item wdt:P31 wd:Q146. # Must be a cat
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

LIMIT 5

try it!

result

item itemLabel
http://www.wikidata.org/entity/Q378619 CC
http://www.wikidata.org/entity/Q498787 Muezza
http://www.wikidata.org/entity/Q677525 Orangey
http://www.wikidata.org/entity/Q851190 Mrs. Chippy
http://www.wikidata.org/entity/Q893453 Unsinkable Sam