samvera / questioning_authority

Question your authorities
Other
54 stars 30 forks source link

Expand extended content to create sets driven from subgraph #269

Open elrayle opened 5 years ago

elrayle commented 5 years ago

Description:

Most extended context describes some property about the search result subject. It may be a triple directly off the subject, or it may require a more complex ldpath description to get to the value.

There is an additional use case where the extended context is about an entity in the extended context. For example, a search is performed which returns subjects for works. There is an agent for a work. The agent is a piece of extended context about the work. The agent itself can have an agent-role. This agent-role is related to the agent and not to the work itself.

How can we configure and normalize output to indicate the agent-role is connected to the agent?

Proposed Solution

Related subgraphs will be gathered in the context as context sets. A context set will include the following information.

Example Context Set for Agent

NOTE: Above ldpaths start from the search result URI.

Snippet of Context Set Configuration in QA Authority:

  "sets": {
    "agent": {
      "group_label_i18n": "qa.linked_data.authority.locnaf_ld4l_cache.agent_set",
      "group_label_default": "Agents",
    }
  },
  "properties": [
    ...
    {
      "set_id": "agent",
      "property_label_i18n": "qa.linked_data.authority.locnaf_ld4l_cache.agent",
      "property_label_default": "Agent",
      "lpath": "bf:contribution/bf:agent/rdfs:label",
      "selectable": false,
      "drillable": false
    },
    {
      "set_id": "agent",
      "property_label_i18n": "qa.linked_data.authority.locnaf_ld4l_cache.agent_role",
      "property_label_default": "Agent Role",
      "lpath": "bf:contribution/bf:agent/bf:role/rdfs:label",
      "selectable": false,
      "drillable": false
    },
    ...
  ]
}

Snippet of Normalized QA Output:

[
    ...
    {
      "set": "Agents",
        [
          {
            "property": "Agent",
            "values: ['Twain, Mark'],
            "selectable": false,
            "drillable": false
          },
          {
            "property": "Agent Role",
            "values: ['Contributor'],
            "selectable": false,
            "drillable": false
          }
        ],
        [
          {
            "property": "Agent",
            "values: ['Chatto & Windus'],
            "selectable": false,
            "drillable": false
          },
          {
            "property": "Agent Role",
            "values: ['Publisher'],
            "selectable": false,
            "drillable": false
          }
        ]
    }
    ...
]

Full QA Output example

[
  {
    "property": "Authoritative Label",
    "values": ["Adventures of Huckleberry Finn"],
    "selectable": true,
    "drillable": false
  },

  {
    "property": "Variant Label",
    "values": ["Huckleberry Finn"],
    "selectable": false,
    "drillable": false
  },
  {
    "set": "Agents",
      [
        {
          "property": "Agent",
          "values: ['Twain, Mark'],
          "selectable": false,
          "drillable": false
        },
        {
          "property": "Agent Role",
          "values: ['Contributor'],
          "selectable": false,
          "drillable": false
        }
      ],
      [
        {
          "property": "Agent",
          "values: ['Chatto & Windus'],
          "selectable": false,
          "drillable": false
        },
        {
          "property": "Agent Role",
          "values: ['Publisher'],
          "selectable": false,
          "drillable": false
        }
      ]
  }
]