diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2fa01d..390efae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.7', '3.8', '3.9' ] + python-version: [ '3.8', '3.9', '3.10', '3.11' ] name: Python ${{ matrix.python-version }} sample steps: - uses: actions/checkout@v2 diff --git a/fixtures/3/point_selector.json b/fixtures/3/point_selector.json new file mode 100644 index 0000000..82741c5 --- /dev/null +++ b/fixtures/3/point_selector.json @@ -0,0 +1,89 @@ +{ + "@context": "http://iiif.io/api/presentation/3/context.json", + "id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/manifest.json", + "type": "Manifest", + "label": { + "en": [ + "Using a point selector for annotating a location on a map." + ] + }, + "summary": { + "en": [ + "A map containing an point with an annotation of the location." + ] + }, + "items": [ + { + "id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/canvas.json", + "type": "Canvas", + "label": { + "en": [ + "Chesapeake and Ohio Canal Pamphlet" + ] + }, + "height": 5212, + "width": 7072, + "items": [ + { + "id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/contentPage.json", + "type": "AnnotationPage", + "items": [ + { + "id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/content.json", + "type": "Annotation", + "motivation": "painting", + "body": { + "id": "https://iiif.io/api/image/3.0/example/reference/43153e2ec7531f14dd1c9b2fc401678a-88695674/full/max/0/default.jpg", + "type": "Image", + "format": "image/jpeg", + "height": 5212, + "width": 7072, + "service": [ + { + "id": "https://iiif.io/api/image/3.0/example/reference/43153e2ec7531f14dd1c9b2fc401678a-88695674", + "type": "ImageService3", + "profile": "level1" + } + ] + }, + "target": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/canvas.json" + } + ] + } + ], + "annotations": [ + { + "id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/page/p2/1", + "type": "AnnotationPage", + "items": [ + { + "id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/annotation/p0002-tag", + "type": "Annotation", + "label": { + "en": [ + "Annotation containing the name of the place annotated using the PointSelector." + ] + }, + "motivation": "tagging", + "body": { + "type": "TextualBody", + "value": "Town Creek Aqueduct", + "language": "en", + "format": "text/plain" + }, + "target": { + "type": "SpecificResource", + "source": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/canvas.json", + "selector": { + "type": "PointSelector", + "x": 3385, + "y": 1464 + } + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/schema/iiif_3_0.json b/schema/iiif_3_0.json index ea1bad9..ea304cd 100644 --- a/schema/iiif_3_0.json +++ b/schema/iiif_3_0.json @@ -1011,10 +1011,16 @@ { "type": "object", "properties": { - "type": { "type": "string" }, - "t": { "$ref": "#/types/duration" } + "type": { + "type": "string", + "pattern": "^PointSelector$", + "default": "PointSelector" + }, + "t": { "$ref": "#/types/duration" }, + "x": { "$ref": "#/types/dimension" }, + "y": { "$ref": "#/types/dimension" } }, - "required": ["type","t"] + "required": ["type"] }, { "type": "object", diff --git a/setup.py b/setup.py index 371d664..c424374 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ def run(self): name='iiif-presentation-validator', version='0.0.3', scripts=['iiif-presentation-validator.py'], + packages=['schema', 'tests'], classifiers=["Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: OS Independent", diff --git a/tests/test_validator.py b/tests/test_validator.py index ca244fe..85e60a9 100644 --- a/tests/test_validator.py +++ b/tests/test_validator.py @@ -148,7 +148,8 @@ def test07_check_manifest3(self): 'fixtures/3/anno_source.json', 'fixtures/3/range_range.json', 'fixtures/3/accompanyingCanvas.json', - 'fixtures/3/placeholderCanvas.json' + 'fixtures/3/placeholderCanvas.json', + 'fixtures/3/point_selector.json' ]: with open(good, 'r') as fh: print ('Testing: {}'.format(good))