-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description Please describe the change you have made. ## Checklist - [ ] Tests added/updated. - [ ] Run Demo Job Locally. - [ ] Documentation updated. - [ ] Changelogs updated in [CHANGELOG.cdf-tk.md](https://github.com/cognitedata/toolkit/blob/main/CHANGELOG.cdf-tk.md). - [ ] Template changelogs updated in [CHANGELOG.templates.md](https://github.com/cognitedata/toolkit/blob/main/CHANGELOG.templates.md). - [ ] Version bumped. [_version.py](https://github.com/cognitedata/toolkit/blob/main/cognite/cognite_toolkit/_version.py) and [pyproject.toml](https://github.com/cognitedata/toolkit/blob/main/pyproject.toml) per [semantic versioning](https://semver.org/).
- Loading branch information
Showing
218 changed files
with
2,156 additions
and
2,488 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
83 changes: 83 additions & 0 deletions
83
...e_toolkit/_builtin_modules/contextualization/cdf_entity_matching/auth/workflow.Group.yaml
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,83 @@ | ||
name: gp_workflow_{{ contextualizationId }} | ||
sourceId: {{ groupSourceId }} | ||
metadata: | ||
origin: cognite-toolkit | ||
capabilities: | ||
# minimum runtime capabilities | ||
- projectsAcl: | ||
actions: | ||
- READ | ||
- LIST | ||
scope: | ||
all: {} | ||
- groupsAcl: | ||
actions: | ||
- LIST | ||
scope: | ||
all: {} | ||
- sessionsAcl: | ||
actions: | ||
- CREATE | ||
scope: | ||
all: {} | ||
# query-specific capabilities | ||
- dataModelInstancesAcl: | ||
actions: | ||
- READ | ||
- WRITE | ||
- WRITE_PROPERTIES | ||
scope: | ||
spaceIdScope: | ||
spaceIds: | ||
{{ instanceSpaces }} | ||
- dataModelsAcl: | ||
actions: | ||
- READ | ||
scope: | ||
spaceIdScope: | ||
spaceIds: | ||
- {{ schemaSpace }} | ||
- annotationsAcl: | ||
actions: | ||
- READ | ||
- WRITE | ||
- SUGGEST | ||
- REVIEW | ||
scope: | ||
all: {} | ||
- entitymatchingAcl: | ||
actions: | ||
- READ | ||
- WRITE | ||
scope: | ||
all: {} | ||
- extractionConfigsAcl: | ||
actions: | ||
- READ | ||
scope: | ||
datasetScope: | ||
ids: | ||
- {{ dataset }} | ||
- extractionRunsAcl: | ||
actions: | ||
- READ | ||
- WRITE | ||
scope: | ||
datasetScope: | ||
ids: | ||
- {{ dataset }} | ||
- rawAcl: | ||
actions: | ||
- READ | ||
- WRITE | ||
scope: | ||
tableScope: | ||
dbsToTables: | ||
{{ rawStateDatabase }}: {} | ||
# Needed to call functions | ||
- functionsAcl: | ||
actions: | ||
- READ | ||
- WRITE | ||
scope: | ||
all: {} |
3 changes: 3 additions & 0 deletions
3
.../_builtin_modules/contextualization/cdf_entity_matching/data_models/annotation.Space.yaml
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,3 @@ | ||
space: {{ annotationSpace }} | ||
description: 'Space for storing annotations' | ||
name: '{{ annotationSpace }}' |
2 changes: 2 additions & 0 deletions
2
...iltin_modules/contextualization/cdf_entity_matching/data_models/annotation_type.Node.yaml
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,2 @@ | ||
space: {{ annotationSpace }} | ||
externalId: "entity.match" |
13 changes: 13 additions & 0 deletions
13
..._builtin_modules/contextualization/cdf_entity_matching/data_models/sourceSystem.node.yaml
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,13 @@ | ||
space: {{ annotationSpace }} | ||
externalId: {{ contextualizationId }} | ||
sources: | ||
- source: | ||
type: view | ||
space: cdf_cdm | ||
externalId: CogniteSourceSystem | ||
version: v1 | ||
properties: | ||
name: '{{ contextualizationName }}' | ||
description: 'Creates Entity Matching annotations which are used to connect nodes.' | ||
version: "v1" | ||
manufacturer: "Cognite" |
3 changes: 3 additions & 0 deletions
3
...in_modules/contextualization/cdf_entity_matching/data_sets/contextualization.DataSet.yaml
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,3 @@ | ||
name: {{ contextualizationName }} | ||
externalId: {{ dataset }} | ||
description: {{ contextualizationName }} |
16 changes: 16 additions & 0 deletions
16
cognite_toolkit/_builtin_modules/contextualization/cdf_entity_matching/default.config.yaml
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,16 @@ | ||
contextualizationId: entity_matcher | ||
contextualizationName: Entity Matcher | ||
annotatorJob: ctx_entity_matching | ||
directRelationJob: ctx_files_direct_relation_write | ||
dataset: ingestion | ||
rawStateDatabase: contextualizationState | ||
rawStateTable: entityMatching | ||
schemaSpace: cdf_cdm | ||
annotationSpace: springfield_instances | ||
instanceSpaces: | ||
- springfield_instances | ||
|
||
groupSourceId: <not set> | ||
workflow: entity_matching | ||
workflowClientId: ${IDP_WF_CLIENT_ID} | ||
workflowClientSecret: ${IDP_WF_CLIENT_SECRET} |
54 changes: 54 additions & 0 deletions
54
...ity_matching/extraction_pipelines/ctx_files_direct_relation_write.ExtractionPipeline.yaml
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,54 @@ | ||
externalId: '{{ directRelationJob }}' | ||
name: 'Direct Relation Writer' | ||
dataSetExternalId: {{ dataset }} | ||
description: Writes direct relations based on annotations. | ||
documentation: > | ||
# Direct Relation Writer | ||
This extraction pipeline is responsible for writing the direct relations into | ||
a data model based on annotations. | ||
## Annotations | ||
Annotations are found based on three criteria: | ||
1. It has to have data in the (`cdf_cdm", "CogniteAnnotation`, `v1`) view. | ||
2. It is stored in the space configured in the `annotationSpace`. | ||
3. It has to have a `sourceContext` that contains the views of the start and end nodes of the relations. | ||
```json | ||
{"start" : { | ||
"space": "cdf_cdm", | ||
"externalId": "CogniteFile", | ||
"version": "v1" | ||
}, | ||
"end" : { | ||
"space": "cdf_cdm", | ||
"externalId": "CogniteAsset", | ||
"version": "v1" | ||
}} | ||
``` | ||
## Configuration | ||
The configuration of the direct relation writer: | ||
```yaml | ||
state: # The Annotation writer uses the instances/sync endpoint to fetch annotations. | ||
# The state stores the last cursor. | ||
rawDatabase: <> | ||
rawTable: <> | ||
data: | ||
annotationSpace: <> # The space the edges for the annotations are stored. | ||
directRelationMapping: # How to go from Annotation to DirectRelation | ||
- startNodeView: # The view of the start node. | ||
space: <> . | ||
externalId: <> | ||
version: <> | ||
directRelationProperty: <> # The property that contains the direct relation. | ||
# Must be set either on the start or end node. | ||
endNodeView: # The view of the end node. | ||
space: <> | ||
externalId: <> | ||
version: <> | ||
# directRelationProperty: <> # Must be set either on the start or end node. | ||
``` |
26 changes: 26 additions & 0 deletions
26
...tion/cdf_entity_matching/extraction_pipelines/ctx_files_direct_relation_write.config.yaml
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,26 @@ | ||
externalId: '{{ directRelationJob }}' | ||
config: | ||
state: | ||
rawDatabase: {{ rawStateDatabase }} | ||
rawTable: {{ rawStateTable }} | ||
data: | ||
annotationSpace: '{{ annotationSpace }}' | ||
directRelationMappings: | ||
- startNodeView: | ||
space: {{ schemaSpace }} | ||
externalId: CogniteTimeSeries | ||
version: v1 | ||
directRelationProperty: equipment | ||
endNodeView: | ||
space: {{ schemaSpace }} | ||
externalId: CogniteEquipment | ||
version: v1 | ||
- startNodeView: | ||
space: {{ schemaSpace }} | ||
externalId: CogniteTimeSeries | ||
version: v1 | ||
directRelationProperty: assets | ||
endNodeView: | ||
space: {{ schemaSpace }} | ||
externalId: CogniteAsset | ||
version: v1 |
48 changes: 48 additions & 0 deletions
48
...cdf_entity_matching/extraction_pipelines/ctx_files_entity_matcher.ExtractionPipeline.yaml
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,48 @@ | ||
externalId: '{{ annotatorJob }}' | ||
name: 'Entity Matcher' | ||
dataSetExternalId: {{ dataset }} | ||
description: "Matches entities based on their properties" | ||
documentation: > | ||
# Entity Matcher | ||
This extraction pipeline is responsible for matching entities based on their properties. | ||
This means it looks for, for example, how to match time series to assets, or time series | ||
to equipment, based on the properties of these. This is useful when you have data from different | ||
sources and you only have partially the same information. | ||
## Configuration | ||
```yaml | ||
parameters: | ||
autoApprovalThreshold: # Automatically set the annotation as approved if the confidence is above this threshold | ||
autoRejectThreshold: # Automatically reject the annotation if the confidence is below this threshold | ||
featureType: "bigram" # The type of features to use for the matching. | ||
# "simple" "insensitive" "bigram" "frequencyweightedbigram" "bigramextratokenizers" "bigramcombo" | ||
sourceSystem: # The source system of the annotations written by this pipeline | ||
space: <> | ||
externalId: <> | ||
state: # The entity matcher uses the instances/sync endpoint to fetch sources entities,i.e, ensuring they are only used once. | ||
rawDatabase: <> | ||
rawTable: <> | ||
data: | ||
annotationSpace: # The space to write the annotations to | ||
instanceSpaces: | ||
- # The space to fetch entities such as Assets, Equipment, etc. from | ||
- # Another space to fetch entities from | ||
matchingJobs: | ||
jobName: | ||
sourceView: | ||
space: <> | ||
externalId: <> | ||
version: <> | ||
properties: # The properties to use for the matching | ||
- propertyA | ||
- propertyB | ||
targetViews: | ||
- space: <> | ||
externalId: <> | ||
version: <> | ||
properties: # The properties to use for the matching | ||
- propertyA | ||
- propertyB | ||
``` |
Oops, something went wrong.