Tuesday, September 1, 2020

First pass mapping EAC-CPF to Linked Art JSON-LD

After pushing updates to map people and organization concepts in Nomisma.org in Linked Art-compliant JSON, I have implemented a similar serialization into xEAC, the open source authority management framework, based on EAC-CPF, that I have been developing on and off since 2012.

Like Nomisma and Numishare projects, an HTTP request for an authority URI includes Link headers that include alternate RDF, Turtle, and JSON-LD serializations for that resource, including a JSON-LD serialization following the Linked Art profile. A capable JSON-LD parser can convert this profile into other serializations of RDF (XML, Turtle, etc.) according to the CIDOC-CRM ontology that other semantic web developers might more readily recognize.

It is therefore possible to request the Linked Art JSON-LD via content negotiation from xEAC, for example:

curl -H "Accept: application/ld+json;profile=\"https://linked.art/ns/v1/linked-art.json\"" 
     http://numismatics.org/authority/adams_edgar

The Accept header is then parsed by the XProc pipeline in a controller that reads the content-type and profile in order to choose which serialization to enact. In this case, the EAC-CPF document is transformed via an XSLT stylesheet into an intermediate XML document that represents a JSON structure of objects and arrays, which is subsequently transformed by a secondary XSLT stylesheet into a text output, to which the XProc pipeline attaches an `application/ld+json` content-type in the HTTP header. This JSON metamodel approach has been applied throughout many of my frameworks, including Nomisma.org and Numishare, in order to consistently transform various XML schemas into different JSON profiles, from Linked Art to GeoJSON to the model required by d3js for data visualization.

The mapping of EAC-CPF for people, corporate bodies, and families follows the specifications for people and organizations drafted by the Linked Art community, at https://linked.art/model/actor/. A representation of a person in the ANS archival authority system, Edgar H. Adams, includes the preferred name and biographical statement (eac:biogHist/eac:abstract), URIs for matching concepts (a xEAC-specific implementation of eac:identity/eac:entityId[@localType = 'skos:exactMatch']), birth/death (for people) and formed_by/dissolved_by (for families and corporate bodies) dates from eac:existDates, and member/member_of links to URIs that implement relevant W3C Org ontology properties to the @xlink:arcrole in an eac:cpfRelation (also a specific xEAC implementation to align EAC-CPF more directly with Linked Open Data principles).

{
  "@context": "https://linked.art/ns/v1/linked-art.json",
  "id": "http://numismatics.org/authority/adams_edgar",
  "type": "Person",
  "_label": "Adams, Edgar H. (Edgar Holmes), 1868-1940",
  "identified_by": [
    {
      "type": "Name",
      "content": "Adams, Edgar H. (Edgar Holmes), 1868-1940",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300404670",
          "type": "Type",
          "_label": "Primary Name"
        }
      ]
    }
  ],
  "exact_match": [
    "http://viaf.org/viaf/92956241",
    "http://d-nb.info/gnd/101883196",
    "http://dbpedia.org/resource/Edgar_Adams",
    "http://www.wikidata.org/entity/Q3719031",
    "http://id.loc.gov/authorities/names/n81061401",
    "http://n2t.net/ark:/99166/w6n03w0m"
  ],
  "born": {
    "type": "Birth",
    "_label": "Start Date",
    "timespan": {
      "type": "TimeSpan",
      "begin_of_the_begin": "1868-04-07",
      "end_of_the_end": "1868-04-07"
    }
  },
  "died": {
    "type": "Death",
    "_label": "End Date",
    "timespan": {
      "type": "TimeSpan",
      "begin_of_the_begin": "1940-05-05",
      "end_of_the_end": "1940-05-05"
    }
  },
  "referred_to_by": [
    {
      "type": "LinguisticObject",
      "content": "Edgar H. Adams (1868-1940) of Bayville, Oyster Bay, and Brooklyn, 
      New York, was a numismatic scholar, author, and collector who produced, among 
      other works, reference guides to territorial and private gold coins. He also 
      coauthored, with William H. Woodin, the book United States Pattern, Trial, 
      and Experimental Pieces, a standard reference work on pattern coins. He served 
      as editor of The Numismatist, the monthly journal of the American Numismatic 
      Association, wrote a numismatic column for the New York Sun newspaper, and 
      was a co-founder of the New York Numismatic Club (1908).",
      "classified_as": [
        {
          "type": "Type",
          "id": "http://vocab.getty.edu/aat/300435422",
          "_label": "Biography Statement",
          "classified_as": [
            {
              "id": "http://vocab.getty.edu/aat/300418049",
              "type": "Type",
              "_label": "Brief Text"
            }
          ]
        }
      ]
    }
  ],
  "member_of": [
    {
      "type": "Group",
      "id": "http://numismatics.org/authority/new_york_numismatic_club",
      "_label": "New York Numismatic Club"
    },
    {
      "type": "Group",
      "id": "http://viaf.org/viaf/157729460",
      "_label": "American Numismatic Association"
    }
  ]
}

Ideally, we would want to be able to include links to geographic resources for places of birth or death, occupations, and other events as machine-readable data, with actionable xs: dates and references to controlled vocabulary URIs. Some of this is already possible within xEAC because it was built from the ground up to interact with LOD resources, but projects like Social Networks and Archival Context (SNAC) aren't yet well-integrated with external resources.