-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inclusion of context object for ES Projection (#3245)
* feat (composite view): prepare inclusion of context object for ES * feat (composite view): prepare inclusion of context object for ES * chore (include context): propagate includeContext param * feat (include context): conditionally include context object for ES projection * chore (include context): remove print statement * feat (incluse context): make method to control inclusion of JSON-LD context * test (composite view): add test with included context object * docs (composite view): document the new includeContext flag * refactor (composite view): reformat code * refactor (composite view): reformat code * test (composite view): use separate view id for testing context inclusion * Updated event serializer tests * Fixed CompositeViewRoutesSpec * Added CompositeView integration tests for includeContext=true * Reordered includeContext field in composite view projection classes Co-authored-by: Bogdan Roman <[email protected]>
- Loading branch information
1 parent
04e1f6e
commit 4e5a887
Showing
22 changed files
with
766 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
172 changes: 172 additions & 0 deletions
172
...ins/composite-views/src/test/resources/serialization/view-created-no-include-context.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
{ | ||
"@type": "CompositeViewCreated", | ||
"id": "http://example.com/composite-view", | ||
"instant": "1970-01-01T00:00:00Z", | ||
"project": "myorg/myproj", | ||
"rev": 1, | ||
"source": { | ||
"projections": [ | ||
{ | ||
"@id": "http://example.com/blazegraph-projection", | ||
"@type": "SparqlProjection", | ||
"includeDeprecated": false, | ||
"includeMetadata": false, | ||
"permission": "views/query", | ||
"query": "prefix p: <http://localhost/>\nCONSTRUCT{ {resource_id} p:transformed ?v } WHERE { {resource_id} p:predicate ?v}", | ||
"resourceSchemas": [ | ||
], | ||
"resourceTypes": [ | ||
] | ||
}, | ||
{ | ||
"@id": "http://example.com/es-projection", | ||
"@type": "ElasticSearchProjection", | ||
"context": { | ||
}, | ||
"includeDeprecated": false, | ||
"includeMetadata": false, | ||
"mapping": { | ||
}, | ||
"permission": "views/query", | ||
"query": "prefix p: <http://localhost/>\nCONSTRUCT{ {resource_id} p:transformed ?v } WHERE { {resource_id} p:predicate ?v}", | ||
"resourceSchemas": [ | ||
], | ||
"resourceTypes": [ | ||
], | ||
"settings": { | ||
} | ||
} | ||
], | ||
"rebuildStrategy": { | ||
"@type": "Interval", | ||
"value": "1 minute" | ||
}, | ||
"sources": [ | ||
{ | ||
"@id": "http://example.com/cross-project-source", | ||
"@type": "CrossProjectEventStream", | ||
"identities": [ | ||
{ | ||
"@id": "http://localhost/v1/anonymous", | ||
"@type": "Anonymous" | ||
} | ||
], | ||
"includeDeprecated": false, | ||
"project": "org/otherproject", | ||
"resourceSchemas": [ | ||
], | ||
"resourceTypes": [ | ||
] | ||
}, | ||
{ | ||
"@id": "http://example.com/remote-project-source", | ||
"@type": "RemoteProjectEventStream", | ||
"endpoint": "http://example.com/remote-endpoint", | ||
"includeDeprecated": false, | ||
"project": "org/remoteproject", | ||
"resourceSchemas": [ | ||
], | ||
"resourceTypes": [ | ||
] | ||
}, | ||
{ | ||
"@id": "http://example.com/project-source", | ||
"@type": "ProjectEventStream", | ||
"includeDeprecated": false, | ||
"resourceSchemas": [ | ||
], | ||
"resourceTypes": [ | ||
] | ||
} | ||
] | ||
}, | ||
"subject": { | ||
"@type": "User", | ||
"realm": "myrealm", | ||
"subject": "myuser" | ||
}, | ||
"uuid": "{{uuid}}", | ||
"value": { | ||
"projections": [ | ||
{ | ||
"@type": "SparqlProjection", | ||
"id": "http://example.com/blazegraph-projection", | ||
"includeDeprecated": false, | ||
"includeMetadata": false, | ||
"permission": "views/query", | ||
"query": "prefix p: <http://localhost/>\nCONSTRUCT{ {resource_id} p:transformed ?v } WHERE { {resource_id} p:predicate ?v}", | ||
"resourceSchemas": [ | ||
], | ||
"resourceTypes": [ | ||
], | ||
"uuid": "{{uuid}}" | ||
}, | ||
{ | ||
"@type": "ElasticSearchProjection", | ||
"context": { | ||
}, | ||
"id": "http://example.com/es-projection", | ||
"includeDeprecated": false, | ||
"includeMetadata": false, | ||
"mapping": { | ||
}, | ||
"permission": "views/query", | ||
"query": "prefix p: <http://localhost/>\nCONSTRUCT{ {resource_id} p:transformed ?v } WHERE { {resource_id} p:predicate ?v}", | ||
"resourceSchemas": [ | ||
], | ||
"resourceTypes": [ | ||
], | ||
"settings": { | ||
}, | ||
"uuid": "{{uuid}}" | ||
} | ||
], | ||
"rebuildStrategy": { | ||
"@type": "Interval", | ||
"value": "1 minute" | ||
}, | ||
"sources": [ | ||
{ | ||
"@type": "RemoteProjectSource", | ||
"endpoint": "http://example.com/remote-endpoint", | ||
"id": "http://example.com/remote-project-source", | ||
"includeDeprecated": false, | ||
"project": "org/remoteproject", | ||
"resourceSchemas": [ | ||
], | ||
"resourceTypes": [ | ||
], | ||
"token": { | ||
"value": "vv/MQBHmWaNm+TX/EigReQ==" | ||
}, | ||
"uuid": "{{uuid}}" | ||
}, | ||
{ | ||
"@type": "ProjectSource", | ||
"id": "http://example.com/project-source", | ||
"includeDeprecated": false, | ||
"resourceSchemas": [ | ||
], | ||
"resourceTypes": [ | ||
], | ||
"uuid": "{{uuid}}" | ||
}, | ||
{ | ||
"@type": "CrossProjectSource", | ||
"id": "http://example.com/cross-project-source", | ||
"identities": [ | ||
{ | ||
"@type": "Anonymous" | ||
} | ||
], | ||
"includeDeprecated": false, | ||
"project": "org/otherproject", | ||
"resourceSchemas": [ | ||
], | ||
"resourceTypes": [ | ||
], | ||
"uuid": "{{uuid}}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.