@paulhectork/aiiinotate 0.12.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/LICENSE +661 -0
- package/README.md +206 -0
- package/cli/export.js +118 -0
- package/cli/import.js +111 -0
- package/cli/index.js +45 -0
- package/cli/migrate.js +131 -0
- package/cli/serve.js +29 -0
- package/cli/utils/fastifyClient.js +86 -0
- package/cli/utils/io.js +225 -0
- package/cli/utils/mongoClient.js +21 -0
- package/cli/utils/progressbar.js +86 -0
- package/cli/xywhToInt.js +99 -0
- package/config/.env.template +48 -0
- package/docker/Dockerfile +39 -0
- package/docker/README.md +5 -0
- package/docker/docker-compose.yaml +49 -0
- package/docker/docker.sh +43 -0
- package/docker/docker_aiiinotate_import.sh +62 -0
- package/docs/api.md +381 -0
- package/docs/cli.md +132 -0
- package/docs/dev_documentation/dev_architecture.md +88 -0
- package/docs/dev_documentation/dev_db.md +58 -0
- package/docs/dev_documentation/dev_iiif_compatibility.md +43 -0
- package/docs/dev_documentation/dev_notes_quirks_and_troubleshooting.md +143 -0
- package/docs/docker.md +98 -0
- package/docs/includes/report_benchmark_aiiinotate_2026-05-28-02:50:48_7steps.png +0 -0
- package/docs/scalability.md +34 -0
- package/docs/specifications/0_w3c_open_annotations.md +332 -0
- package/docs/specifications/1_w3c_web_annotations.md +577 -0
- package/docs/specifications/2_iiif_apis.md +428 -0
- package/docs/specifications/3_iiif_annotations.md +103 -0
- package/docs/specifications/4_search_api.md +135 -0
- package/docs/specifications/5_sas.md +119 -0
- package/docs/specifications/6_mirador.md +119 -0
- package/docs/specifications/7_aikon.md +137 -0
- package/docs/specifications/include/presentation_2.0.webp +0 -0
- package/docs/specifications/include/presentation_2.0_white.png +0 -0
- package/docs/specifications/include/presentation_3.0.png +0 -0
- package/docs/specifications/include/presentation_3.0_resize.png +0 -0
- package/eslint.config.js +30 -0
- package/migrations/baseConfig.js +57 -0
- package/migrations/manageIndex.js +55 -0
- package/migrations/migrate-mongo-config-main.js +8 -0
- package/migrations/migrate-mongo-config-test.js +8 -0
- package/migrations/migrationScripts/20250825185706-collections.js +48 -0
- package/migrations/migrationScripts/20250826194832-annotations2-schema.js +42 -0
- package/migrations/migrationScripts/20250904080710-annotations2-indexes.js +69 -0
- package/migrations/migrationScripts/20251002141951-manifests2-schema.js +43 -0
- package/migrations/migrationScripts/20251006212110-manifests2-indexes.js +35 -0
- package/migrations/migrationTemplate.js +25 -0
- package/package.json +82 -0
- package/scripts/get_version.py +12 -0
- package/scripts/run.sh +36 -0
- package/scripts/setup_mongodb.sh +70 -0
- package/scripts/setup_node.sh +15 -0
- package/scripts/update_version.py +30 -0
- package/scripts/utils.sh +65 -0
- package/src/app.js +116 -0
- package/src/constants.js +73 -0
- package/src/data/annotations/annotations2.js +681 -0
- package/src/data/annotations/annotations3.js +28 -0
- package/src/data/annotations/routes.js +335 -0
- package/src/data/annotations/routes.test.js +271 -0
- package/src/data/collectionAbstract.js +283 -0
- package/src/data/index.js +29 -0
- package/src/data/manifests/manifests2.js +378 -0
- package/src/data/manifests/manifests2.test.js +53 -0
- package/src/data/manifests/manifests3.js +23 -0
- package/src/data/manifests/routes.js +122 -0
- package/src/data/manifests/routes.test.js +70 -0
- package/src/data/routes.js +181 -0
- package/src/data/routes.test.js +166 -0
- package/src/db/index.js +50 -0
- package/src/fixtures/annotations.js +41 -0
- package/src/fixtures/data/annotationList_aikon_wit9_man11_anno165_all.jsonld +827 -0
- package/src/fixtures/data/annotationList_vhs_wit250_man250_anno250_all.jsonld +37514 -0
- package/src/fixtures/data/annotationList_vhs_wit253_man253_anno253_all.jsonld +20111 -0
- package/src/fixtures/data/annotations2Invalid.jsonld +39 -0
- package/src/fixtures/data/annotations2SvgValid.jsonld +81 -0
- package/src/fixtures/data/annotations2Valid.jsonld +39 -0
- package/src/fixtures/data/bnf_invalid_manifest.json +2806 -0
- package/src/fixtures/data/bnf_valid_manifest.json +2817 -0
- package/src/fixtures/data/vhs_wit253_man253_anno253_anno-24.json +1 -0
- package/src/fixtures/generate.js +181 -0
- package/src/fixtures/index.js +69 -0
- package/src/fixtures/manifests.js +14 -0
- package/src/fixtures/utils.js +37 -0
- package/src/schemas/index.js +100 -0
- package/src/schemas/schemasBase.js +19 -0
- package/src/schemas/schemasPresentation2.js +410 -0
- package/src/schemas/schemasPresentation3.js +33 -0
- package/src/schemas/schemasResolver.js +71 -0
- package/src/schemas/schemasRoutes.js +318 -0
- package/src/server.js +25 -0
- package/src/types.js +97 -0
- package/src/utils/iiif2Utils.js +332 -0
- package/src/utils/iiif2Utils.test.js +146 -0
- package/src/utils/iiif3Utils.js +0 -0
- package/src/utils/iiifUtils.js +18 -0
- package/src/utils/logger.js +119 -0
- package/src/utils/routeUtils.js +137 -0
- package/src/utils/svg.js +417 -0
- package/src/utils/testUtils.js +289 -0
- package/src/utils/utils.js +403 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"@id" : "http://aikon.enpc.fr/sas/annotation/wit9_man11_anno165_c12_80a76d17911c4fdd9f6f14638e861305",
|
|
4
|
+
"@type" : "oa:Annotation",
|
|
5
|
+
"dcterms:created" : "2025-03-19T14:38:38",
|
|
6
|
+
"dcterms:modified" : "2025-03-19T14:38:38",
|
|
7
|
+
"resource" : {
|
|
8
|
+
"@type" : "dctypes:Text",
|
|
9
|
+
"format" : "text/html",
|
|
10
|
+
"chars" : "<p></p>",
|
|
11
|
+
"https://aikon.enpc.fr/sas/full_text" : "",
|
|
12
|
+
"https://iscd.huma-num.fr/sas/full_text" : ""
|
|
13
|
+
},
|
|
14
|
+
"on" : "",
|
|
15
|
+
"motivation" : [ "oa:tagging", "oa:commenting" ],
|
|
16
|
+
"@context" : "http://iiif.io/api/presentation/2/context.json",
|
|
17
|
+
"label" : ""
|
|
18
|
+
}, {
|
|
19
|
+
"@id" : "http://aikon.enpc.fr/sas/annotation/wit9_man11_anno165_c13_ab273c69f957498f8400baeb9fd35359",
|
|
20
|
+
"@type" : "oa:Annotation",
|
|
21
|
+
"dcterms:created" : "2025-03-19T14:38:38",
|
|
22
|
+
"dcterms:modified" : "2025-03-19T14:38:38",
|
|
23
|
+
"resource" : {
|
|
24
|
+
"@type" : "dctypes:Text",
|
|
25
|
+
"format" : "text/html",
|
|
26
|
+
"chars" : "<p></p>",
|
|
27
|
+
"https://aikon.enpc.fr/sas/full_text" : "",
|
|
28
|
+
"https://iscd.huma-num.fr/sas/full_text" : ""
|
|
29
|
+
},
|
|
30
|
+
"on" : {
|
|
31
|
+
"@type": "oa:SpecificResource",
|
|
32
|
+
"full": "",
|
|
33
|
+
"selector": { "type": "FragmentSelector", "value": "#xywh=0,31,1529,1119" }
|
|
34
|
+
},
|
|
35
|
+
"motivation" : [ "oa:tagging", "oa:commenting" ],
|
|
36
|
+
"@context" : "http://iiif.io/api/presentation/2/context.json",
|
|
37
|
+
"label" : ""
|
|
38
|
+
}
|
|
39
|
+
]
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"@context": "http://iiif.io/api/presentation/2/context.json",
|
|
4
|
+
"@type": "oa:Annotation",
|
|
5
|
+
"maeData": {
|
|
6
|
+
"tags": [],
|
|
7
|
+
"target": {
|
|
8
|
+
"drawingState": "{\"currentShape\":{\"fill\":\"rgba(100,100,100, 0)\",\"height\":1,\"id\":\"13c9a5ea-1dc8-4bbe-b530-1dc78d66080d\",\"radius\":297.63210702341144,\"rotation\":0,\"scaleX\":1,\"scaleY\":1,\"stroke\":\"rgba(255,0, 0, 0.5)\",\"strokeWidth\":5,\"type\":\"circle\",\"width\":1,\"x\":1002.7023411371238,\"y\":384.3210702341137},\"isDrawing\":true,\"shapes\":[{\"fill\":\"rgba(100,100,100, 0)\",\"height\":1,\"id\":\"13c9a5ea-1dc8-4bbe-b530-1dc78d66080d\",\"radius\":297.63210702341144,\"rotation\":0,\"scaleX\":1,\"scaleY\":1,\"stroke\":\"rgba(255,0, 0, 0.5)\",\"strokeWidth\":5,\"type\":\"circle\",\"width\":1,\"x\":1002.7023411371238,\"y\":384.3210702341137}]}",
|
|
9
|
+
"fullCanvaXYWH": "0,0,1728,2500",
|
|
10
|
+
"scale": 0.8959537572254336,
|
|
11
|
+
"svg": "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='1728' height='2500'><defs/><g><g><path fill='rgb(100,100,100)' stroke='rgb(255,0,0' paint-order='fill stroke markers' d=' M 1300.3344481605352 384.3210702341137 A 297.63210702341144 297.63210702341144 0 1 1 1300.334299344494 384.02343817669544 Z' fill-opacity='0' stroke-miterlimit='10' stroke-width='3' stroke-dasharray=''/></g></g></svg>"
|
|
12
|
+
},
|
|
13
|
+
"templateType": "multiple_body",
|
|
14
|
+
"textBody": {
|
|
15
|
+
"purpose": "describing",
|
|
16
|
+
"type": "TextualBody",
|
|
17
|
+
"value": "<p>test 2</p>"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"motivation": [
|
|
21
|
+
"oa:commenting"
|
|
22
|
+
],
|
|
23
|
+
"@id": "http://127.0.0.1:4444/data/2/wit1_pdf1_anno24/annotation/c1_30f3166d-1889-4a7f-9d88-e1397d74ccfc",
|
|
24
|
+
"resource": [
|
|
25
|
+
{
|
|
26
|
+
"chars": "<p>test 2</p>",
|
|
27
|
+
"@type": "dctypes:Text",
|
|
28
|
+
"motivation": "describing"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"on": [
|
|
32
|
+
{
|
|
33
|
+
"@type": "oa:SpecificResource",
|
|
34
|
+
"full": "http://localhost:8000/aikon/iiif/v2/wit1_pdf1_anno24/canvas/c1.json",
|
|
35
|
+
"selector": {
|
|
36
|
+
"@type": "oa:Choice",
|
|
37
|
+
"default": {
|
|
38
|
+
"@type": "oa:SvgSelector",
|
|
39
|
+
"value": "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='1728' height='2500'><defs/><g><g><path fill='rgb(100,100,100)' stroke='rgb(255,0,0' paint-order='fill stroke markers' d=' M 1300.3344481605352 384.3210702341137 A 297.63210702341144 297.63210702341144 0 1 1 1300.334299344494 384.02343817669544 Z' fill-opacity='0' stroke-miterlimit='10' stroke-width='3' stroke-dasharray=''/></g></g></svg>"
|
|
40
|
+
},
|
|
41
|
+
"item": {
|
|
42
|
+
"@type": "oa:FragmentSelector",
|
|
43
|
+
"value": "http://localhost:8000/aikon/iiif/v2/wit1_pdf1_anno24/canvas/c1.json#"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"@context": "http://iiif.io/api/presentation/2/context.json",
|
|
51
|
+
"@type": "oa:Annotation",
|
|
52
|
+
"motivation": [
|
|
53
|
+
"oa:commenting"
|
|
54
|
+
],
|
|
55
|
+
"@id": "http://127.0.0.1:4444/data/2/wit1_pdf1_anno24/annotation/c1_30f3166d-1889-4a7f-9d88-8888888",
|
|
56
|
+
"resource": [
|
|
57
|
+
{
|
|
58
|
+
"chars": "<p>test 3</p>",
|
|
59
|
+
"@type": "dctypes:Text",
|
|
60
|
+
"motivation": "describing"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"on": [
|
|
64
|
+
{
|
|
65
|
+
"@type": "oa:SpecificResource",
|
|
66
|
+
"full": "http://localhost:8000/aikon/iiif/v2/wit1_pdf1_anno24/canvas/c1.json",
|
|
67
|
+
"selector": {
|
|
68
|
+
"@type": "oa:Choice",
|
|
69
|
+
"default": {
|
|
70
|
+
"@type": "oa:SvgSelector",
|
|
71
|
+
"value": "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' > <defs/> <g><g> <path d=' M 200 200 L 600 200 L 600 700 L 200 700 L 200 200 Z Z' fill='red' stroke='black' stroke-width='1' fill-opacity='0' stroke-miterlimit='10' stroke-dasharray='' /> </g></g> </svg>"
|
|
72
|
+
},
|
|
73
|
+
"item": {
|
|
74
|
+
"@type": "oa:FragmentSelector",
|
|
75
|
+
"value": "http://localhost:8000/aikon/iiif/v2/wit1_pdf1_anno24/canvas/c1.json#"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"@id" : "http://aikon.enpc.fr/sas/annotation/wit9_man11_anno165_c10_d47559c226ae4acaae2e50f5bbc6f4e8",
|
|
4
|
+
"@type" : "oa:Annotation",
|
|
5
|
+
"dcterms:created" : "2025-03-19T14:38:38",
|
|
6
|
+
"dcterms:modified" : "2025-03-19T14:38:38",
|
|
7
|
+
"resource" : {
|
|
8
|
+
"@type" : "dctypes:Text",
|
|
9
|
+
"format" : "text/html",
|
|
10
|
+
"chars" : "<p></p>",
|
|
11
|
+
"https://aikon.enpc.fr/sas/full_text" : "",
|
|
12
|
+
"https://iscd.huma-num.fr/sas/full_text" : ""
|
|
13
|
+
},
|
|
14
|
+
"on" : "https://aikon.enpc.fr/aikon/iiif/v2/wit9_man11_anno165/canvas/c10.json#xywh=5,0,1824,2161",
|
|
15
|
+
"motivation" : [ "oa:tagging", "oa:commenting" ],
|
|
16
|
+
"@context" : "http://iiif.io/api/presentation/2/context.json",
|
|
17
|
+
"label" : ""
|
|
18
|
+
}, {
|
|
19
|
+
"@id" : "http://aikon.enpc.fr/sas/annotation/wit9_man11_anno165_c11_403175bd3ee34e8bbc0df11e12c3c915",
|
|
20
|
+
"@type" : "oa:Annotation",
|
|
21
|
+
"dcterms:created" : "2025-03-19T14:38:38",
|
|
22
|
+
"dcterms:modified" : "2025-03-19T14:38:38",
|
|
23
|
+
"resource" : {
|
|
24
|
+
"@type" : "dctypes:Text",
|
|
25
|
+
"format" : "text/html",
|
|
26
|
+
"chars" : "<p></p>",
|
|
27
|
+
"https://aikon.enpc.fr/sas/full_text" : "",
|
|
28
|
+
"https://iscd.huma-num.fr/sas/full_text" : ""
|
|
29
|
+
},
|
|
30
|
+
"on" : {
|
|
31
|
+
"@type": "oa:SpecificResource",
|
|
32
|
+
"full": "https://aikon.enpc.fr/aikon/iiif/v2/wit9_man11_anno165/canvas/c11.json",
|
|
33
|
+
"selector": { "type": "FragmentSelector", "value": "#xywh=0,31,1529,1119" }
|
|
34
|
+
},
|
|
35
|
+
"motivation" : [ "oa:tagging", "oa:commenting" ],
|
|
36
|
+
"@context" : "http://iiif.io/api/presentation/2/context.json",
|
|
37
|
+
"label" : ""
|
|
38
|
+
}
|
|
39
|
+
]
|