-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source filtering use cases #1
Comments
In our case, we'd like to have additional filtering capabilities for which to optimize at the persistence level in order to reduce the amount of in-memory filtering we would otherwise have to do in order to satisfy a given query. This would bring RDF/JS a little closer to most common specs dealing with data management at a persistence level (SQL, SPARQL, ...). Practical use cases are near endless and I have a hard time thinking of a use case that would not benefit such a feature. In our specific case, we often work with large numbers of IoT devices and simple queries such as |
Our use case would be on the optimization of query engines by pushing down filters within the query plan to the storage level. As such, this matches the use case of @jacoscaz very well. |
The current interface allows accessing time series only if the interval is known and the timestamps are aligned. Then it's possible to do something like this: const subject = source.match(null, null, rdf.literal('2020-01-01T01:00'))[0].subject
const observation = source.match(subject) I would expect from a filter interface to be an evolution of the const subject = source.matchFilter(null, null, filter.and(
filter.gt(rdf.literal('2020-01-01T00:55:00.000')
filter.lte(rdf.literal('2020-01-01T01:00:00.000')
))[0].subject
const observation = source.match(subject) |
It should be possible to define custom filters. Below is an example for a text search filter. source.matchFilter(null, ns.rdfs.label, filterThisText) Where the function textSearchFilter (text) {
const test = term => {
return term.value.toLowerCase().includes(text.toLowerCase())
}
return {
termType: 'Filter',
type: 'CUSTOM_TEXT_SEARCH',
args: text,
test
}
} |
Following from rdfjs/data-model-spec#167 (comment) and rdfjs/data-model-spec#167 (comment), I’d like to address @rubensworks’ following concern:
I think you are definitely right - recursive definitions are more expressive. However, they also seem to be significantly harder to deal with from a development perspective and for I am not at all opposed to recursiveness, though, and I will get a chance to explore that further once I move to switch from |
Done in #4. |
As discussed in rdfjs/stream-spec#16, this issue serves as a place to collect use cases for why additional filtering capabilities are needed in the
Source
interface.The text was updated successfully, but these errors were encountered: