Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Refactor Science museum to use ProviderDataIngester (#576)

Olga Bulat991162bdf5d6
diff --git a/openverse_catalog/dags/providers/provider_api_scripts/science_museum.py b/openverse_catalog/dags/providers/provider_api_scripts/science_museum.py
index 20a748512..4557be605 100644
--- a/openverse_catalog/dags/providers/provider_api_scripts/science_museum.py
+++ b/openverse_catalog/dags/providers/provider_api_scripts/science_museum.py
@@ -1,37 +1,19 @@
import logging
+import re
+from typing import Dict, Optional, Tuple
from common.licenses import get_license_info
from common.loader import provider_details as prov
-from common.requester import DelayedRequester
-from common.storage.image import ImageStore
+from providers.provider_api_scripts.provider_data_ingester import ProviderDataIngester
-logging.basicConfig(
- format="%(asctime)s - %(name)s - %(levelname)s: %(message)s", level=logging.INFO
-)
logger = logging.getLogger(__name__)
LIMIT = 100
-DELAY = 5.0
-RETRIES = 3
-PROVIDER = prov.SCIENCE_DEFAULT_PROVIDER
-ENDPOINT = "https://collection.sciencemuseumgroup.org.uk/search/"
-
-delay_request = DelayedRequester(delay=DELAY)
-image_store = ImageStore(provider=PROVIDER)
-
-HEADERS = {"Accept": "application/json"}
-
-DEFAULT_QUERY_PARAMS = {
- "has_image": 1,
- "image_license": "CC",
- "page[size]": LIMIT,
- "page[number]": 0,
- "date[from]": 0,
- "date[to]": 1500,
-}
-
-YEAR_RANGE = [
+
+CC0_LICENSE = get_license_info(license_="cc0", license_version="1.0")
+
+YEAR_RANGES = [
(0, 1500),
(1500, 1750),
(1750, 1825),
@@ -45,198 +27,205 @@ YEAR_RANGE = [
(1990, 2020),
]
-# global variable to keep track of records pulled
-RECORD_IDS = []
-
-def main():
- logger.info("Begin: Science Museum script")
- for year_range in YEAR_RANGE:
- logger.info(f"Running for years {year_range}")
- from_year, to_year = year_range
- image_count = _page_records(from_year=from_year, to_year=to_year)
- logger.info(f"Images pulled till now {image_count}")
- image_count = image_store.commit()
- logger.info(f"Total images pulled {image_count}")
-
-
-def _page_records(from_year, to_year):
- image_count = 0
- page_number = 0
- condition = True
- while condition:
- query_param = _get_query_param(
- page_number=page_number, from_year=from_year, to_year=to_year
- )
- batch_data = _get_batch_objects(query_param=query_param)
- if type(batch_data) == list:
- if len(batch_data) > 0:
- image_count = _handle_object_data(batch_data)
- page_number += 1
- else:
- condition = False
+class ScienceMuseumDataIngester(ProviderDataIngester):
+ providers = {"image": prov.SCIENCE_DEFAULT_PROVIDER}
+ endpoint = "https://collection.sciencemuseumgroup.org.uk/search/"
+ batch_limit = 1000
+ delay = 5
+ headers = {"Accept": "application/json"}
+
+ def __init__(self):
+
+ super().__init__()
+ # instance variable to prevent duplicate records
+ self.RECORD_IDS = set()
+
+ def ingest_records(self, **kwargs):
+ for year_range in YEAR_RANGES:
+ logger.info(f"==Starting on year range: {year_range}==")
+ super().ingest_records(year_range=year_range)
+
+ def get_next_query_params(self, prev_query_params, **kwargs):
+ from_, to_ = kwargs["year_range"]
+ if not prev_query_params:
+ # Return default query params on the first request
+ return {
+ "has_image": 1,
+ "image_license": "CC",
+ "page[size]": LIMIT,
+ "page[number]": 0,
+ "date[from]": from_,
+ "date[to]": to_,
+ }
else:
- condition = False
- return image_count
-
-
-def _get_query_param(
- page_number=0, from_year=0, to_year=1500, default_query_param=None
-):
- if default_query_param is None:
- default_query_param = DEFAULT_QUERY_PARAMS
- query_param = default_query_param.copy()
- query_param["page[number]"] = page_number
- query_param["date[from]"] = from_year
- query_param["date[to]"] = to_year
- return query_param
-
-
-def _get_batch_objects(
- endpoint=ENDPOINT, headers=None, retries=RETRIES, query_param=None
-):
- if headers is None:
- headers = HEADERS.copy()
- data = None
- for retry in range(retries):
- response = delay_request.get(endpoint, query_param, headers=headers)
- try:
- response_json = response.json()
- if "data" in response_json.keys():
- data = response_json.get("data")
- break
- except Exception as e:
- logger.error(f"Failed to due to {e}")
- return data
-
-
-def _handle_object_data(batch_data):
- image_count = 0
- for obj_ in batch_data:
- id_ = obj_.get("id")
- if id_ in RECORD_IDS:
- continue
- RECORD_IDS.append(id_)
- foreign_landing_url = obj_.get("links", {}).get("self")
+ # Increment `skip` by the batch limit.
+ return {
+ **prev_query_params,
+ "date[from]": from_,
+ "date[to]": to_,
+ "page[number]": prev_query_params["page[number]"] + 1,
+ }
+
+ def get_media_type(self, record):
+ # This provider only supports Images.
+ return "image"
+
+ def get_batch_data(self, response_json):
+ if response_json:
+ return response_json.get("data")
+ return None
+
+ def get_record_data(self, record):
+ id_ = record.get("id")
+ if id_ in self.RECORD_IDS:
+ return None
+ self.RECORD_IDS.add(id_)
+ foreign_landing_url = record.get("links", {}).get("self")
if foreign_landing_url is None:
- continue
- obj_attributes = obj_.get("attributes")
- if obj_attributes is None:
- continue
- title = obj_attributes.get("summary_title")
- creator = _get_creator_info(obj_attributes)
- metadata = _get_metadata(obj_attributes)
- multimedia = obj_attributes.get("multimedia")
- if multimedia is None:
- continue
+ return None
+ attributes = record.get("attributes")
+ if attributes is None:
+ return None
+ title = attributes.get("summary_title")
+ creator = self._get_creator_info(attributes)
+
+ metadata = self._get_metadata(attributes)
+ multimedia = attributes.get("multimedia")
+ if not multimedia:
+ return None
+ images = []
for image_data in multimedia:
foreign_id = image_data.get("admin", {}).get("uid")
if foreign_id is None:
continue
processed = image_data.get("processed")
- source = image_data.get("source")
- image_url, height, width = _get_image_info(processed)
+ (
+ image_url,
+ height,
+ width,
+ filetype,
+ ) = self._get_image_info(processed)
if image_url is None:
continue
- license_version = _get_license_version(source)
- if license_version is None:
+ license_pair = self._get_license(image_data)
+ if license_pair is None:
+ # some items do not return license anywhere, but in the UI
+ # they look like CC
continue
- license_, version = license_version.lower().split(" ")
- license_ = license_.replace("cc-", "")
+ license_, version = license_pair
license_info = get_license_info(license_=license_, license_version=version)
- image_count = image_store.add_item(
- foreign_identifier=foreign_id,
- foreign_landing_url=foreign_landing_url,
- image_url=image_url,
- height=height,
- width=width,
- license_info=license_info,
- creator=creator,
- title=title,
- meta_data=metadata,
- )
- return image_count
-
-
-def _get_creator_info(obj_attr):
- creator_info = None
- life_cycle = obj_attr.get("lifecycle")
- if life_cycle:
- creation = life_cycle.get("creation")
- if type(creation) == list:
- maker = creation[0].get("maker")
- if type(maker) == list:
- creator_info = maker[0].get("summary_title")
- return creator_info
-
-
-def _get_image_info(processed):
- if processed.get("large"):
- image = processed.get("large").get("location")
- measurements = processed.get("large").get("measurements")
- elif processed.get("medium"):
- image = processed.get("medium").get("location")
- measurements = processed.get("medium").get("measurements")
- else:
- image = None
- measurements = None
- image = check_url(image)
- height, width = _get_dimensions(measurements)
- return image, height, width
-
-
-def check_url(image_url):
- base_url = "https://coimages.sciencemuseumgroup.org.uk/images/"
- if image_url:
- if "http" in image_url:
- checked_url = image_url
- else:
- checked_url = base_url + image_url
- else:
- checked_url = None
- return checked_url
-
-
-def _get_dimensions(measurements):
- height_width = {}
- if measurements:
- dimensions = measurements.get("dimensions")
+ image = {
+ "foreign_identifier": foreign_id,
+ "foreign_landing_url": foreign_landing_url,
+ "image_url": image_url,
+ "height": height,
+ "width": width,
+ "filetype": filetype,
+ "license_info": license_info,
+ "creator": creator,
+ "title": title,
+ "meta_data": metadata,
+ }
+ images.append(image)
+ return images
+
+ @staticmethod
+ def _get_creator_info(attributes):
+ creator_info = None
+ if (life_cycle := attributes.get("lifecycle")) is not None:
+ creation = life_cycle.get("creation")
+ if isinstance(creation, list):
+ maker = creation[0].get("maker")
+ if isinstance(maker, list):
+ creator_info = maker[0].get("summary_title")
+ return creator_info
+
+ @staticmethod
+ def check_url(image_url: str | None) -> str | None:
+ if not image_url:
+ return None
+ if image_url.startswith("http"):
+ return image_url
+ return f"https://coimages.sciencemuseumgroup.org.uk/images/{image_url}"
+
+ @staticmethod
+ def _get_dimensions(image_data: Dict) -> Tuple[int | None, int | None]:
+ """
+ Returns the height and width of the image from "image_data"."measurements"
+ with keys of "dimension", "units", "value".
+ """
+ size = {}
+ dimensions = image_data.get("measurements", {}).get("dimensions")
if dimensions:
for dim in dimensions:
- height_width[dim.get("dimension")] = dim.get("value")
- return height_width.get("height"), height_width.get("width")
-
-
-def _get_license_version(source):
- license_version = None
- if source:
- legal = source.get("legal")
- if legal:
- rights = legal.get("rights")
- if type(rights) == list:
- license_version = rights[0].get("usage_terms")
- return license_version
-
-
-def _get_metadata(obj_attr):
- metadata = {}
- identifier = obj_attr.get("identifier")
- if type(identifier) == list:
- metadata["accession number"] = identifier[0].get("value")
- name = obj_attr.get("name")
- if type(name) == list:
- metadata["name"] = name[0].get("value")
- category = obj_attr.get("categories")
- if type(category) == list:
- metadata["category"] = category[0].get("value")
- creditline = obj_attr.get("legal")
- if type(creditline) == dict:
- metadata["creditline"] = creditline.get("credit_line")
- description = obj_attr.get("description")
- if type(description) == list:
- metadata["description"] = description[0].get("value")
- return metadata
+ size[dim.get("dimension")] = (
+ dim.get("value") if dim.get("units") == "pixels" else None
+ )
+ return size.get("height"), size.get("width")
+
+ @staticmethod
+ def _get_image_info(
+ processed: Dict,
+ ) -> Tuple[Optional[str], Optional[int], Optional[int], Optional[str]]:
+ height, width, filetype = None, None, None
+ image_data = processed.get("large")
+ if image_data is None:
+ image_data = processed.get("medium", {})
+
+ image_url = ScienceMuseumDataIngester.check_url(image_data.get("location"))
+ if image_url:
+ filetype = image_data.get("format")
+ height, width = ScienceMuseumDataIngester._get_dimensions(image_data)
+ return image_url, height, width, filetype
+
+ @staticmethod
+ def _get_first_list_value(key: str, attributes: Dict) -> str | None:
+ val = attributes.get(key)
+ if isinstance(val, list):
+ return val[0].get("value")
+ return None
+
+ @staticmethod
+ def _get_metadata(attributes):
+ metadata = {}
+ for attr_key, metadata_key in [
+ ("identifier", "accession number"),
+ ("name", "name"),
+ ("categories", "category"),
+ ("description", "description"),
+ ]:
+ val = ScienceMuseumDataIngester._get_first_list_value(attr_key, attributes)
+ if val is not None:
+ metadata[metadata_key] = val
+
+ creditline = attributes.get("legal")
+ if isinstance(creditline, dict):
+ line = creditline.get("credit_line")
+ if line is not None:
+ metadata["creditline"] = line
+
+ return metadata
+
+ @staticmethod
+ def _get_license(image_data):
+ rights = image_data.get("source", {}).get("legal", {}).get("rights")
+ if isinstance(rights, list):
+ license_name = rights[0].get("usage_terms")
+ if not license_name:
+ return None
+ license_name = license_name.lower()
+ license_name = re.sub("^cc[ -]", "", license_name)
+ license_, version = license_name.split(" ")
+ return license_, version
+ return None
+
+
+def main():
+ logger.info("Begin: Science Museum data ingestion")
+ ingester = ScienceMuseumDataIngester()
+ ingester.ingest_records()
if __name__ == "__main__":
diff --git a/openverse_catalog/dags/providers/provider_workflows.py b/openverse_catalog/dags/providers/provider_workflows.py
index 1aaa03690..fd0740796 100644
--- a/openverse_catalog/dags/providers/provider_workflows.py
+++ b/openverse_catalog/dags/providers/provider_workflows.py
@@ -6,6 +6,7 @@ from providers.provider_api_scripts.cleveland_museum import ClevelandDataIngeste
from providers.provider_api_scripts.finnish_museums import FinnishMuseumsDataIngester
from providers.provider_api_scripts.museum_victoria import VictoriaDataIngester
from providers.provider_api_scripts.provider_data_ingester import ProviderDataIngester
+from providers.provider_api_scripts.science_museum import ScienceMuseumDataIngester
from providers.provider_api_scripts.stocksnap import StockSnapDataIngester
@@ -142,6 +143,7 @@ PROVIDER_WORKFLOWS = [
),
ProviderWorkflow(
provider_script="science_museum",
+ ingester_class=ScienceMuseumDataIngester,
start_date=datetime(2020, 1, 1),
),
ProviderWorkflow(
diff --git a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/license_source.json b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/license_source.json
index fb5b3093f..34ad6828b 100644
--- a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/license_source.json
+++ b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/license_source.json
@@ -1,10 +1,12 @@
{
- "legal": {
- "rights": [
- {
- "details": "\u00a9 The Board of Trustees of the Science Museum",
- "usage_terms": "CC-BY-NC-SA 4.0"
- }
- ]
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum",
+ "usage_terms": "CC-BY-NC-SA 4.0"
+ }
+ ]
+ }
}
}
diff --git a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/measurements.json b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/measurements.json
index 3f1646783..5a67bd8e3 100644
--- a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/measurements.json
+++ b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/measurements.json
@@ -1,14 +1,16 @@
{
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 1022
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 1536
- }
- ]
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1022
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1536
+ }
+ ]
+ }
}
diff --git a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/no_license.json b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/no_license.json
deleted file mode 100644
index 9c76a07ae..000000000
--- a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/no_license.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "legal": {
- "rights": [
- {}
- ]
- }
-}
diff --git a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/no_license_no_legal.json b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/no_license_no_legal.json
new file mode 100644
index 000000000..223a7e137
--- /dev/null
+++ b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/no_license_no_legal.json
@@ -0,0 +1,10 @@
+{
+ "source": {
+ "title": [
+ {
+ "type": "caption",
+ "value": "Glass measuring cylinder from Luke Howard's rain-gauge"
+ }
+ ]
+ }
+}
diff --git a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/no_license_no_usage_terms.json b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/no_license_no_usage_terms.json
new file mode 100644
index 000000000..9d7a46bef
--- /dev/null
+++ b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/no_license_no_usage_terms.json
@@ -0,0 +1,11 @@
+{
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum, London"
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/object_data.json b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/object_data.json
new file mode 100644
index 000000000..625eb2e20
--- /dev/null
+++ b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/object_data.json
@@ -0,0 +1,3106 @@
+{
+ "attributes": {
+ "admin": {
+ "added": 1494271883000,
+ "analytics": {
+ "count": {
+ "last": 103,
+ "total": 5135
+ }
+ },
+ "created": 826588800000,
+ "id": "object-56202",
+ "language": "eng",
+ "modified": 1649770859000,
+ "previous_status": "valid and published",
+ "processed": 1656635149087,
+ "source": "smgc",
+ "stream": "smg-online",
+ "uid": "co56202",
+ "uuid": "4729926e-eeae-3576-b719-12e53ceb0e97",
+ "version": 108
+ },
+ "categories": [
+ {
+ "museum": "SCM",
+ "name": "Astronomy",
+ "value": "SCM - Astronomy"
+ }
+ ],
+ "dates": {
+ "DATE1": "2003"
+ },
+ "description": [
+ {
+ "primary": true,
+ "value": "Facsimile of telescope by Galileo with main tube measuring 2-foot, 8 1/2-inches and magnification of 21 times. Made by Cipriani and purchased from the Museo di Fisica e Storia Naturale, Florence, Italy in 1923."
+ },
+ {
+ "type": "web description",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after he learnt of the invention of the telescope in 1608. The refracting telescope magnifies only 21 times yet gives a very restricted field of view. As a result Galileo was only able to view about a third of the Moon through his telescopes. Despite these limitations, Galileo published, 'Sidereus Nuncius' in 1610, which describes the new celestial sights he saw with his new telescope. These included craters on the Moon, the phases of Venus and the moons of Jupiter. This facsimile was made in 1923 at the Museo di Fisica e Storia Naturale, in Florence, Italy where the original still resides."
+ }
+ ],
+ "identifier": [
+ {
+ "primary": true,
+ "type": "accession number",
+ "value": "1923-668"
+ }
+ ],
+ "language": [
+ "eng"
+ ],
+ "legal": {
+ "legal_status": "permanent collection"
+ },
+ "lifecycle": {
+ "creation": [
+ {
+ "date": [
+ {
+ "earliest": 1610,
+ "latest": 1610,
+ "primary": true,
+ "value": "1610; 1923"
+ }
+ ],
+ "maker": [
+ {
+ "@link": {
+ "role": [
+ {
+ "value": "designer"
+ }
+ ],
+ "type": "reference"
+ },
+ "admin": {
+ "id": "agent-37297",
+ "uid": "cp37297",
+ "uuid": "3a4bc387-e933-358f-8c86-8e1eaa2168b0"
+ },
+ "summary_title": "Galileo Galilei"
+ },
+ {
+ "@link": {
+ "role": [
+ {
+ "value": "maker (original)"
+ }
+ ],
+ "type": "reference"
+ },
+ "admin": {
+ "id": "agent-37297",
+ "uid": "cp37297",
+ "uuid": "3a4bc387-e933-358f-8c86-8e1eaa2168b0"
+ },
+ "summary_title": "Galileo Galilei"
+ }
+ ],
+ "places": [
+ {
+ "@link": {
+ "role": [
+ {
+ "value": "made (original & replica)"
+ }
+ ],
+ "type": "reference"
+ },
+ "admin": {
+ "id": "place-381",
+ "uid": "cd381",
+ "uuid": "e22589d5-cafb-378f-8ddf-9214a3a2300c"
+ },
+ "sort": 1,
+ "summary_title": "Florence"
+ }
+ ]
+ }
+ ]
+ },
+ "materials": [
+ "card",
+ "complete",
+ "glass",
+ "leather"
+ ],
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "diameter",
+ "units": "in",
+ "value": "2 3/8"
+ },
+ {
+ "dimension": "diameter",
+ "units": "mm",
+ "value": "60"
+ },
+ {
+ "dimension": "width",
+ "units": "in",
+ "value": "38 3/16"
+ },
+ {
+ "dimension": "width",
+ "units": "mm",
+ "value": "970"
+ },
+ {
+ "units": "kg",
+ "value": "0.345"
+ },
+ {
+ "units": "lbs",
+ "value": "0.7606"
+ }
+ ],
+ "display": "overall: 970 mm 60 mm, .345kg"
+ },
+ "multimedia": [
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-4453",
+ "source": "smgi",
+ "uid": "i4453",
+ "uuid": "ca31c40e-65a9-3f44-88b2-347d496e0292"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "labels": [
+ {
+ "details": {
+ "confidence": 77.732155
+ },
+ "value": "Weapon"
+ },
+ {
+ "details": {
+ "confidence": 77.732155
+ },
+ "value": "Weaponry"
+ }
+ ],
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "4453"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "4/453/large_1923_0668__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1151
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1536
+ }
+ ]
+ },
+ "modified": 1472028891000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "https://coimages.sciencemuseumgroup.org.uk/images/4/452/large_thumbnail_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 240
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 320
+ }
+ ]
+ },
+ "modified": 1472028891000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "4/453/medium_1923_0668__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 576
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 768
+ }
+ ]
+ },
+ "modified": 1472028891000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "4/453/medium_thumbnail_1923_0668__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 144
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 192
+ }
+ ]
+ },
+ "modified": 1472028891000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "4/453/small_thumbnail_1923_0668__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 48
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 64
+ }
+ ]
+ },
+ "modified": 1472028891000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "4/453/1923_0668__0002_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 4000
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 5336
+ }
+ ]
+ },
+ "modified": 1472028891000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2015-06-06 05:40:37.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Facsimile of telescope by Galileo with main tube measuring"
+ },
+ {
+ "type": "main title",
+ "value": "Facsimile of telescope by Galileo with main tube measuring 2-foot, 8 1/2-inches and magnification of 21 times. Detail"
+ }
+ ]
+ },
+ "traffic_light": "Green",
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-29406",
+ "source": "smgi",
+ "uid": "i29406",
+ "uuid": "f6f674fb-3eb3-386f-87f1-06931ccb2d95"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "labels": [
+ {
+ "details": {
+ "confidence": 96.3729,
+ "instances": [
+ {
+ "confidence": "83.33213",
+ "region": {
+ "height": 0.83952594,
+ "left": 0.217989,
+ "top": 0.05400679,
+ "type": "bounding box",
+ "width": 0.7341616
+ }
+ }
+ ]
+ },
+ "value": "Person"
+ },
+ {
+ "details": {
+ "confidence": 96.3729,
+ "parents": [
+ {
+ "value": "Person"
+ },
+ {
+ "value": "People"
+ }
+ ]
+ },
+ "value": "Team"
+ },
+ {
+ "details": {
+ "confidence": 96.3729,
+ "parents": [
+ {
+ "value": "Person"
+ }
+ ]
+ },
+ "value": "Sports"
+ },
+ {
+ "details": {
+ "confidence": 96.3729
+ },
+ "value": "Human"
+ },
+ {
+ "details": {
+ "confidence": 96.3729,
+ "parents": [
+ {
+ "value": "Person"
+ },
+ {
+ "value": "Team"
+ },
+ {
+ "value": "Sport"
+ },
+ {
+ "value": "People"
+ }
+ ]
+ },
+ "value": "Team Sport"
+ },
+ {
+ "details": {
+ "confidence": 96.3729,
+ "instances": [
+ {
+ "confidence": "96.3729",
+ "region": {
+ "height": 0.6712718,
+ "left": 0.04924745,
+ "top": 0.26445633,
+ "type": "bounding box",
+ "width": 0.81754345
+ }
+ }
+ ],
+ "parents": [
+ {
+ "value": "Person"
+ },
+ {
+ "value": "Baseball"
+ },
+ {
+ "value": "Team"
+ },
+ {
+ "value": "Team Sport"
+ },
+ {
+ "value": "Sport"
+ },
+ {
+ "value": "People"
+ }
+ ]
+ },
+ "value": "Baseball Bat"
+ },
+ {
+ "details": {
+ "confidence": 96.3729,
+ "parents": [
+ {
+ "value": "Person"
+ }
+ ]
+ },
+ "value": "Sport"
+ },
+ {
+ "details": {
+ "confidence": 96.3729,
+ "parents": [
+ {
+ "value": "Person"
+ }
+ ]
+ },
+ "value": "People"
+ },
+ {
+ "details": {
+ "confidence": 96.3729,
+ "parents": [
+ {
+ "value": "Team Sport"
+ },
+ {
+ "value": "Team"
+ },
+ {
+ "value": "Person"
+ },
+ {
+ "value": "Sport"
+ },
+ {
+ "value": "People"
+ }
+ ]
+ },
+ "value": "Baseball"
+ },
+ {
+ "details": {
+ "confidence": 96.3729,
+ "parents": [
+ {
+ "value": "Team Sport"
+ },
+ {
+ "value": "Team"
+ },
+ {
+ "value": "Person"
+ },
+ {
+ "value": "Sport"
+ },
+ {
+ "value": "People"
+ }
+ ]
+ },
+ "value": "Softball"
+ }
+ ],
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "29406"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "29/406/large_1931_0797__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1536
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1151
+ }
+ ]
+ },
+ "modified": 1472029772000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "29/406/large_thumbnail_1931_0797__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 427
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 320
+ }
+ ]
+ },
+ "modified": 1472029772000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "29/406/medium_1931_0797__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 769
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 576
+ }
+ ]
+ },
+ "modified": 1472029772000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "29/406/medium_thumbnail_1931_0797__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 256
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 192
+ }
+ ]
+ },
+ "modified": 1472029772000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "29/406/small_thumbnail_1931_0797__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 64
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 48
+ }
+ ]
+ },
+ "modified": 1472029772000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "29/406/1931_0797__0002_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 4854
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 3636
+ }
+ ]
+ },
+ "modified": 1472029772000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2015-06-09 11:13:13.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Painting. [Galileo Galilei] / by A. Susan Zileri (fl"
+ },
+ {
+ "type": "main title",
+ "value": "Painting. [Galileo Galilei] / by A. Susan Zileri (fl. 1884-1934), 1884. Oil on canvas; 61.5x51cm in curly wood and gilt"
+ }
+ ]
+ },
+ "traffic_light": "Green",
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-70617",
+ "source": "smgi",
+ "uid": "i70617",
+ "uuid": "dc2b6823-07b3-3f3d-ad5f-7381e1df831e"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "labels": [
+ {
+ "details": {
+ "confidence": 97.66413,
+ "instances": [
+ {
+ "confidence": "97.66413",
+ "region": {
+ "height": 0.7730075,
+ "left": 0.04662897,
+ "top": 0.1517991,
+ "type": "bounding box",
+ "width": 0.80697453
+ }
+ }
+ ],
+ "parents": [
+ {
+ "value": "Tool"
+ }
+ ]
+ },
+ "value": "Hammer"
+ },
+ {
+ "details": {
+ "confidence": 97.66413
+ },
+ "value": "Tool"
+ }
+ ],
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "70617"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "70/617/large_1924_0209__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1073
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1536
+ }
+ ]
+ },
+ "modified": 1472028752000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "70/617/large_thumbnail_1924_0209__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 240
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 343
+ }
+ ]
+ },
+ "modified": 1472028752000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "70/617/medium_1924_0209__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 576
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 824
+ }
+ ]
+ },
+ "modified": 1472028752000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "70/617/medium_thumbnail_1924_0209__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 144
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 206
+ }
+ ]
+ },
+ "modified": 1472028752000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "70/617/small_thumbnail_1924_0209__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 48
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 69
+ }
+ ]
+ },
+ "modified": 1472028752000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "70/617/1924_0209__0004_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 3508
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 5020
+ }
+ ]
+ },
+ "modified": 1472028752000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2015-06-11 23:57:26.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "(Left) Facsimile of telescope by Galileo with main tube"
+ },
+ {
+ "type": "main title",
+ "value": "(Left) Facsimile of telescope by Galileo with main tube measuring 2-foot, 8 1/2-inches and magnification of 21 times."
+ }
+ ]
+ },
+ "traffic_light": "Green",
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-272868",
+ "source": "smgi",
+ "uid": "i272868",
+ "uuid": "1bf5b959-f7ba-3c73-be80-b86261bbaeee"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "labels": [
+ {
+ "details": {
+ "confidence": 89.21109,
+ "parents": [
+ {
+ "value": "Symbol"
+ }
+ ]
+ },
+ "value": "Arrow"
+ },
+ {
+ "details": {
+ "confidence": 89.21109
+ },
+ "value": "Symbol"
+ },
+ {
+ "details": {
+ "confidence": 80.42816
+ },
+ "value": "Leisure Activities"
+ },
+ {
+ "details": {
+ "confidence": 80.06794
+ },
+ "value": "Tool"
+ },
+ {
+ "details": {
+ "confidence": 80.06794,
+ "instances": [
+ {
+ "confidence": "80.06794",
+ "region": {
+ "height": 0.7146384,
+ "left": 0.04211183,
+ "top": 0.16666844,
+ "type": "bounding box",
+ "width": 0.92374575
+ }
+ }
+ ],
+ "parents": [
+ {
+ "value": "Tool"
+ }
+ ]
+ },
+ "value": "Hammer"
+ }
+ ],
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "272868"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "272/868/large_1923_0668__0003_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1257
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1536
+ }
+ ]
+ },
+ "modified": 1496851109000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "272/868/large_thumbnail_1923_0668__0003_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 262
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 320
+ }
+ ]
+ },
+ "modified": 1496851109000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "272/868/medium_1923_0668__0003_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 576
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 704
+ }
+ ]
+ },
+ "modified": 1496851109000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "272/868/medium_thumbnail_1923_0668__0003_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 157
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 192
+ }
+ ]
+ },
+ "modified": 1496851109000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "272/868/small_thumbnail_1923_0668__0003_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 48
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 59
+ }
+ ]
+ },
+ "modified": 1496851109000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "272/868/1923_0668__0003_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 3806
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 4650
+ }
+ ]
+ },
+ "modified": 1496851109000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2017-06-07 16:58:21.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum, London",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Facsimile of telescope by Galileo with main tube measuring"
+ },
+ {
+ "type": "main title",
+ "value": "Facsimile of telescope by Galileo with main tube measuring 2-foot, 8 1/2-inches and magnification of 21 times. Made"
+ }
+ ]
+ },
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-272869",
+ "source": "smgi",
+ "uid": "i272869",
+ "uuid": "f3c8263f-e896-3e06-963d-95e4a49977c5"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "labels": [
+ {
+ "details": {
+ "confidence": 97.417496,
+ "instances": [
+ {
+ "confidence": "97.417496",
+ "region": {
+ "height": 0.83902305,
+ "left": 0.07827001,
+ "top": 0.06480961,
+ "type": "bounding box",
+ "width": 0.8931307
+ }
+ }
+ ]
+ },
+ "value": "Smoke Pipe"
+ },
+ {
+ "details": {
+ "confidence": 86.97954
+ },
+ "value": "Leisure Activities"
+ }
+ ],
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "272869"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "272/869/large_1923_0668__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1255
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1536
+ }
+ ]
+ },
+ "modified": 1496851122000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "272/869/large_thumbnail_1923_0668__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 261
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 320
+ }
+ ]
+ },
+ "modified": 1496851122000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "272/869/medium_1923_0668__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 576
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 705
+ }
+ ]
+ },
+ "modified": 1496851122000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "272/869/medium_thumbnail_1923_0668__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 157
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 192
+ }
+ ]
+ },
+ "modified": 1496851122000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "272/869/small_thumbnail_1923_0668__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 48
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 59
+ }
+ ]
+ },
+ "modified": 1496851122000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "272/869/1923_0668__0004_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 3784
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 4632
+ }
+ ]
+ },
+ "modified": 1496851122000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2017-06-07 16:58:34.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum, London",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Facsimile of telescope by Galileo with main tube measuring"
+ },
+ {
+ "type": "main title",
+ "value": "Facsimile of telescope by Galileo with main tube measuring 2-foot, 8 1/2-inches and magnification of 21 times. Made"
+ }
+ ]
+ },
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-272918",
+ "source": "smgi",
+ "uid": "i272918",
+ "uuid": "0b98cd45-d760-3988-8c6b-edbb269d8352"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "labels": [
+ {
+ "details": {
+ "confidence": 93.350716
+ },
+ "value": "Human"
+ },
+ {
+ "details": {
+ "confidence": 93.350716,
+ "instances": [
+ {
+ "confidence": "93.350716",
+ "region": {
+ "height": 0.8814689,
+ "left": 0.13251683,
+ "top": 0.038410023,
+ "type": "bounding box",
+ "width": 0.8445756
+ }
+ }
+ ]
+ },
+ "value": "Person"
+ },
+ {
+ "details": {
+ "confidence": 78.483116
+ },
+ "value": "Art"
+ },
+ {
+ "details": {
+ "confidence": 75.07677,
+ "parents": [
+ {
+ "value": "People"
+ },
+ {
+ "value": "Person"
+ }
+ ]
+ },
+ "value": "Team"
+ },
+ {
+ "details": {
+ "confidence": 75.07677,
+ "parents": [
+ {
+ "value": "Person"
+ }
+ ]
+ },
+ "value": "People"
+ },
+ {
+ "details": {
+ "confidence": 75.07677,
+ "instances": [
+ {
+ "confidence": "75.07677",
+ "region": {
+ "height": 0.6637023,
+ "left": 0.035249896,
+ "top": 0.27812898,
+ "type": "bounding box",
+ "width": 0.84739864
+ }
+ }
+ ],
+ "parents": [
+ {
+ "value": "People"
+ },
+ {
+ "value": "Sport"
+ },
+ {
+ "value": "Team"
+ },
+ {
+ "value": "Team Sport"
+ },
+ {
+ "value": "Person"
+ },
+ {
+ "value": "Baseball"
+ }
+ ]
+ },
+ "value": "Baseball Bat"
+ },
+ {
+ "details": {
+ "confidence": 75.07677,
+ "parents": [
+ {
+ "value": "Team"
+ },
+ {
+ "value": "Team Sport"
+ },
+ {
+ "value": "Person"
+ },
+ {
+ "value": "Sport"
+ },
+ {
+ "value": "People"
+ }
+ ]
+ },
+ "value": "Baseball"
+ },
+ {
+ "details": {
+ "confidence": 75.07677,
+ "parents": [
+ {
+ "value": "Team"
+ },
+ {
+ "value": "People"
+ },
+ {
+ "value": "Person"
+ },
+ {
+ "value": "Sport"
+ }
+ ]
+ },
+ "value": "Team Sport"
+ },
+ {
+ "details": {
+ "confidence": 75.07677,
+ "parents": [
+ {
+ "value": "Person"
+ }
+ ]
+ },
+ "value": "Sport"
+ },
+ {
+ "details": {
+ "confidence": 75.07677,
+ "parents": [
+ {
+ "value": "Person"
+ }
+ ]
+ },
+ "value": "Sports"
+ }
+ ],
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "272918"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "272/918/large_B700707.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1536
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1177
+ }
+ ]
+ },
+ "modified": 1496851737000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "272/918/large_thumbnail_B700707.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 418
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 320
+ }
+ ]
+ },
+ "modified": 1496851737000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "272/918/medium_B700707.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 752
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 576
+ }
+ ]
+ },
+ "modified": 1496851737000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "272/918/medium_thumbnail_B700707.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 251
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 192
+ }
+ ]
+ },
+ "modified": 1496851737000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "272/918/small_thumbnail_B700707.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 63
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 48
+ }
+ ]
+ },
+ "modified": 1496851737000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "272/918/B700707.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 4800
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 3678
+ }
+ ]
+ },
+ "modified": 1496851737000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2017-06-07 17:08:49.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum, London",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Painting. [Galileo Galilei] / by A. Susan Zileri (fl"
+ },
+ {
+ "type": "main title",
+ "value": "Painting. [Galileo Galilei] / by A. Susan Zileri (fl. 1884-1934), 1884. Oil on canvas; 61.5x51cm in curly wood and gilt"
+ }
+ ]
+ },
+ "traffic_light": "Green",
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-4452",
+ "source": "smgi",
+ "uid": "i4452",
+ "uuid": "424d0042-01dd-3d27-8416-f65179c26640"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "labels": [
+ {
+ "details": {
+ "confidence": 86.64699,
+ "parents": [
+ {
+ "value": "Symbol"
+ }
+ ]
+ },
+ "value": "Arrow"
+ },
+ {
+ "details": {
+ "confidence": 86.64699
+ },
+ "value": "Symbol"
+ },
+ {
+ "details": {
+ "confidence": 84.71997
+ },
+ "value": "Weaponry"
+ },
+ {
+ "details": {
+ "confidence": 84.71997
+ },
+ "value": "Weapon"
+ }
+ ],
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "4452"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "4/452/large_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1151
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1536
+ }
+ ]
+ },
+ "modified": 1472028927000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "4/452/large_thumbnail_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 240
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 320
+ }
+ ]
+ },
+ "modified": 1472028927000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "4/452/medium_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 576
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 768
+ }
+ ]
+ },
+ "modified": 1472028927000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "4/452/medium_thumbnail_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 144
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 192
+ }
+ ]
+ },
+ "modified": 1472028927000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "4/452/small_thumbnail_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 48
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 64
+ }
+ ]
+ },
+ "modified": 1472028927000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "4/452/1923_0668__0001_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 4000
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 5336
+ }
+ ]
+ },
+ "modified": 1472028927000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2015-06-06 05:40:20.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Facsimile of telescope by Galileo with main tube measuring"
+ },
+ {
+ "type": "main title",
+ "value": "Facsimile of telescope by Galileo with main tube measuring 2-foot, 8 1/2-inches and magnification of 21 times. Full"
+ }
+ ]
+ },
+ "traffic_light": "Green",
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-294444",
+ "source": "smgi",
+ "uid": "i294444",
+ "uuid": "e80138a8-6510-3792-9d39-6ee67f0a898e"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "labels": [
+ {
+ "details": {
+ "confidence": 84.457695
+ },
+ "value": "Sports"
+ },
+ {
+ "details": {
+ "confidence": 84.457695,
+ "parents": [
+ {
+ "value": "Team"
+ },
+ {
+ "value": "Sport"
+ }
+ ]
+ },
+ "value": "Team Sport"
+ },
+ {
+ "details": {
+ "confidence": 84.457695,
+ "parents": [
+ {
+ "value": "Team"
+ },
+ {
+ "value": "Sport"
+ },
+ {
+ "value": "Team Sport"
+ }
+ ]
+ },
+ "value": "Baseball"
+ },
+ {
+ "details": {
+ "confidence": 84.457695,
+ "parents": [
+ {
+ "value": "Team"
+ },
+ {
+ "value": "Sport"
+ },
+ {
+ "value": "Team Sport"
+ }
+ ]
+ },
+ "value": "Softball"
+ },
+ {
+ "details": {
+ "confidence": 84.457695
+ },
+ "value": "Team"
+ },
+ {
+ "details": {
+ "confidence": 84.457695
+ },
+ "value": "Sport"
+ },
+ {
+ "details": {
+ "confidence": 84.457695,
+ "instances": [
+ {
+ "confidence": "84.457695",
+ "region": {
+ "height": 0.7185915,
+ "left": 0.048474047,
+ "top": 0.19960986,
+ "type": "bounding box",
+ "width": 0.8919881
+ }
+ }
+ ],
+ "parents": [
+ {
+ "value": "Team Sport"
+ },
+ {
+ "value": "Baseball"
+ },
+ {
+ "value": "Team"
+ },
+ {
+ "value": "Sport"
+ }
+ ]
+ },
+ "value": "Baseball Bat"
+ }
+ ],
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "294444"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "294/444/large_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1536
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1322
+ }
+ ]
+ },
+ "modified": 1525953866000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "294/444/large_thumbnail_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 372
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 320
+ }
+ ]
+ },
+ "modified": 1525953866000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "294/444/medium_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 669
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 576
+ }
+ ]
+ },
+ "modified": 1525953866000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "294/444/medium_thumbnail_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 223
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 192
+ }
+ ]
+ },
+ "modified": 1525953866000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "294/444/small_thumbnail_1923_0668__0001_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 56
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 48
+ }
+ ]
+ },
+ "modified": 1525953866000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "294/444/1923_0668__0001_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 5631
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 4848
+ }
+ ]
+ },
+ "modified": 1525953866000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2018-05-10 13:04:20.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum, London",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after"
+ },
+ {
+ "type": "main title",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after he learnt of the invention of the telescope in 1608."
+ }
+ ]
+ },
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-294445",
+ "source": "smgi",
+ "uid": "i294445",
+ "uuid": "7f288b5d-6687-3881-8d13-9725d693c7f9"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "labels": [
+ {
+ "details": {
+ "confidence": 96.40169
+ },
+ "value": "Weapon"
+ },
+ {
+ "details": {
+ "confidence": 96.40169
+ },
+ "value": "Weaponry"
+ }
+ ],
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "294445"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "294/445/large_1923_0668__0003_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1536
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1087
+ }
+ ]
+ },
+ "modified": 1525953880000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "294/445/large_thumbnail_1923_0668__0003_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 452
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 320
+ }
+ ]
+ },
+ "modified": 1525953880000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "294/445/medium_1923_0668__0003_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 814
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 576
+ }
+ ]
+ },
+ "modified": 1525953880000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "294/445/medium_thumbnail_1923_0668__0003_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 271
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 192
+ }
+ ]
+ },
+ "modified": 1525953880000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "294/445/small_thumbnail_1923_0668__0003_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 68
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 48
+ }
+ ]
+ },
+ "modified": 1525953880000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "294/445/1923_0668__0003_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 6182
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 4374
+ }
+ ]
+ },
+ "modified": 1525953880000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2018-05-10 13:04:32.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum, London",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after"
+ },
+ {
+ "type": "main title",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after he learnt of the invention of the telescope in 1608."
+ }
+ ]
+ },
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-294446",
+ "source": "smgi",
+ "uid": "i294446",
+ "uuid": "a7a99a43-402e-3db2-a2a5-924e1d21237e"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "labels": [
+ {
+ "details": {
+ "confidence": 99.78297
+ },
+ "value": "Bronze"
+ }
+ ],
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "294446"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "294/446/large_1923_0668__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1143
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1536
+ }
+ ]
+ },
+ "modified": 1525953895000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "294/446/large_thumbnail_1923_0668__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 240
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 323
+ }
+ ]
+ },
+ "modified": 1525953895000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "294/446/medium_1923_0668__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 576
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 774
+ }
+ ]
+ },
+ "modified": 1525953895000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "294/446/medium_thumbnail_1923_0668__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 144
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 194
+ }
+ ]
+ },
+ "modified": 1525953895000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "294/446/small_thumbnail_1923_0668__0002_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 48
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 65
+ }
+ ]
+ },
+ "modified": 1525953895000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "294/446/1923_0668__0002_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 4902
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 6590
+ }
+ ]
+ },
+ "modified": 1525953895000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2018-05-10 13:04:45.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum, London",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after"
+ },
+ {
+ "type": "main title",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after he learnt of the invention of the telescope in 1608."
+ }
+ ]
+ },
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-294447",
+ "source": "smgi",
+ "uid": "i294447",
+ "uuid": "e14a4b88-65f9-36c7-a88e-28137c89e555"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "report": "no enhancements available",
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "294447"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "294/447/large_1923_0668__0005_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1144
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1536
+ }
+ ]
+ },
+ "modified": 1525953913000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "294/447/large_thumbnail_1923_0668__0005_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 240
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 322
+ }
+ ]
+ },
+ "modified": 1525953913000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "294/447/medium_1923_0668__0005_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 576
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 773
+ }
+ ]
+ },
+ "modified": 1525953913000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "294/447/medium_thumbnail_1923_0668__0005_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 144
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 193
+ }
+ ]
+ },
+ "modified": 1525953913000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "294/447/small_thumbnail_1923_0668__0005_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 48
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 64
+ }
+ ]
+ },
+ "modified": 1525953913000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "294/447/1923_0668__0005_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 5225
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 7015
+ }
+ ]
+ },
+ "modified": 1525953913000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2018-05-10 13:05:01.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum, London",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after"
+ },
+ {
+ "type": "main title",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after he learnt of the invention of the telescope in 1608."
+ }
+ ]
+ },
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ },
+ {
+ "@link": {
+ "type": "reference"
+ },
+ "admin": {
+ "id": "media-294448",
+ "source": "smgi",
+ "uid": "i294448",
+ "uuid": "c8626953-8de2-3fc7-b09d-1b1c9158f562"
+ },
+ "credit": "Science Museum Group Collection",
+ "enhancement": {
+ "rekognition": [
+ {
+ "report": "no enhancements available",
+ "source": "amazon rekognition"
+ }
+ ]
+ },
+ "for_sale": "0",
+ "identifier": [
+ {
+ "type": "iBase id",
+ "value": "294448"
+ }
+ ],
+ "priority": "0.5",
+ "processed": {
+ "large": {
+ "format": "jpeg",
+ "location": "294/448/large_1923_0668__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 1150
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 1536
+ }
+ ]
+ },
+ "modified": 1525953936000,
+ "resizable": true,
+ "type": "image"
+ },
+ "large_thumbnail": {
+ "format": "jpeg",
+ "location": "294/448/large_thumbnail_1923_0668__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 240
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 321
+ }
+ ]
+ },
+ "modified": 1525953936000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium": {
+ "format": "jpeg",
+ "location": "294/448/medium_1923_0668__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 576
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 769
+ }
+ ]
+ },
+ "modified": 1525953936000,
+ "resizable": true,
+ "type": "image"
+ },
+ "medium_thumbnail": {
+ "format": "jpeg",
+ "location": "294/448/medium_thumbnail_1923_0668__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 144
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 192
+ }
+ ]
+ },
+ "modified": 1525953936000,
+ "resizable": true,
+ "type": "image"
+ },
+ "small_thumbnail": {
+ "format": "jpeg",
+ "location": "294/448/small_thumbnail_1923_0668__0004_.jpg",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 48
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 64
+ }
+ ]
+ },
+ "modified": 1525953936000,
+ "resizable": true,
+ "type": "image"
+ },
+ "zoom": {
+ "format": "pyramid tiff",
+ "location": "294/448/1923_0668__0004_.ptif",
+ "location_is_relative": true,
+ "measurements": {
+ "dimensions": [
+ {
+ "dimension": "height",
+ "units": "pixels",
+ "value": 5474
+ },
+ {
+ "dimension": "width",
+ "units": "pixels",
+ "value": 7312
+ }
+ ]
+ },
+ "modified": 1525953936000,
+ "resizable": true,
+ "type": "image"
+ }
+ },
+ "public_view": "1",
+ "publish": "1",
+ "sort": "2018-05-10 13:05:20.0",
+ "source": {
+ "legal": {
+ "rights": [
+ {
+ "details": "\u00a9 The Board of Trustees of the Science Museum, London",
+ "usage_terms": "CC BY-SA 4.0"
+ }
+ ]
+ },
+ "title": [
+ {
+ "type": "caption",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after"
+ },
+ {
+ "type": "main title",
+ "value": "Replica of one of the telescopes made by Galileo Galilei after he learnt of the invention of the telescope in 1608."
+ }
+ ]
+ },
+ "type": {
+ "base": "media",
+ "type": "image"
+ }
+ }
+ ],
+ "name": [
+ {
+ "type": "name",
+ "value": "telescope - refracting"
+ }
+ ],
+ "note": [
+ {
+ "primary": true,
+ "value": "C&C - DW&S"
+ }
+ ],
+ "numbers": {
+ "NUMBER1": "62",
+ "NUMBER2": "20100224"
+ },
+ "summary_title": "Telescope by Galileo (replica) (telescope - Galilean; telescope - refracting; replica)",
+ "title": [
+ {
+ "primary": true,
+ "type": "Cosmos Culture_TITLE",
+ "value": "Telescope by Galileo (replica)"
+ }
+ ]
+ },
+ "id": "co56202",
+ "links": {
+ "self": "https://collection.sciencemuseumgroup.org.uk/objects/co56202/telescope-by-galileo-replica-telescope-galilean-telescope-refracting-replica"
+ },
+ "relationships": {
+ "people": {
+ "data": [
+ {
+ "id": "cp37297",
+ "type": "people"
+ }
+ ]
+ },
+ "terms": {
+ "data": [
+ {
+ "id": "ct54534",
+ "type": "terms"
+ },
+ {
+ "id": "ct262081",
+ "type": "terms"
+ },
+ {
+ "id": "ct262401",
+ "type": "terms"
+ },
+ {
+ "id": "ct265959",
+ "type": "terms"
+ },
+ {
+ "id": "ct262388",
+ "type": "terms"
+ }
+ ]
+ }
+ },
+ "type": "objects"
+}
diff --git a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/objects_data.json b/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/objects_data.json
deleted file mode 100644
index fcac3a8c2..000000000
--- a/tests/dags/providers/provider_api_scripts/resources/sciencemuseum/objects_data.json
+++ /dev/null
@@ -1,713 +0,0 @@
-[
- {
- "attributes": {
- "admin": {
- "added": 1495050770000,
- "analytics": {
- "count": {
- "last": 535,
- "total": 2832
- }
- },
- "created": 1227519646000,
- "id": "object-8102855",
- "language": "eng",
- "modified": 1573567086000,
- "previous_status": "valid and published",
- "processed": 1590012454638,
- "source": "smgc",
- "stream": "smg-online",
- "uid": "co8102855",
- "uuid": "3eca0f77-363c-3cc5-8774-5d9f47b89fd1",
- "version": 59
- },
- "categories": [
- {
- "museum": "SCM",
- "name": "Smoking",
- "value": "SCM - Smoking"
- }
- ],
- "dates": {
- "DATE1": "2010-03-31"
- },
- "description": [
- {
- "date": [
- {
- "earliest": 2018,
- "latest": 2018,
- "primary": true,
- "value": "2018-06-15"
- }
- ],
- "primary": true,
- "type": "description",
- "value": "Packet of 10 'Gold Flake' cigarettes by W D & HO Wills, England, 1920-1950"
- },
- {
- "type": "web description",
- "value": "W D & H O Willis were one of a large number of cigarette and tobacco manufacturers based in England. This is a packet for ten 'Gold Flake' cigarettes, which were popular during the First World War with British soldiers in the trenches. Today, these cigarettes are only available in India."
- }
- ],
- "identifier": [
- {
- "primary": true,
- "type": "accession number",
- "value": "1999-299/1"
- }
- ],
- "inscription": [
- {
- "details": [
- {
- "transcription": "\"GOLD FLAKE\"/CIGARETTES/ W D & H O WILLIS"
- }
- ],
- "location": "front",
- "method": "printed",
- "type": "inscription"
- },
- {
- "details": [
- {
- "transcription": "\"GOLD FLAKE\"/HONEY DEW/ W D & HO WILLIS/BRISTOL & LONDON"
- }
- ],
- "location": "front",
- "method": "printed",
- "type": "inscription"
- },
- {
- "details": [
- {
- "transcription": "17 PRIZE MEDALS/Every genuine/\"Gold"
- }
- ],
- "type": "inscription"
- }
- ],
- "language": [
- "eng"
- ],
- "legal": {
- "credit_line": "McPhail, Mary",
- "legal_status": "permanent collection"
- },
- "lifecycle": {
- "creation": [
- {
- "date": [
- {
- "earliest": 1920,
- "latest": 1950,
- "primary": true,
- "value": "1920-1950"
- }
- ],
- "maker": [
- {
- "@link": {
- "role": [
- {
- "value": "maker"
- }
- ],
- "type": "reference"
- },
- "admin": {
- "id": "agent-34354",
- "uid": "cp34354",
- "uuid": "20bb6a7c-865d-378d-8811-35a10e96cb31"
- },
- "summary_title": "W D and H O Wills Limited"
- }
- ],
- "places": [
- {
- "@link": {
- "role": [
- {
- "value": "made"
- }
- ],
- "type": "reference"
- },
- "admin": {
- "id": "place-139",
- "uid": "cd139",
- "uuid": "9660ec71-ab89-3a8d-a4fa-31b90d197dc0"
- },
- "summary_title": "England"
- }
- ]
- }
- ]
- },
- "locations": [
- {
- "@link": {
- "type": "literal"
- },
- "admin": {
- "id": "location-2239646",
- "uuid": "56974fcc-9fc6-357b-8a5c-a60506065952"
- },
- "facilities": [
- {
- "@link": {
- "type": "reference"
- },
- "admin": {
- "id": "facility-62029",
- "uid": "cf62029",
- "uuid": "c805d997-7510-3365-80fd-1329304c7aca"
- },
- "summary_title": "Science Museum, Medicine: The Wellcome Galleries"
- }
- ],
- "level1": "S",
- "level2": "G29",
- "level3": "G2.2",
- "level4": "G2WN2",
- "name": [
- {
- "primary": true,
- "value": "Science Museum, Medicine: The Wellcome Galleries"
- },
- {
- "type": "gallery",
- "value": "Medicine: The Wellcome Galleries"
- },
- {
- "type": "museum",
- "value": "Science Museum"
- }
- ],
- "purpose": "on display",
- "summary_title": "Science Museum, Medicine: The Wellcome Galleries",
- "value": "Science Museum, Medicine: The Wellcome Galleries"
- }
- ],
- "measurements": {
- "dimensions": [
- {
- "dimension": "depth",
- "units": "in",
- "value": "1 9/16"
- },
- {
- "dimension": "depth",
- "units": "mm",
- "value": "40"
- },
- {
- "dimension": "height",
- "units": "in",
- "value": "13/16"
- },
- {
- "dimension": "height",
- "units": "mm",
- "value": "20"
- },
- {
- "dimension": "width",
- "units": "in",
- "value": "3 1/4"
- },
- {
- "dimension": "width",
- "units": "mm",
- "value": "82"
- }
- ],
- "display": "overall: 20 mm x 82 mm x 40 mm,"
- },
- "multimedia": [
- {
- "@link": {
- "type": "reference"
- },
- "admin": {
- "id": "media-3562",
- "source": "smgi",
- "uid": "i3562",
- "uuid": "cdce893d-6d92-30b4-b130-087b8401ff8f"
- },
- "credit": "Science Museum Group Collection",
- "enhancement": {
- "rekognition": [
- {
- "labels": [
- {
- "details": {
- "confidence": 98.589714
- },
- "value": "Text"
- },
- {
- "details": {
- "confidence": 86.31364,
- "instances": [
- {
- "confidence": "86.31364",
- "region": {
- "height": 0.90775996,
- "left": 0.042312764,
- "top": 0.04608006,
- "type": "bounding box",
- "width": 0.8924173
- }
- }
- ]
- },
- "value": "Box"
- },
- {
- "details": {
- "confidence": 85.58592
- },
- "value": "Paper"
- }
- ],
- "source": "amazon rekognition"
- }
- ]
- },
- "for_sale": "0",
- "identifier": [
- {
- "type": "iBase id",
- "value": "3562"
- }
- ],
- "priority": "0.5",
- "processed": {
- "large": {
- "format": "jpeg",
- "location": "3/562/large_1999_0299_0001__0001_.jpg",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 1022
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 1536
- }
- ]
- },
- "modified": 1472014358000,
- "resizable": true,
- "type": "image"
- },
- "large_thumbnail": {
- "format": "jpeg",
- "location": "https://coimages.sciencemuseumgroup.org.uk/images/3/562/large_thumbnail_1999_0299_0001__0001_.jpg",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 240
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 361
- }
- ]
- },
- "modified": 1472014358000,
- "resizable": true,
- "type": "image"
- },
- "medium": {
- "format": "jpeg",
- "location": "3/562/medium_1999_0299_0001__0001_.jpg",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 576
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 866
- }
- ]
- },
- "modified": 1472014358000,
- "resizable": true,
- "type": "image"
- },
- "medium_thumbnail": {
- "format": "jpeg",
- "location": "3/562/medium_thumbnail_1999_0299_0001__0001_.jpg",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 144
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 216
- }
- ]
- },
- "modified": 1472014358000,
- "resizable": true,
- "type": "image"
- },
- "small_thumbnail": {
- "format": "jpeg",
- "location": "3/562/small_thumbnail_1999_0299_0001__0001_.jpg",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 48
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 72
- }
- ]
- },
- "modified": 1472014358000,
- "resizable": true,
- "type": "image"
- },
- "zoom": {
- "format": "pyramid tiff",
- "location": "3/562/1999_0299_0001__0001_.ptif",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 2832
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 4256
- }
- ]
- },
- "modified": 1472014358000,
- "resizable": true,
- "type": "image"
- }
- },
- "public_view": "1",
- "publish": "1",
- "sort": "2015-06-06 02:25:55.0",
- "source": {
- "legal": {
- "rights": [
- {
- "details": "\u00a9 The Board of Trustees of the Science Museum",
- "usage_terms": "CC-BY-NC-SA 4.0"
- }
- ]
- },
- "title": [
- {
- "type": "caption",
- "value": "Packet of 10 'Gold Flake' cigarettes by W D & HO Willis"
- },
- {
- "type": "main title",
- "value": "Packet of 10 'Gold Flake' cigarettes by W D & HO Willis, England, 1920-1950. Three quarter side view, grey background"
- }
- ]
- },
- "traffic_light": "Green",
- "type": {
- "base": "media",
- "type": "image"
- }
- },
- {
- "@link": {
- "type": "reference"
- },
- "admin": {
- "id": "media-3563",
- "source": "smgi",
- "uid": "i3563",
- "uuid": "465e1b57-cfd3-3b29-8d33-8a5726d53143"
- },
- "credit": "Science Museum Group Collection",
- "enhancement": {
- "rekognition": [
- {
- "labels": [
- {
- "details": {
- "confidence": 93.55691
- },
- "value": "Text"
- }
- ],
- "source": "amazon rekognition"
- }
- ]
- },
- "for_sale": "0",
- "identifier": [
- {
- "type": "iBase id",
- "value": "3563"
- }
- ],
- "priority": "0.5",
- "processed": {
- "large": {
- "format": "jpeg",
- "location": "3/563/large_1999_0299_0001__0002_.jpg",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 1022
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 1536
- }
- ]
- },
- "modified": 1472014477000,
- "resizable": true,
- "type": "image"
- },
- "large_thumbnail": {
- "format": "jpeg",
- "location": "3/563/large_thumbnail_1999_0299_0001__0002_.jpg",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 240
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 361
- }
- ]
- },
- "modified": 1472014477000,
- "resizable": true,
- "type": "image"
- },
- "medium": {
- "format": "jpeg",
- "location": "3/563/medium_1999_0299_0001__0002_.jpg",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 576
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 866
- }
- ]
- },
- "modified": 1472014477000,
- "resizable": true,
- "type": "image"
- },
- "medium_thumbnail": {
- "format": "jpeg",
- "location": "3/563/medium_thumbnail_1999_0299_0001__0002_.jpg",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 144
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 216
- }
- ]
- },
- "modified": 1472014477000,
- "resizable": true,
- "type": "image"
- },
- "small_thumbnail": {
- "format": "jpeg",
- "location": "3/563/small_thumbnail_1999_0299_0001__0002_.jpg",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 48
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 72
- }
- ]
- },
- "modified": 1472014477000,
- "resizable": true,
- "type": "image"
- },
- "zoom": {
- "format": "pyramid tiff",
- "location": "3/563/1999_0299_0001__0002_.ptif",
- "location_is_relative": true,
- "measurements": {
- "dimensions": [
- {
- "dimension": "height",
- "units": "pixels",
- "value": 2832
- },
- {
- "dimension": "width",
- "units": "pixels",
- "value": 4256
- }
- ]
- },
- "modified": 1472014477000,
- "resizable": true,
- "type": "image"
- }
- },
- "public_view": "1",
- "publish": "1",
- "sort": "2015-06-06 02:26:07.0",
- "source": {
- "legal": {
- "rights": [
- {
- "details": "\u00a9 The Board of Trustees of the Science Museum",
- "usage_terms": "CC-BY-NC-SA 4.0"
- }
- ]
- },
- "title": [
- {
- "type": "caption",
- "value": "Packet of 10 'Gold Flake' cigarettes by W D & HO Willis"
- },
- {
- "type": "main title",
- "value": "Packet of 10 'Gold Flake' cigarettes by W D & HO Willis, England, 1920-1950. Three quarter side view of back of packet."
- }
- ]
- },
- "traffic_light": "Green",
- "type": {
- "base": "media",
- "type": "image"
- }
- }
- ],
- "name": [
- {
- "primary": true,
- "value": "cigarette packet"
- }
- ],
- "numbers": {
- "NUMBER1": "117"
- },
- "options": {
- "option1": "W D & H O Willis were one of a large number of cigarette and tobacco manufacturers based in England. This is a packet for ten 'Gold Flake' cigarettes, which were popular during the First World War with British soldiers in the trenches. Today, these cigarettes are only available in India.",
- "option2": "Brought to Life project",
- "option3": "Emmens, Stewart"
- },
- "summary_title": "Packet of 10 'Gold Flake' cigarettes (cigarette packet)",
- "title": [
- {
- "primary": true,
- "value": "Packet of 10 'Gold Flake' cigarettes"
- }
- ]
- },
- "id": "co8102855",
- "links": {
- "self": "https://collection.sciencemuseumgroup.org.uk/objects/co8102855/packet-of-10-gold-flake-cigarettes-cigarette-packet"
- },
- "relationships": {
- "parent": {
- "data": [
- {
- "id": "co498352",
- "type": "parent"
- }
- ]
- },
- "terms": {
- "data": [
- {
- "id": "ct264958",
- "type": "terms"
- },
- {
- "id": "ct267103",
- "type": "terms"
- },
- {
- "id": "ct261878",
- "type": "terms"
- },
- {
- "id": "ct261888",
- "type": "terms"
- },
- {
- "id": "ct262591",
- "type": "terms"
- },
- {
- "id": "ct263874",
- "type": "terms"
- }
- ]
- }
- },
- "type": "objects"
- }
-]
diff --git a/tests/dags/providers/provider_api_scripts/test_science_museum.py b/tests/dags/providers/provider_api_scripts/test_science_museum.py
index 31402a844..3d2985607 100644
--- a/tests/dags/providers/provider_api_scripts/test_science_museum.py
+++ b/tests/dags/providers/provider_api_scripts/test_science_museum.py
@@ -1,44 +1,75 @@
import json
import logging
import os
-from unittest.mock import MagicMock, patch
+from pathlib import Path
+from unittest.mock import patch
-import requests
+import pytest
from common.licenses import LicenseInfo
-from common.storage.image import MockImageStore
-from providers.provider_api_scripts import science_museum as sm
+from common.loader import provider_details as prov
+from common.storage.image import ImageStore
+from providers.provider_api_scripts.science_museum import ScienceMuseumDataIngester
-_license_info = (
+BY_NC_SA = LicenseInfo(
"by-nc-sa",
"4.0",
"https://creativecommons.org/licenses/by-nc-sa/4.0/",
None,
)
-license_info = LicenseInfo(*_license_info)
-sm.image_store = MockImageStore(provider=sm.PROVIDER, license_info=license_info)
-
-RESOURCES = os.path.join(
- os.path.abspath(os.path.dirname(__file__)), "resources/sciencemuseum"
+BY_SA = LicenseInfo(
+ license="by-sa",
+ version="4.0",
+ url="https://creativecommons.org/licenses/by-sa/4.0/",
+ raw_url=None,
)
+sm = ScienceMuseumDataIngester()
+image_store = ImageStore(provider=prov.SCIENCE_DEFAULT_PROVIDER)
+sm.media_stores = {"image": image_store}
+RESOURCES = Path(__file__).parent / "resources/sciencemuseum"
+
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s: %(message)s", level=logging.DEBUG
)
[email protected](autouse=True)
+def after_test():
+ yield
+ sm.RECORD_IDS = set()
+
+
def _get_resource_json(json_name):
with open(os.path.join(RESOURCES, json_name)) as f:
resource_json = json.load(f)
- return resource_json
+ return resource_json
+
+
+def object_data():
+ yield _get_resource_json("object_data.json")
+
+
+def single_image_data():
+ object_data = _get_resource_json("object_data.json")
+ object_data["attributes"]["multimedia"] = object_data["attributes"]["multimedia"][
+ :1
+ ]
+ yield object_data
+
+
+default_params = {
+ "has_image": 1,
+ "image_license": "CC",
+ "page[size]": 100,
+}
def test_get_query_param_default():
- actual_param = sm._get_query_param()
- expected_param = {
- "has_image": 1,
- "image_license": "CC",
- "page[size]": 100,
+ actual_param = sm.get_next_query_params({}, **{"year_range": (0, 1500)})
+ expected_param = default_params | {
"page[number]": 0,
"date[from]": 0,
"date[to]": 1500,
@@ -48,12 +79,11 @@ def test_get_query_param_default():
def test_get_query_param_offset_page_number():
- actual_param = sm._get_query_param(page_number=10, from_year=1500, to_year=2000)
- expected_param = {
- "has_image": 1,
- "image_license": "CC",
- "page[size]": 100,
- "page[number]": 10,
+ actual_param = sm.get_next_query_params(
+ default_params | {"page[number]": 10}, **{"year_range": (1500, 2000)}
+ )
+ expected_param = default_params | {
+ "page[number]": 11,
"date[from]": 1500,
"date[to]": 2000,
}
@@ -61,117 +91,81 @@ def test_get_query_param_offset_page_number():
assert actual_param == expected_param
-def test_page_record_empty():
- with patch.object(sm, "_get_batch_objects", return_value=[]) as mock_call:
- with patch.object(sm, "_handle_object_data", return_value=None) as mock_handle:
- sm._page_records(from_year=0, to_year=1500)
-
- assert mock_call.call_count == 1
- assert mock_handle.call_count == 0
-
-
-def test_page_record_failure():
- with patch.object(sm, "_get_batch_objects", return_value=None) as mock_call:
- with patch.object(sm, "_handle_object_data", return_value=None) as mock_handle:
- sm._page_records(from_year=0, to_year=1500)
-
- assert mock_call.call_count == 1
- assert mock_handle.call_count == 0
-
-
-def test_get_batch_object_success():
- query_param = {
- "has_image": 1,
- "image_license": "CC",
- "page[size]": 1,
- "page[number]": 1,
- "date[from]": 0,
- "date[to]": 1500,
+def test_get_record_data_success(object_data):
+ actual_record_data = sm.get_record_data(object_data)
+ actual_image_data = actual_record_data[0]
+ assert len(actual_record_data) == 12
+
+ expected_image_data = {
+ "foreign_identifier": "i4453",
+ "foreign_landing_url": "https://collection.sciencemuseumgroup.org.uk/objects/co56202/telescope-by-galileo-replica-telescope-galilean-telescope-refracting-replica",
+ "image_url": "https://coimages.sciencemuseumgroup.org.uk/images/4/453/large_1923_0668__0002_.jpg",
+ "height": 1151,
+ "width": 1536,
+ "filetype": "jpeg",
+ "license_info": BY_SA,
+ "creator": "Galileo Galilei",
+ "title": "Telescope by Galileo (replica) (telescope - Galilean; telescope - refracting; replica)",
+ "meta_data": {
+ "accession number": "1923-668",
+ "category": "SCM - Astronomy",
+ "description": "Facsimile of telescope by Galileo with main tube measuring 2-foot, 8 1/2-inches "
+ "and magnification of 21 times. Made by Cipriani and purchased from the Museo di "
+ "Fisica e Storia Naturale, Florence, Italy in 1923.",
+ "name": "telescope - refracting",
+ },
}
- response = _get_resource_json("response_success.json")
- r = requests.Response()
- r.status_code = 200
- r.json = MagicMock(return_value=response)
- with patch.object(sm.delay_request, "get", return_value=r) as mock_call:
- actual_response = sm._get_batch_objects(query_param=query_param)
+ for key, value in expected_image_data.items():
+ assert key and value == actual_image_data[key]
+ assert actual_image_data == expected_image_data
- expected_response = response.get("data")
- assert mock_call.call_count == 1
- assert actual_response == expected_response
+def test_save_item_adds_filetype(single_image_data):
+ with patch.object(sm.media_stores["image"], "save_item") as mock_save:
+ sm.process_batch([single_image_data])
+ actual_image = mock_save.call_args[0][0]
+ assert "jpg" == actual_image.filetype
-def test_get_batch_object_failure():
- query_param = {
- "has_image": 1,
- "image_license": "CC",
- "page[size]": 1,
- "page[number]": 51,
- "date[from]": 0,
- "date[to]": 1500,
- }
- response = _get_resource_json("response_failure.json")
- r = requests.Response()
- r.status_code = 400
- r.json = MagicMock(return_value=response)
- with patch.object(sm.delay_request, "get", return_value=r) as mock_call:
- actual_response = sm._get_batch_objects(query_param=query_param)
-
- assert mock_call.call_count == 3
- assert actual_response is None
-
-
-def test_get_batch_object_no_response():
- query_param = {
- "has_image": 1,
- "image_license": "CC",
- "page[size]": 1,
- "page[number]": 1,
- "date[from]": 0,
- "date[to]": 1500,
- }
- response = None
- with patch.object(sm.delay_request, "get", return_value=response) as mock_call:
- actual_response = sm._get_batch_objects(query_param=query_param)
-
- assert mock_call.call_count == 3
- assert actual_response is None
+def test_creator_info_success(object_data):
+ attributes = object_data["attributes"]
+ actual_creator = sm._get_creator_info(attributes)
-
-def test_creator_info_success():
- obj_attr = _get_resource_json("object_attr.json")
- actual_creator = sm._get_creator_info(obj_attr)
- expected_creator = "W D and H O Wills Limited"
-
- assert actual_creator == expected_creator
+ assert actual_creator == "Galileo Galilei"
-def test_creator_info_fail():
- obj_attr = {}
- actual_creator = sm._get_creator_info(obj_attr)
- expected_creator = None
+def test_creator_info_fail(object_data):
+ attributes = object_data["attributes"]
+ attributes["lifecycle"]["creation"][0].pop("maker", None)
+ actual_creator = sm._get_creator_info(attributes)
- assert actual_creator == expected_creator
+ assert actual_creator is None
def test_image_info_large():
large_image = _get_resource_json("large_image.json")
- actual_image, actual_height, actual_width = sm._get_image_info(large_image)
+ actual_image, actual_height, actual_width, actual_filetype = sm._get_image_info(
+ large_image
+ )
expected_image = (
"https://coimages.sciencemuseumgroup.org.uk/images/3/563/"
"large_1999_0299_0001__0002_.jpg"
)
expected_height = 1022
expected_width = 1536
+ expected_filetype = "jpeg"
assert actual_image == expected_image
assert actual_height == expected_height
assert actual_width == expected_width
+ assert actual_filetype == expected_filetype
def test_image_info_medium():
medium_image = _get_resource_json("medium_image.json")
- actual_image, actual_height, actual_width = sm._get_image_info(medium_image)
+ actual_url, actual_height, actual_width, actual_filetype = sm._get_image_info(
+ medium_image
+ )
expected_image = (
"https://coimages.sciencemuseumgroup.org.uk/images/3/563/"
@@ -180,17 +174,19 @@ def test_image_info_medium():
expected_height = 576
expected_width = 866
- assert actual_image == expected_image
+ assert actual_url == expected_image
assert actual_height == expected_height
assert actual_width == expected_width
+ assert actual_filetype == "jpeg"
def test_image_info_failure():
- actual_image, actual_height, actual_width = sm._get_image_info({})
+ actual_url, actual_height, actual_width, actual_filetype = sm._get_image_info({})
- assert actual_image is None
+ assert actual_url is None
assert actual_height is None
assert actual_width is None
+ assert actual_filetype is None
def test_check_relative_url():
@@ -232,8 +228,8 @@ def test_get_dimensions():
def test_get_dimensions_none():
- measurements = None
- actual_height, actual_width = sm._get_dimensions(measurements)
+ image_data = {}
+ actual_height, actual_width = sm._get_dimensions(image_data)
assert actual_height is None
assert actual_width is None
@@ -241,29 +237,38 @@ def test_get_dimensions_none():
def test_get_license():
source = _get_resource_json("license_source.json")
- actual_license_version = sm._get_license_version(source)
- expected_license_version = "CC-BY-NC-SA 4.0"
+ actual_license = sm._get_license(source)
+ expected_license = ("by-nc-sa", "4.0")
+
+ assert actual_license == expected_license
+
+
+def test_get_license_with_space():
+ source = _get_resource_json("license_source.json")
+ source["source"]["legal"]["rights"][0]["usage_terms"] = "CC BY-NC-SA 4.0"
+ actual_license = sm._get_license(source)
+ expected_license = ("by-nc-sa", "4.0")
- assert actual_license_version == expected_license_version
+ assert actual_license == expected_license
def test_get_license_none_type1():
- source = None
- actual_license_version = sm._get_license_version(source)
+ image_data = {}
+ actual_license_version = sm._get_license(image_data)
assert actual_license_version is None
def test_get_license_none_type2():
- source = {}
- actual_license_version = sm._get_license_version(source)
+ image_data = _get_resource_json("no_license_no_legal.json")
+ actual_license_version = sm._get_license(image_data)
assert actual_license_version is None
def test_get_license_none_type3():
- source = _get_resource_json("no_license.json")
- actual_license_version = sm._get_license_version(source)
+ image_data = _get_resource_json("no_license_no_usage_terms.json")
+ actual_license_version = sm._get_license(image_data)
assert actual_license_version is None
@@ -276,15 +281,8 @@ def test_get_metadata():
assert actual_metadata == expected_metadata
-def test_handle_obj_data():
- object_data = _get_resource_json("objects_data.json")
- actual_image_count = sm._handle_object_data(object_data)
-
- assert actual_image_count == 2
-
-
-def test_handle_obj_data_none():
- object_data = []
- actual_image_count = sm._handle_object_data(object_data)
+def test_handle_obj_data_none(object_data):
+ object_data["attributes"]["multimedia"] = []
+ actual_images = sm.get_record_data(object_data)
- assert actual_image_count == 0
+ assert actual_images is None