diff --git a/recipe/0135-annotating-point-in-canvas/index.md b/recipe/0135-annotating-point-in-canvas/index.md index cf21fbab6..777a9133e 100644 --- a/recipe/0135-annotating-point-in-canvas/index.md +++ b/recipe/0135-annotating-point-in-canvas/index.md @@ -27,7 +27,7 @@ This example uses a leaflet with a map and a guide supplied by the Library of Co {% include manifest_links.html viewers="Glycerine Viewer" manifest="manifest.json" %} -{% include jsonviewer.html src="manifest.json" config='data-line="74-82"' %} +{% include jsonviewer.html src="manifest.json" config='data-line="69-76"' %} # Related recipes diff --git a/recipe/0135-annotating-point-in-canvas/manifest.json b/recipe/0135-annotating-point-in-canvas/manifest.json index bfc8d0b17..2138e56b8 100644 --- a/recipe/0135-annotating-point-in-canvas/manifest.json +++ b/recipe/0135-annotating-point-in-canvas/manifest.json @@ -59,11 +59,6 @@ { "id": "{{ id.path }}/annotation/p0002-tag", "type": "Annotation", - "label": { - "en": [ - "Annotation containing the name of the place annotated using the PointSelector." - ] - }, "motivation": "tagging", "body": { "type": "TextualBody", diff --git a/recipe/0139-geolocate-canvas-fragment/index.md b/recipe/0139-geolocate-canvas-fragment/index.md index 1fbada18e..1b70772b9 100644 --- a/recipe/0139-geolocate-canvas-fragment/index.md +++ b/recipe/0139-geolocate-canvas-fragment/index.md @@ -22,7 +22,7 @@ A Canvas has a region of interest that contains a map. You would like to associa ### Implementation Notes The third party [GeoJSON-LD](https://geojson.org/geojson-ld/) context is included in addition to the IIIF Presentation API 3.0 context. The GeoJSON-LD context supplies the vocabulary terms for the Annotation bodies since the IIIF Presentation API 3.0 context does not describe those terms. When there are multiple contexts, the `@context` property can be an array which is processed as a set. Typically order does not matter for a set. However, when the IIIF context is used in these arrays it must be the last item in the set. -The GeoJSON `properties` object is generic and [can be nearly anything](https://tools.ietf.org/html/rfc7946#section-3.2). It is used to pass metadata along with the geocoordinates. This has implications on clients and parsers that must discern what data to use. For example, if the targeted resource has a `label` property and the `properties` object has a `label` property, the consuming interface must make a choice on which to prioritize for presentation purposes. In the image from the Use Case section, the "Label" uses the GeoJSON `properties` object's `label` property (lines 80-83) instead of the `label` property from the Annotation or Canvas. This is because web mapping clients are designed to look for metadata in GeoJSON `properties` for display. +The GeoJSON `properties` object is generic and [can be nearly anything](https://tools.ietf.org/html/rfc7946#section-3.2). It is used to pass metadata along with the geocoordinates. This has implications on clients and parsers that must discern what data to use. For example, if the targeted resource had a `label` property and the `properties` object has a `label` property, the consuming interface must make a choice on which to prioritize for presentation purposes. In the image from the Use Case section, the "Label" uses the GeoJSON `properties` object's `label` property (lines 69-75) instead of the `label` property from the Annotation or Canvas. This is because web mapping clients are designed to look for metadata in GeoJSON `properties` for display. Note that [`geometry` has more types besides `Polygon`.](https://tools.ietf.org/html/rfc7946#section-3.1) @@ -34,7 +34,7 @@ The Manifest has one Canvas with one Image, and the Canvas has the same size dim {% include manifest_links.html viewers="Annona" manifest="manifest.json" %} -{% include jsonviewer.html src="manifest.json" config='data-line="2-5, 67-111"' %} +{% include jsonviewer.html src="manifest.json" config='data-line="2-5, 62-101"' %} ## Related Recipes * [Fragment Selectors][0020] diff --git a/recipe/0139-geolocate-canvas-fragment/manifest.json b/recipe/0139-geolocate-canvas-fragment/manifest.json index 196679b6b..cb69dd9ce 100644 --- a/recipe/0139-geolocate-canvas-fragment/manifest.json +++ b/recipe/0139-geolocate-canvas-fragment/manifest.json @@ -35,11 +35,6 @@ "id":"{{ id.path }}/content.json", "type":"Annotation", "motivation":"painting", - "label":{ - "en":[ - "Pamphlet Cover" - ] - }, "body":{ "id":"https://iiif.io/api/image/3.0/example/reference/43153e2ec7531f14dd1c9b2fc401678a-88695674/full/max/0/default.jpg", "type":"Image", @@ -68,11 +63,6 @@ "id":"{{ id.path }}/geoAnno.json", "type":"Annotation", "motivation":"tagging", - "label":{ - "en":[ - "Annotation containing GeoJSON-LD coordinates that place the map depiction onto a Leaflet web map." - ] - }, "body":{ "id":"{{ id.path }}/geo.json", "type":"Feature", diff --git a/scripts/validate.py b/scripts/validate.py index 70dcb7bfd..e2c0fbf53 100755 --- a/scripts/validate.py +++ b/scripts/validate.py @@ -54,6 +54,43 @@ def validateIIIF(jsonData, filepath): else: return True +def checkForNonValidationIssues(data, filename): + type = data["type"] + # Look for label in annotation + if type == 'Manifest': + anyFailed = False + if 'items' in data: + for canvas in data['items']: + if 'items' in canvas: + for page in canvas['items']: + result = checkAnnotationPage(page) + if result: + anyFailed = True + print (f'Manifest {filename} contains a painting annotation in canvas {canvas['id']} which has a label in the annotation') + if 'annotations' in canvas: + for page in canvas['annotations']: + result = checkAnnotationPage(page) + if result: + anyFailed = True + print (f'Manifest {filename} contains an annotation in canvas {canvas['id']} which has a label in the annotation') + + if anyFailed: + return False + + elif type == 'AnnotationPage': + result = checkAnnotationPage(data) + if result: + print (f'AnnotationPage {filename} has a label in the annotation') + return False + return True + +def checkAnnotationPage(page): + if 'items' in page: + for annotation in page['items']: + if 'label' in annotation: + return True + return False + def loadYAML(location): with open(location, "r") as stream: try: @@ -94,9 +131,6 @@ def loadYAML(location): if not ignoreViewer: print ('Recipe {} is missing a `viewers` entry either add it or add the name of the recipe to _data.viewer_ignore.yml'.format(recipepath)) allPassed = False - - - files = findFilesToValidate("../_site", ".json") # Get JSON Schema @@ -116,6 +150,9 @@ def loadYAML(location): if not passed: allPassed = False # else it passed + passed = checkForNonValidationIssues(jsonData, jsonFilename) + if not passed: + allPassed = False else: print ('{}: Do not know how to validate JSON with type: {}'.format(errorJsonFilename, jsonData['type'])) else: