The existing search function does not provide means to:
- search for a value across all objects (case with missing predicate value)
- search for existence of predicate (case with missing object value)
While 2. may not be needed (or could even be hard for users to understand), 1. is valuable for users since it facilitates sort of "full text search" where the user does not necessarily need to know the predicate value but knows the object value (e.g. title).
The API of the search call could be modified to support this in the following way: instead of a dictionary to pass in parameters, use a list of tuples (predicate, object). Passing None for predicate value supports case 1 above. Passing None for object value supports case 2 above. Using this approach would also allow for cases where a user wants to search for multiple objects for single predicate (e.g. dc:title=Foo | dc:title=Bar).
Additionally, the existing criterias and regex parameters could be merged into one by using a list of tuples (predicate, object, regex) where regex: bool = False would signify whether to use regular expression search or not for a given criteria pair.
tripper/tripper/datadoc/dataset.py
Line 1399 in 17c0093
The existing search function does not provide means to:
While 2. may not be needed (or could even be hard for users to understand), 1. is valuable for users since it facilitates sort of "full text search" where the user does not necessarily need to know the predicate value but knows the object value (e.g. title).
The API of the search call could be modified to support this in the following way: instead of a dictionary to pass in parameters, use a list of tuples
(predicate, object). PassingNonefor predicate value supports case 1 above. PassingNonefor object value supports case 2 above. Using this approach would also allow for cases where a user wants to search for multiple objects for single predicate (e.g.dc:title=Foo | dc:title=Bar).Additionally, the existing
criteriasandregexparameters could be merged into one by using a list of tuples(predicate, object, regex)whereregex: bool = Falsewould signify whether to use regular expression search or not for a given criteria pair.