dsp-api icon indicating copy to clipboard operation
dsp-api copied to clipboard

Gravsearch: List Node Search in Simple Schema

Open tobiasschweizer opened this issue 6 years ago • 0 comments

When searching for a list node in the simple schema, the client should be able to restrict the search to a certain language. Also the search result should be served in this very language.

Searching could be done as follows:

PREFIX knora-api: <http://api.knora.org/ontology/knora-api/simple/v2#>
PREFIX anything: <http://0.0.0.0:3333/ontology/0001/anything/simple/v2#>

CONSTRUCT {

?mainRes knora-api:isMainResource true .

?mainRes anything:hasListItem ?propVal0 .

} WHERE {

  ?mainRes anything:hasListItem ?propVal0 .
 
  FILTER(str(?propVal0) = "Tree list node 02"^^knora-api:ListNode && lang(?propVal0) = "en") 
}

The problem is that the lang function expects a string, not a knora-api:ListNode.

As an alternative, @benjamingeer suggested:

Would it make more sense to handle this by handling the Accept-Language HTTP header, instead of specifying a language in the Gravsearch query?

tobiasschweizer avatar May 13 '19 10:05 tobiasschweizer