-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Issue type:
- ➕ Feature request
Description:
To structure capture the logic we have for keeping track of combined lazy/incremental reasoning. It should adhere to the following interface:
interface Patterns {
// Adds a pattern
add(quad: RDF.BaseQuad, done?: Promise<void>): boolean;
// Invalidate all patterns matching {quad}
invalidate(quad: RDF.BaseQuad): boolean;
// Check if there is a pattern matching {quad}. For instance if (?s, a, Person) has already been
// `add`ed then, has((?s, a, Person) and has((Jesse, a, Person)) should be true, while has((?s, a, Agent)) should be false.
// {resolved} Whether or not the pattern matching must be resolved. Default is false
has(quad: RDF.BaseQuad, resolved?: boolean): boolean;
// Resolves when any pattern matching {quad} is resolved
awaitPattern(quad: RDF.BaseQuad): Promise<void>;
}
I think this will also be useful in the core of Comunica @rubensworks. Rather than caching AsyncIterators
for remotely retrieved data, it can instead be cached inside an N3Store; and retrieved patterns are stored in the data structure adhering to the above interface.