GeoKnow / Jassa

JAvascript Suite for Sparql Access
25 stars 3 forks source link

[FEATURE-REQUEST] Add optionalFilter to criteria #12

Closed leipert closed 10 years ago

leipert commented 10 years ago
var criteria = {name: {$regex: filterText, $optional: true}};

would ease some pain!

Aklakan commented 10 years ago

The JSON criteria API has been removed for now.

Sponate now supports. sponate.collection.getListService(), whereas the list service supports arbitrary sparql.Concept as a filter - which is far more powerful than the criteria API.

It would be possible to add the API at a later stage, the main question is, whether it is worth it due to conceptual issues: On the one hand, in SPARQL there are several ways for filtering resources by preferred labels and languages, of which many are supported using sparql.KeywordSearchUtils, and it seems quite hard making all these features available through a JSON layer.

On the other hand, the system needs a mapping from json-paths to SPARQL variables, and although this can be partly derived automatically from the Sponate mapping, it won't work for when custom transformation functions are involved (which I find more important). As a work around, support for user provided json-path->sparql var mappings could be added.