Skip to content

v4.2.0

Compare
Choose a tag to compare
@elrayle elrayle released this 08 Jun 01:43
58443a5

Actions Required to Upgrade

There are no required actions for this upgrade other than adjusting your gem file to allow for version 4.2.0 to be included by bundler.

Optional Upgrade Actions

Linked Data - Property Maps - Optional config

This applies to search queries for linked data authorities that define extended context. Without extended context, an authority will return search results with the basic information (i.e. uri, id, label). An authority can have extended context configured that returns additional information with each search result.

Prior to this release, all configured extended context was included in the search results even if the extended context property did not have values in the results graph.

Starting with release 4.2.0, when a property map has optional=false either by being configured directly or by inheriting the default configuration, the results will be the same as the old behavior. That is, the property will be included in the results regardless of whether or not the property has values in the graph for an entity.

Example: Pre 4.2.0 behavior AND 4.2.0 behavior when optional=false. Results include Affiliation when it has no values.

{
  "uri":   "http://id.loc.gov/rwo/agents/n79021164"
  "id":    "n 79021164"
  "label": "Twain, Mark, 1835-1910"
  "context": [
    {
      "property":   "Descriptor",
      "values":     ["Americans"],
      "selectable": false,
      "drillable":  false
    },
    {
      "property":   "Affiliation",
      "values":     [],
      "selectable": false,
      "drillable":  false
    }
  ]
}

When a property map has optional=true either by being configured directly or by inheriting the default configuration, the property will only be included in the results if it has a value.

Example: 4.2.0 behavior when optional=true. Results exclude Affiliation when it has no values.

{
  "uri":   "http://id.loc.gov/rwo/agents/n79021164"
  "id":    "n 79021164"
  "label": "Twain, Mark, 1835-1910"
  "context": [
    {
      "property":   "Descriptor",
      "values":     ["Americans"],
      "selectable": false,
      "drillable":  false
    }
  ]
}

Per property configuration

To directly configure for a specific property, add the optional parameter to the property map in the authority configuration file (e.g. config/authorities/linked_data/oclc_fast.json).

{
  "term": { ... }
  "search": {
    "url": { ... }
    "qa_replacement_pattern": { ... }
    "results": { ... }
    "context": {
      "properties": [
        {
          "property_label_default": "Descriptor",
          "property_label_i18n": "qa.linked_data.authority.locnames_ld4l_cache.type_label",
          "ldpath": "madsrdf:entityDescriptor/madsrdf:authoritativeLabel :: xsd:string",
          "optional": false
        },
        {
          "property_label_default": "Affiliation",
          "property_label_i18n": "qa.linked_data.authority.locnames_ld4l_cache.field_of_activity",
          "ldpath": "(madsrdf:hasAffiliation/madsrdf:organization/skos:prefLabel) | (madsrdf:hasAffiliation/madsrdf:organization/rds:label) :: xsd:string",
          "optional": true
        }
      ]
    }
  }
}

NOTE: If optional is not specified for a property, it will inherit the configured default value.

Configuring a default

QA will use a default value of "optional": false if no change is made to the default configuration. This maintains backward compatibility.

To change the configuration of the default to true:

  • Edit /config/initializers/qa.rb
  • Uncomment and set the value of config.property_map_default_for_optional.
    • If true, excludes properties with blank values. Applies to properties that have not overridden this default in the authority configuration file.
    • If false, includes properties with blank values. Applies to properties that have not overridden this default in the authority configuration file.
  config.property_map_default_for_optional = true # initially set to false; set to true to hide properties without values

New subauthority for LOC linked data authority

The LOC linked data authority now supports the music_performance subauthority which is used to fetch terms from LC Medium of Performance Thesaurus for Music (LCMPT).

http://localhost:3000/qa/show/linked_data/loc/music_performance/mp2013015171

Special Processing for LOC IDs in linked data module

This section is information only. No action is required.

The linked data module can receive an ID and transform it into a URI. At this time, many, but not all, LOC IDs have a blank in the ID (e.g. 'n 79021164'). The associated URI does not have a blank (e.g. 'http://id.loc.gov/rwo/agents/n79021164').

Special processing was put in place in this release to check if the authority being processed accesses http://id.loc.gov. If it does and the first attempt to transform the ID into a URI fails, it will remove the from the ID and try again.

A similar process is used to extract the ID from the URI by making a second attempt after adding a between the initial letters and the start of the numbers.

Change Log

  • allow property_map.optional? default value to be configurable
  • make it optional whether to include blank values in linked data extended context
  • allow id to be identified by multiple predicates/paths
  • add music performance to loc linked data config
  • improve comments about LOC special processing
  • add bytes and bytes/s to performance data
  • raise an exception if data can’t be normalized
  • determine if loc special processing is needed based on template uri instead of authority name
  • removing the test configuration for using Rails 5.0.x releases
  • updates the CircleCI configuration to test against Rails releases 5.2.3, 5.1.7, and 5.0.7.2
  • updates the CircleCI configuration to test against Ruby releases 2.6.3, 2.5.5, and 2.4.6