meadow-integration 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +19 -0
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/debug/Harness.js +42 -0
- package/debug/mi-cli-test +3 -0
- package/docs/.nojekyll +0 -0
- package/docs/README.md +15 -0
- package/docs/examples/bookstore/BookData.md +51 -0
- package/docs/examples/bookstore/Generate_Bookstore_Comprehension.sh +6 -0
- package/docs/examples/bookstore/mapping_books_Author.json +12 -0
- package/docs/examples/bookstore/mapping_books_Book.json +14 -0
- package/docs/examples/bookstore/mapping_books_BookAuthorJoin.json +13 -0
- package/docs/examples/data/books.csv +10001 -0
- package/docs/examples/data/seattle_neighborhoods/Seattle_Data_Information.md +24 -0
- package/docs/examples/data/seattle_neighborhoods/housing_characteristics_Neighborhoods.csv +93 -0
- package/docs/examples/data/seattle_neighborhoods/housing_costs_Neighborhoods.csv +93 -0
- package/docs/examples/data/seattle_neighborhoods/race_ethnicity_Neighborhoods.csv +93 -0
- package/docs/examples/multi_set_integration/multi_set_step_by_step.md +55 -0
- package/docs/examples/multi_set_integration/multi_set_step_by_step_overview_diagram.excalidraw.svg +2 -0
- package/docs/examples/multi_set_integration/part_1_getting_data.md +19 -0
- package/docs/index.html +22 -0
- package/docs/vocabulary/Column.md +3 -0
- package/docs/vocabulary/Comprehension.md +3 -0
- package/docs/vocabulary/Confidence.md +5 -0
- package/docs/vocabulary/Data Capture Date.md +3 -0
- package/docs/vocabulary/Data Entry Date.md +3 -0
- package/docs/vocabulary/Entity.md +3 -0
- package/docs/vocabulary/Format.md +3 -0
- package/docs/vocabulary/GUID.md +0 -0
- package/docs/vocabulary/Join.md +0 -0
- package/docs/vocabulary/Record.md +0 -0
- package/docs/vocabulary/Schema.md +0 -0
- package/docs/vocabulary/Set.md +0 -0
- package/docs/vocabulary/Snapshot.md +0 -0
- package/docs/vocabulary/Source.md +0 -0
- package/docs/vocabulary/Version.md +3 -0
- package/package.json +43 -0
- package/source/Meadow-Service-Integration-Adapter.js +555 -0
- package/source/Meadow-Service-Integration-GUIDMap.js +155 -0
- package/source/cli/Default-Meadow-Integration-Configuration.json +3 -0
- package/source/cli/Meadow-Integration-CLI-Program.js +35 -0
- package/source/cli/Meadow-Integration-CLI-Run.js +3 -0
- package/source/cli/commands/Meadow-Integration-Command-CSVCheck.js +149 -0
- package/source/cli/commands/Meadow-Integration-Command-CSVIntersect.js +213 -0
- package/source/cli/commands/Meadow-Integration-Command-CSVTransform.js +394 -0
- package/source/cli/commands/Meadow-Integration-Command-ComprehensionArray.js +106 -0
- package/source/cli/commands/Meadow-Integration-Command-ComprehensionIntersect.js +141 -0
- package/source/cli/commands/Meadow-Integration-Command-ComprehensionPush.js +149 -0
- package/source/cli/commands/Meadow-Integration-Command-ConvertXLSMToXLSX.js +105 -0
- package/source/cli/commands/Meadow-Integration-Command-ObjectArrayToCSV.js +159 -0
- package/source/cli/commands/Meadow-Integration-Command-TSVTransform.js +330 -0
- package/source/services/csv/Service-CSVCheck.js +149 -0
- package/source/services/csv/Service-CSVIntersect.js +209 -0
- package/source/services/csv/Service-CSVTransform.js +327 -0
- package/test/Meadow-Integration-Adapter_test.js +72 -0
- package/test/Meadow-Integration-GUIDMap_test.js +92 -0
- package/test/data/vega/Popular_Baby_Names.csv +69215 -0
- package/test/data/vega/airports.csv +3377 -0
- package/test/data/vega/flights-3m.csv +231084 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"type": "node",
|
|
9
|
+
"request": "launch",
|
|
10
|
+
"name": "Launch Program",
|
|
11
|
+
"skipFiles": [
|
|
12
|
+
"<node_internals>/**"
|
|
13
|
+
],
|
|
14
|
+
"program": "${workspaceFolder}/debug/Harness.js",
|
|
15
|
+
"cwd": "${workspaceFolder}/debug",
|
|
16
|
+
"args":["lint", "./templates"]
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Steven Velozo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Meadow Integration
|
|
2
|
+
|
|
3
|
+
A suite of tools for managing data into a centralized non-specific schema format.
|
|
4
|
+
|
|
5
|
+
These tools are built to be usable from the command-line, as a web service, or within your own codebase. This code repository presents these behaviors both as a suite of externally usable fable services, a command-line utility to leverage them and a set of web service behaviors.
|
|
6
|
+
|
|
7
|
+
## CSV Stuff
|
|
8
|
+
|
|
9
|
+
So you like the CSV format? So does this utility.
|
|
10
|
+
|
|
11
|
+
You can try out what it can do to provide stats on CSVs by running the following from the repository root:
|
|
12
|
+
|
|
13
|
+
```shell
|
|
14
|
+
npm start -- csvcheck ./documentation/examples/data/housing_costs_Neighborhoods_-8848403750169343217.csv
|
|
15
|
+
```
|
package/debug/Harness.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const libMeadowIntegrationCLI = require(`../source/cli/Meadow-Integration-CLI-Program.js`);
|
|
2
|
+
|
|
3
|
+
//libMeadowIntegrationCLI.run(['node', 'Harness.js', 'comprehensionintersect', 'Set1.json', '-i', 'Set2.json', '-o', 'Intersected-Comprehension-Set.json']);
|
|
4
|
+
|
|
5
|
+
//libMeadowIntegrationCLI.run(['node', 'Harness.js', 'objectarraytocsv', './Array-Comprehension-Intersected-Comprehension-Set.json.json']);
|
|
6
|
+
|
|
7
|
+
//libMeadowIntegrationCLI.run(['node', 'Harness.js', 'tsvtransform', './RIDOT.tsv', '-g', '{~D:Record.IDDocument~}']);
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// libMeadowIntegrationCLI.run([
|
|
11
|
+
// 'node', 'Harness.js',
|
|
12
|
+
// 'csvtransform',
|
|
13
|
+
// `${__dirname}/../docs/examples/data/books.csv`,
|
|
14
|
+
// '-m', `${__dirname}/../docs/examples/bookstore/mapping_books_Book.json`,
|
|
15
|
+
// /*'-i', `${__dirname}/Books-Comprehension.json`,*/
|
|
16
|
+
// '-o', `${__dirname}/Books-Comprehension.json`]);
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
// libMeadowIntegrationCLI.run([
|
|
20
|
+
// 'node', 'Harness.js',
|
|
21
|
+
// 'csvtransform',
|
|
22
|
+
// `${__dirname}/../docs/examples/data/books.csv`,
|
|
23
|
+
// '-m', `${__dirname}/../docs/examples/bookstore/mapping_books_Author.json`,
|
|
24
|
+
// '-i', `${__dirname}/Books-Comprehension.json`,
|
|
25
|
+
// '-o', `${__dirname}/Books-Comprehension.json`]);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// libMeadowIntegrationCLI.run([
|
|
29
|
+
// 'node', 'Harness.js',
|
|
30
|
+
// 'csvtransform',
|
|
31
|
+
// `${__dirname}/../docs/examples/data/books.csv`,
|
|
32
|
+
// '-m', `${__dirname}/../docs/examples/bookstore/mapping_books_BookAuthorJoin.json`,
|
|
33
|
+
// '-i', `${__dirname}/Books-Comprehension.json`,
|
|
34
|
+
// '-o', `${__dirname}/Books-Comprehension.json`]);
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
libMeadowIntegrationCLI.run([
|
|
38
|
+
'node', 'Harness.js',
|
|
39
|
+
'push',
|
|
40
|
+
`${__dirname}/Books-Comprehension.json`]);
|
|
41
|
+
|
|
42
|
+
|
package/docs/.nojekyll
ADDED
|
File without changes
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Meadow Integration
|
|
2
|
+
|
|
3
|
+
A suite of tools for managing data into a centralized non-specific schema format.
|
|
4
|
+
|
|
5
|
+
These tools are built to be usable from the command-line, as a web service, or within your own codebase. This code repository presents these behaviors both as a suite of externally usable fable services, a command-line utility to leverage them and a set of web service behaviors.
|
|
6
|
+
|
|
7
|
+
## CSV Stuff
|
|
8
|
+
|
|
9
|
+
So you like the CSV format? So does this utility.
|
|
10
|
+
|
|
11
|
+
You can try out what it can do to provide stats on CSVs by running the following from the repository root:
|
|
12
|
+
|
|
13
|
+
```shell
|
|
14
|
+
npm start -- csvcheck ./documentation/examples/data/housing_costs_Neighborhoods_-8848403750169343217.csv
|
|
15
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Processing and Importing Books
|
|
2
|
+
|
|
3
|
+
```shell
|
|
4
|
+
./mi-cli-test csvtransform ./books.csv -n "GUIDBook" -g "Book_{~D:Record.id~}" -e "Book" -o Books.json
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
This generates just a basic comprehension with the books in it.
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"id": "1",
|
|
12
|
+
"book_id": "2767052",
|
|
13
|
+
"best_book_id": "2767052",
|
|
14
|
+
"work_id": "2792775",
|
|
15
|
+
"books_count": "272",
|
|
16
|
+
"isbn": "439023483",
|
|
17
|
+
"isbn13": "9.78043902348e+12",
|
|
18
|
+
"authors": "Suzanne Collins",
|
|
19
|
+
"original_publication_year": "2008.0",
|
|
20
|
+
"original_title": "The Hunger Games",
|
|
21
|
+
"title": "The Hunger Games (The Hunger Games, #1)",
|
|
22
|
+
"language_code": "eng",
|
|
23
|
+
"average_rating": "4.34",
|
|
24
|
+
"ratings_count": "4780653",
|
|
25
|
+
"work_ratings_count": "4942365",
|
|
26
|
+
"work_text_reviews_count": "155254",
|
|
27
|
+
"ratings_1": "66715",
|
|
28
|
+
"ratings_2": "127936",
|
|
29
|
+
"ratings_3": "560092",
|
|
30
|
+
"ratings_4": "1481305",
|
|
31
|
+
"ratings_5": "2706317",
|
|
32
|
+
"image_url": "https://images.gr-assets.com/books/1447303603m/2767052.jpg",
|
|
33
|
+
"small_image_url": "https://images.gr-assets.com/books/1447303603s/2767052.jpg"
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"Entity": "Book",
|
|
40
|
+
"GUIDTemplate": "Book_{~D:Record.id~}",
|
|
41
|
+
"Mappings":
|
|
42
|
+
{
|
|
43
|
+
"Title": "{~D:Record.title~}",
|
|
44
|
+
"Language": "{~D:Record.language_code~}",
|
|
45
|
+
"PublicationYear": "{~D:Fable.Math.roundPrecise(Record.original_publication_year,0)~}",
|
|
46
|
+
"ISBN": "{~D:Record.isbn~}",
|
|
47
|
+
"Genre": "Unknown",
|
|
48
|
+
"Type": "Book",
|
|
49
|
+
"ImageURL": "{~D:Record.image_url~}"
|
|
50
|
+
}
|
|
51
|
+
```
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
node ../../../source/cli/Meadow-Integration-CLI-Run.js csvtransform ../data/books.csv -m ./mapping_book_author_join.json -o ./BookStore-Comprehension.json
|
|
3
|
+
|
|
4
|
+
node ../../../source/cli/Meadow-Integration-CLI-Run.js csvtransform ../data/books.csv -m ./mapping_book_author_join.json -o ./BookStore-Comprehension.json -i ./BookStore-Comprehension.json
|
|
5
|
+
|
|
6
|
+
node ../../../source/cli/Meadow-Integration-CLI-Run.js csvtransform ../data/books.csv -m ./mapping_book_author_join.json -o ./BookStore-Comprehension.json -i ./BookStore-Comprehension.json
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Entity": "Author",
|
|
3
|
+
"MultipleGUIDUniqueness": true,
|
|
4
|
+
"Solvers": [
|
|
5
|
+
"NewRecordsGUIDUniqueness = STRINGGETSEGMENTS(IncomingRecord.authors,\",\")"
|
|
6
|
+
],
|
|
7
|
+
"GUIDTemplate": "Author_{~PascalCaseIdentifier:Record._GUIDUniqueness~}",
|
|
8
|
+
"Mappings":
|
|
9
|
+
{
|
|
10
|
+
"Name": "{~D:Record._GUIDUniqueness~}"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Entity": "Book",
|
|
3
|
+
"GUIDTemplate": "Book_{~D:Record.id~}",
|
|
4
|
+
"Mappings":
|
|
5
|
+
{
|
|
6
|
+
"Title": "{~D:Record.title~}",
|
|
7
|
+
"Language": "{~D:Record.language_code~}",
|
|
8
|
+
"PublicationYear": "{~D:Fable.Math.roundPrecise(Record.original_publication_year,0)~}",
|
|
9
|
+
"ISBN": "{~D:Record.isbn~}",
|
|
10
|
+
"Genre": "Unknown",
|
|
11
|
+
"Type": "Book",
|
|
12
|
+
"ImageURL": "{~D:Record.image_url~}"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Entity": "BookAuthorJoin",
|
|
3
|
+
"MultipleGUIDUniqueness": true,
|
|
4
|
+
"Solvers": [
|
|
5
|
+
"NewRecordsGUIDUniqueness = STRINGGETSEGMENTS(IncomingRecord.authors,\",\")"
|
|
6
|
+
],
|
|
7
|
+
"GUIDTemplate": "BAJ_A_{~PascalCaseIdentifier:Record._GUIDUniqueness~}_B_{~D:Record.id~}",
|
|
8
|
+
"Mappings":
|
|
9
|
+
{
|
|
10
|
+
"GUIDBook": "Book_{~D:Record.id~}",
|
|
11
|
+
"GUIDAuthor": "Author_{~PascalCaseIdentifier:Record._GUIDUniqueness~}"
|
|
12
|
+
}
|
|
13
|
+
}
|