Skip to content
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

Support for match patterns #14

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Prev Previous commit
Add documentation for extendedMatch
  • Loading branch information
Jan-PieterBaert committed Sep 1, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit df8ab3f521c39c26d5b7926e652551537b05f029
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -44,6 +44,16 @@ export default [
// form of element is {subject,predicate,object}
// predicate: { type: "uri", value: "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#isPartOf" }
},
extendedMatch: {
// list of elements in form as above
[{
predicate: { type: "uri", value: "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#isPartOf" },
subject: { type: "variable", "value": "var" }
},{
predicate: { type: "uri", value: "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#isPartOf" },
object: { type: "variable", "value": "var" }
}]
}
callback: {
url: "http://resource/.mu/delta", method: "POST"
},
@@ -62,6 +72,8 @@ The exported property contains an array of definitions, each linking a match to
- `match.subject`: Matches the subject. Both `type` and `value` may be specified.
- `match.predicate`: Matches the predicade. Both `type` and `value` may be specified.
- `match.object`: Matches the object. Both `type` and `value` may be specified.
- `extendedMatch`: A list of patterns to match against. All supplied patterns must match in the delta.
A special type `"variable"` can be used in patterns, variables with the same `value` will match to the same value.
- `callback`: The place to inform about a matched delta
- `callback.url`: URL to inform about a match
- `callback.method`: Method to use when informing about a match
@@ -75,6 +87,9 @@ The exported property contains an array of definitions, each linking a match to
The incoming delta messages are cached, since a match can cross multiple incoming delta messages.
The timeout of this cache can be configured in ms using the `CACHE_TIMEOUT` environment variable.

When matches can't be found in the cache they will be fetched from the database unless `FETCH_MISSING_MATCHES` is set to `false`


## Delta formats

The delta may be offered in multiple formats. Versions should match the exact string. Specify `options.resourceFormat` to indicate the specific resourceformat.