buda-base / lds-pdi

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

optional argument to sparql queries #178

Open eroux opened 4 years ago

eroux commented 4 years ago

In some cases, the client might pass an argument to a query or not, both cases being valid. Consider the following use case:


construct {
 ?res adm:status ?st .
 ?res skos:prefLabel ?resL .
} where {
  ?res ?resp bdr:W19740 .
  ?res adm:status ?st .
  ?res skos:prefLabel ?resL .
}

it could be queried in two different ways:

So there should be a way to do that. Currently a request can only take mandatory arguments.

MarcAgate commented 4 years ago

Implemented as of commit b61687c

In the example used for describing the issue, you would have to add in the template:

param.R_st.type=resource

param.R_st.subtype=a Resource IRI

param.R_st.desc=the URI of a Work resource

and finally add ?R_st=bdr:W19740 to the query string (request parameters)

see also: https://github.com/buda-base/lds-queries/blob/master/README.md