Inconsistency while searching literal terms and triples with literals
dinikolop opened this issue · comments
When somebody wants to run searchTerms for a literal prefix that includes (part of) its datatype, they should specify the bracket(s). However, removing the bracket(s) will not return suggestions.
On the other hand, calling searchTriples for a literal with its bracketed datatype, you won't get back results. Calling with no brackets is the only way to get results:
Returns results? | |
---|---|
doc.searchTerms({prefix: '"a"^^<ab', position: 'object'}) |
Yes |
doc.searchTerms({prefix: '"a"^^ab', position: 'object'}) |
No |
doc.searchTriples(null, null, '"a"^^<abc>') |
No |
doc.searchTriples(null, null, '"a"^^abc') |
Yes |
I think there should results in all cases in order to avoid this inconsistency. What do you think @RubenVerborgh ?
I can push at #37 , since I noticed during applying requested changes there.
Hmm, the assumption is that the library takes a valid RDF Term in the (old) N3.js representation. No validation is performed, so the behavior of invalid terms is undefined.
If we can fix the above as part of #37, I don't mind, but I wouldn't spend any CPU cycles on validation.