Skip to content

Commit 5ee595d

Browse files
authored
Entity resolution js (#7438)
1 parent ad59d3c commit 5ee595d

27 files changed

+1938
-0
lines changed

.doc_gen/metadata/entityresolution_metadata.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ entityresolution_Hello:
1212
- description:
1313
snippet_tags:
1414
- entityres.java2_hello.main
15+
JavaScript:
16+
versions:
17+
- sdk_version: 3
18+
github: javascriptv3/example_code/entityresolution
19+
excerpts:
20+
- description:
21+
snippet_tags:
22+
- javascript.v3.entity-resolution.hello
1523
services:
1624
entityresolution: {listMatchingWorkflows}
1725
entityresolution_DeleteSchemaMapping:
@@ -24,6 +32,14 @@ entityresolution_DeleteSchemaMapping:
2432
- description:
2533
snippet_tags:
2634
- entityres.java2_delete_mappings.main
35+
JavaScript:
36+
versions:
37+
- sdk_version: 3
38+
github: javascriptv3/example_code/entityresolution
39+
excerpts:
40+
- description:
41+
snippet_tags:
42+
- entity-resolution.JavaScriptv3.delete.schema-mapping
2743
services:
2844
entityresolution: {DeleteSchemaMapping}
2945
entityresolution_TagEntityResource:
@@ -36,6 +52,14 @@ entityresolution_TagEntityResource:
3652
- description:
3753
snippet_tags:
3854
- entityres.java2_tag_resource.main
55+
JavaScript:
56+
versions:
57+
- sdk_version: 3
58+
github: javascriptv3/example_code/entityresolution
59+
excerpts:
60+
- description:
61+
snippet_tags:
62+
- entity-resolution.JavaScriptv3.tag.entity-resource
3963
services:
4064
entityresolution: {TagEntityResource}
4165
entityresolution_CreateMatchingWorkflow:
@@ -48,6 +72,14 @@ entityresolution_CreateMatchingWorkflow:
4872
- description:
4973
snippet_tags:
5074
- entityres.java2_create_matching_workflow.main
75+
JavaScript:
76+
versions:
77+
- sdk_version: 3
78+
github: javascriptv3/example_code/entityresolution
79+
excerpts:
80+
- description:
81+
snippet_tags:
82+
- entity-resolution.JavaScriptv3.create-matching-workflow
5183
services:
5284
entityresolution: {CreateMatchingWorkflow}
5385
entityresolution_CheckWorkflowStatus:
@@ -60,6 +92,14 @@ entityresolution_CheckWorkflowStatus:
6092
- description:
6193
snippet_tags:
6294
- entityres.java2_check_matching_workflow.main
95+
JavaScript:
96+
versions:
97+
- sdk_version: 3
98+
github: javascriptv3/example_code/entityresolution
99+
excerpts:
100+
- description:
101+
snippet_tags:
102+
- entity-resolution.JavaScriptv3.check-workflow-status
63103
services:
64104
entityresolution: {CheckWorkflowStatus}
65105
entityresolution_StartMatchingJob:
@@ -72,6 +112,14 @@ entityresolution_StartMatchingJob:
72112
- description:
73113
snippet_tags:
74114
- entityres.java2_start_job.main
115+
JavaScript:
116+
versions:
117+
- sdk_version: 3
118+
github: javascriptv3/example_code/entityresolution
119+
excerpts:
120+
- description:
121+
snippet_tags:
122+
- entity-resolution.JavaScriptv3.start.matching-job
75123
services:
76124
entityresolution: {StartMatchingJob}
77125
entityresolution_GetMatchingJob:
@@ -84,6 +132,14 @@ entityresolution_GetMatchingJob:
84132
- description:
85133
snippet_tags:
86134
- entityres.java2_get_job.main
135+
JavaScript:
136+
versions:
137+
- sdk_version: 3
138+
github: javascriptv3/example_code/entityresolution
139+
excerpts:
140+
- description:
141+
snippet_tags:
142+
- entity-resolution.JavaScriptv3.get.matching-job
87143
services:
88144
entityresolution: {GetMatchingJob}
89145
entityresolution_DeleteMatchingWorkflow:
@@ -96,6 +152,14 @@ entityresolution_DeleteMatchingWorkflow:
96152
- description:
97153
snippet_tags:
98154
- entityres.java2_delete_matching_workflow.main
155+
JavaScript:
156+
versions:
157+
- sdk_version: 3
158+
github: javascriptv3/example_code/entityresolution
159+
excerpts:
160+
- description:
161+
snippet_tags:
162+
- entity-resolution.JavaScriptv3.delete-matching-workflow
99163
services:
100164
entityresolution: {DeleteMatchingWorkflow}
101165
entityresolution_ListSchemaMappings:
@@ -108,6 +172,14 @@ entityresolution_ListSchemaMappings:
108172
- description:
109173
snippet_tags:
110174
- entityres.java2_list_mappings.main
175+
JavaScript:
176+
versions:
177+
- sdk_version: 3
178+
github: javascriptv3/example_code/entityresolution
179+
excerpts:
180+
- description:
181+
snippet_tags:
182+
- entity-resolution.JavaScriptv3.list.schema-mapping
111183
services:
112184
entityresolution: {ListSchemaMappings}
113185
entityresolution_GetSchemaMapping:
@@ -120,6 +192,14 @@ entityresolution_GetSchemaMapping:
120192
- description:
121193
snippet_tags:
122194
- entityres.java2_get_schema_mapping.main
195+
JavaScript:
196+
versions:
197+
- sdk_version: 3
198+
github: javascriptv3/example_code/entityresolution
199+
excerpts:
200+
- description:
201+
snippet_tags:
202+
- entity-resolution.JavaScriptv3.get.schema-mapping
123203
services:
124204
entityresolution: {GetSchemaMapping}
125205
entityresolution_CreateSchemaMapping:
@@ -132,6 +212,14 @@ entityresolution_CreateSchemaMapping:
132212
- description:
133213
snippet_tags:
134214
- entityres.java2_create_schema.main
215+
JavaScript:
216+
versions:
217+
- sdk_version: 3
218+
github: javascriptv3/example_code/entityresolution
219+
excerpts:
220+
- description:
221+
snippet_tags:
222+
- entity-resolution.JavaScriptv3.create-schema-mapping
135223
services:
136224
entityresolution: {CreateSchemaMapping}
137225
entityresolution_Scenario:
@@ -158,5 +246,14 @@ entityresolution_Scenario:
158246
- description: A wrapper class for &ERlong; SDK methods.
159247
snippet_tags:
160248
- entityres.java2_actions.main
249+
JavaScript:
250+
versions:
251+
- sdk_version: 2
252+
github: javav2/example_code/entityresolution
253+
sdkguide:
254+
excerpts:
255+
- description: Run an interactive scenario demonstrating &ERlong; features.
256+
snippet_tags:
257+
- entity-resolution.JavaScriptv3.scenario.basics
161258
services:
162259
entityresolution: {}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# AWS Entity Resolution code examples for the SDK for JavaScript (v3)
2+
3+
## Overview
4+
5+
Shows how to use the AWS SDK for JavaScript (v3) to work with AWS Entity Resolution.
6+
7+
<!--custom.overview.start-->
8+
<!--custom.overview.end-->
9+
10+
_AWS Entity Resolution helps organizations extract, link, and organize information from multiple data sources._
11+
12+
## ⚠ Important
13+
14+
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/).
15+
* Running the tests might result in charges to your AWS account.
16+
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
17+
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
18+
19+
<!--custom.important.start-->
20+
<!--custom.important.end-->
21+
22+
## Code examples
23+
24+
### Prerequisites
25+
26+
For prerequisites, see the [README](../../README.md#Prerequisites) in the `javascriptv3` folder.
27+
28+
29+
<!--custom.prerequisites.start-->
30+
<!--custom.prerequisites.end-->
31+
32+
### Get started
33+
34+
- [Hello AWS Entity Resolution](hello.js#L4) (`listMatchingWorkflows`)
35+
36+
37+
### Single actions
38+
39+
Code excerpts that show you how to call individual service functions.
40+
41+
- [CreateMatchingWorkflow](actions/create-matching-workflow.js#L4)
42+
- [CreateSchemaMapping](actions/create-schema-mapping.js#L4)
43+
- [DeleteMatchingWorkflow](actions/delete-matching-workflow.js#L4)
44+
- [DeleteSchemaMapping](actions/delete-schema-mapping.js#L4)
45+
- [GetMatchingJob](actions/get-matching-job.js#L4)
46+
- [GetSchemaMapping](actions/get-schema-mapping.js#L4)
47+
- [ListSchemaMappings](actions/list-schema-mappings.js#L4)
48+
- [StartMatchingJob](actions/start-matching-job.js#L4)
49+
- [TagEntityResource](actions/tag-entity-resource.js#L4)
50+
51+
52+
<!--custom.examples.start-->
53+
<!--custom.examples.end-->
54+
55+
## Run the examples
56+
57+
### Instructions
58+
59+
**Note**: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see
60+
[JavaScript ES6/CommonJS syntax](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/sdk-examples-javascript-syntax.html).
61+
62+
**Run a single action**
63+
64+
```bash
65+
node ./actions/<fileName>
66+
```
67+
68+
**Run a scenario**
69+
70+
Most scenarios can be run with the following command:
71+
```bash
72+
node ./scenarios/<fileName>
73+
```
74+
75+
**Run with options**
76+
77+
Some actions and scenarios can be run with options from the command line:
78+
```bash
79+
node ./scenarios/<fileName> --option1 --option2
80+
```
81+
[util.parseArgs](https://nodejs.org/api/util.html#utilparseargsconfig) is used to configure
82+
these options. For the specific options available to each script, see the `parseArgs` usage
83+
for that file.
84+
85+
<!--custom.instructions.start-->
86+
<!--custom.instructions.end-->
87+
88+
#### Hello AWS Entity Resolution
89+
90+
This example shows you how to get started using AWS Entity Resolution.
91+
92+
```bash
93+
node ./hello.js
94+
```
95+
96+
97+
### Tests
98+
99+
⚠ Running tests might result in charges to your AWS account.
100+
101+
102+
To find instructions for running these tests, see the [README](../../README.md#Tests)
103+
in the `javascriptv3` folder.
104+
105+
106+
107+
<!--custom.tests.start-->
108+
<!--custom.tests.end-->
109+
110+
## Additional resources
111+
112+
- [AWS Entity Resolution User Guide](https://docs.aws.amazon.com/entityresolution/latest/userguide/what-is-service.html)
113+
- [AWS Entity Resolution API Reference](https://docs.aws.amazon.com/entityresolution/latest/apireference/Welcome.html)
114+
- [SDK for JavaScript (v3) AWS Entity Resolution reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/entityresolution/)
115+
116+
<!--custom.resources.start-->
117+
<!--custom.resources.end-->
118+
119+
---
120+
121+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
122+
123+
SPDX-License-Identifier: Apache-2.0
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// snippet-start:[entity-resolution.JavaScriptv3.check-workflow-status]
5+
6+
//The default inputs for this demo are read from the ../inputs.json.
7+
8+
import { fileURLToPath } from "node:url";
9+
10+
import {
11+
GetMatchingJobCommand,
12+
EntityResolutionClient,
13+
} from "@aws-sdk/client-entityresolution";
14+
import data from "../inputs.json" with { type: "json" };
15+
16+
const region = "eu-west-1";
17+
const erClient = new EntityResolutionClient({ region: region });
18+
19+
export const main = async ({ workflowName, jobId }) => {
20+
const getMatchingJobParams = {
21+
workflowName: `${data.inputs.workflowName}`,
22+
jobId: `${data.inputs.jobId}`,
23+
};
24+
try {
25+
const command = new GetMatchingJobCommand(getMatchingJobParams);
26+
const response = await erClient.send(command);
27+
console.log(`Job status: ${response.status}`);
28+
} catch (error) {
29+
console.log("error ", error.message);
30+
}
31+
};
32+
33+
// snippet-end:[entity-resolution.JavaScriptv3.check-workflow-status]
34+
35+
// Invoke main function if this file was run directly.
36+
if (process.argv[1] === fileURLToPath(import.meta.url)) {
37+
main();
38+
}

0 commit comments

Comments
 (0)