buda-base / lds-pdi

http://purl.bdrc.io BDRC Linked Data Server
Apache License 2.0
2 stars 0 forks source link

JSON API for queries #11

Closed eroux closed 6 years ago

eroux commented 6 years ago

It would be interesting to have a REST JSON API for the queries (using these concepts). It could list the queries when going on /query/, then a description of the query ABC on /query/ABC (the arguments, results, etc.), then another url (which one?) for running the query

MarcAgate commented 6 years ago

see http://buda1.bdrc.io/queries for a json list of the query templates and (for instance) see http://buda1.bdrc.io/queries/Topic_byAllNames.arq for a json description of the templates, including the demo link

Note the actual usage of the query template using GET/POST/POST JSON is already implemented in the main query template service. Ex:

http://buda1.bdrc.io/resource/templates?searchType=Topic_byAllNames&L_NAME=rgyud (GET)

curl --data "searchType=Res_byName&L_NAME=(\"mkhan chen\" AND (\"'od zer\" OR \"ye shes\"))&LG_NAME=bo-x-ewts&I_LIM=100" http://localhost:8080/resource/templates (POST)

curl -H "Content-Type: application/json" -X POST -d @test.json http://localhost:8080/resource/templates (POST JSON)

eroux commented 6 years ago

(as a general observation, it tends to be perceived as rude to close an item opened by someone else, the usual protocol is to ask the person who opened the issue if it's ok to be closed)

Looks good! A few remarks:

"queryParams": {
  "L_NAME": {
     "type": "string",
     "langTagArgument": "LT_NAME",
     "acceptsLuceneQueries": true,
     "description": "the name of the person",
     "example": "this is an example"
  }
}
MarcAgate commented 6 years ago

I think it's all done now (since commit 23bd0f1)

eroux commented 6 years ago

Ok, I'll open a separate issue for the remaining issues