{
  "v": 2,
  "about": "ArtFirma: where the app and the PC tool read an artwork record from the work's web page. Sources in priority order; a field is taken from the first source that gives a non-empty value. Same file and same results in the Android app, the iPhone app and verify/tools/artwork-source.mjs. Format v2: https://artfirma.com/artists.html#sources",
  "sources": [
    {
      "id": "schema-org",
      "name": "schema.org VisualArtwork (JSON-LD)",
      "match": {
        "jsonld": "VisualArtwork"
      },
      "fields": {
        "title": {
          "jsonld": "name"
        },
        "artist": {
          "jsonld": "creator",
          "pick": [
            "name"
          ]
        },
        "year": {
          "jsonld": "dateCreated"
        },
        "artform": {
          "jsonld": "artform"
        },
        "medium": {
          "jsonld": "artMedium"
        },
        "size": {
          "jsonld": "size"
        },
        "imageUrl": {
          "jsonld": "image",
          "pick": [
            "url",
            "contentUrl"
          ]
        }
      }
    },
    {
      "id": "artlogic",
      "name": "Artlogic CMS (galleries and artist sites)",
      "match": {
        "meta": {
          "generator": "^[Aa]rtlogic\\b"
        }
      },
      "fields": {
        "artist": {
          "selector": "h1.artist",
          "exclude": "#artist_years"
        },
        "title": {
          "selector": ".subtitle .title"
        },
        "year": {
          "selector": ".subtitle .year",
          "regex": "^((?:19|20)[0-9]{2})$"
        },
        "medium": {
          "selector": [
            ".detail_view_module_artwork_caption .medium",
            ".medium"
          ]
        },
        "size": {
          "selector": [
            ".detail_view_module_artwork_caption .dimensions",
            ".dimensions"
          ],
          "br": "; "
        },
        "notes": {
          "selector": [
            ".edition_details",
            ".signed_and_dated",
            ".signed"
          ],
          "join": "; ",
          "br": "; "
        },
        "statement": {
          "empty": true
        }
      }
    },
    {
      "id": "alexander-james-hamilton",
      "name": "alexanderjameshamilton.com (Shopify; one fact per description line)",
      "match": {
        "url": "^https?://(www\\.)?alexanderjameshamilton\\.com/",
        "product": true
      },
      "description": {
        "lines": [
          {
            "field": "year",
            "line": "^(19|20)[0-9]{2}$"
          },
          {
            "field": "series",
            "line": "^from the ",
            "ignoreCase": true,
            "next": "^(19|20)[0-9]{2} ?[—–-] ?(19|20)[0-9]{2}$",
            "replace": [
              [
                "[´`]",
                "'"
              ]
            ]
          },
          {
            "field": "size",
            "line": "[0-9]+(?:[.,][0-9]+)? ?[x×*] ?[0-9]+(?:[.,][0-9]+)?.*\\b(cm|cms|mm|in|inches)\\b",
            "ignoreCase": true
          },
          {
            "field": "notes",
            "line": "\\bsigned\\b",
            "ignoreCase": true
          },
          {
            "field": "medium",
            "line": "^(photography|photograph|painting|oil|acrylic|mixed media|print|sculpture|drawing|ink|watercolou?r)\\b",
            "ignoreCase": true
          },
          {
            "field": "statement",
            "rest": true
          }
        ]
      }
    },
    {
      "id": "shopify",
      "name": "Shopify product (/products/<handle>.json): vendor and short description lines",
      "match": {
        "product": true
      },
      "fields": {
        "artist": {
          "product": "vendor",
          "regex": "^(.* .*)$"
        }
      },
      "description": {
        "split": "|",
        "lines": [
          {
            "field": "year",
            "line": "^(19|20)[0-9]{2}$"
          },
          {
            "field": "size",
            "line": "^(?=.{1,60}$).*[0-9]+(?:[.,][0-9]+)? ?(?:cm|mm|inches|in|\"|″|”)? ?(?:\\([a-z]+\\) ?)?[x×] ?[0-9]+(?:[.,][0-9]+)? ?(?:cm|mm|inches|in|\"|″|”)(?![a-z])",
            "ignoreCase": true
          },
          {
            "field": "medium",
            "line": "^(?=.{1,80}$)(?:original[ ,]+)?(?:oil|acrylic|mixed media|watercolou?r|gouache|ink|charcoal|pastel|tempera|encaustic|graphite|pencil|spray paint|enamel|collage)\\b.*\\b(?:on|over)\\b",
            "ignoreCase": true,
            "regex": "^(?:[Oo]riginal[ ,]+)?(.+)$"
          },
          {
            "field": "notes",
            "line": "^(?=.{1,60}$)signed\\b",
            "ignoreCase": true
          }
        ]
      }
    },
    {
      "id": "squarespace",
      "name": "Squarespace (7.0 and 7.1 product pages): title, description, size and medium from the description text",
      "match": {
        "meta": {
          "og:image": "\\bsquarespace(?:-cdn)?\\.com/"
        }
      },
      "fields": {
        "title": {
          "selector": "h1.product-title"
        },
        "artist": {
          "meta": "og:site_name",
          "regex": "^(.+?)(?: [|–—] .*)?$"
        },
        "size": {
          "selector": [
            ".product-excerpt",
            ".product-description"
          ],
          "regex": "([0-9]+(?:[.,][0-9]+)? ?(?:cm|mm|inches|in|\"|″|”)? ?[x×] ?[0-9]+(?:[.,][0-9]+)?(?: ?(?:cm|mm|inches|in|\"|″|”)? ?[x×] ?[0-9]+(?:[.,][0-9]+)?)? ?(?:cm|mm|inches|in|\"|″|”))(?![a-z])"
        },
        "medium": {
          "selector": [
            ".product-excerpt",
            ".product-description"
          ],
          "regex": "\\b((?:[Oo]il|[Aa]crylic|[Mm]ixed media|[Ww]atercolou?r|[Gg]ouache|[Ii]nk|[Cc]harcoal|[Pp]astel|[Tt]empera|[Ee]ncaustic|[Gg]raphite|[Pp]encil|[Ss]pray paint|[Ee]namel|[Cc]ollage)(?: and [a-z]+)? on [A-Za-z ]+?)(?=[.,;]|$)"
        },
        "notes": {
          "selector": [
            ".product-excerpt",
            ".product-description"
          ],
          "regex": "\\b([Ss]igned(?: and [a-z]+)?)\\b"
        },
        "statement": {
          "selector": [
            ".product-excerpt",
            ".product-description"
          ]
        },
        "imageUrl": {
          "selector": [
            ".product-gallery-slides-item-image[data-image]",
            "#productSlideshow img[data-image]"
          ],
          "type": "attr",
          "attr": "data-image"
        }
      }
    },
    {
      "id": "open-graph",
      "name": "Open Graph",
      "match": {
        "always": true
      },
      "fields": {
        "title": {
          "meta": "og:title"
        },
        "imageUrl": {
          "meta": "og:image"
        },
        "artist": {
          "meta": "og:site_name"
        },
        "statement": {
          "meta": "og:description"
        }
      }
    },
    {
      "id": "shopify-product",
      "name": "Shopify product (when the page itself gives nothing)",
      "match": {
        "product": true
      },
      "fields": {
        "title": {
          "product": "title"
        },
        "artist": {
          "product": "vendor"
        },
        "imageUrl": {
          "product": "images.src"
        }
      }
    }
  ]
}
