Feature #13279
Add relationship type to authority record relations CSV import and export
Status: | Verified | Start date: | 04/29/2020 | |
---|---|---|---|---|
Priority: | High | Due date: | ||
Assignee: | Mike Cantelon | % Done: | 100% | |
Category: | CSV import | |||
Target version: | Release 2.6.0 | |||
Google Code Legacy ID: | Tested version: | 2.6 | ||
Sponsored: | Yes | Requires documentation: | No |
Description
In Feature #6049 we added the ability to qualify actor-to-actor relationships with relationship type terms. These terms could be paired with a converse term to allow for automatic bi-directional linking - a "is the parent of" term could be made the converse term of "is the child of" for example, so if a relationship is added saying that Bob is the parent of Alice, then viewing Alice's authority record will show the converse relation - Alice is the child of Bob.
However, at the time, support for these relationship types was not added to the authority record CSV import and export.
This enhancement will add relevant columns to the CSV import template for relations, so this information can be captured in exports, as well as included in imports.
Feature specification
Given: The relationship type value has been added to the authority record relations CSV import and export templates When: I import or export new authority record relationships using CSV import Then: relationship type values for each relations record will be imported or exported And: each relationship type will include a value for the converse relationship (e.g. "is a parent of" will include the converse relation "is a child of")
Subtasks
Related issues
History
#1 Updated by Peter Van Garderen about 2 years ago
- Category set to CSV import
#2 Updated by Dan Gillean about 2 years ago
- Related to Feature #13277: Add multi-value alias names to the Authority record CSV import and export template added
#3 Updated by Dan Gillean about 2 years ago
- Description updated (diff)
#5 Updated by Dan Gillean about 2 years ago
- Related to Feature #6049: Add converse predicates to ISAAR relationships (automatic bidirectional linking) added
#6 Updated by Peter Van Garderen about 2 years ago
- Description updated (diff)
#7 Updated by Mike Cantelon about 2 years ago
I think handling the addition of relationship terms by the CSV would likely be too complicated and, if possible, we should require that they be added before an import is done (in the web UI terms and their converse can be defined... or they can be set to be reciprocal).
I ended up, in the PR for #13286, renaming the "sourceAuthorizedFormOfName" and "targetAuthorizedFormOfName" columns to "objectAuthorizedFormOfName" and another "subjectAuthorizedFormOfName" (given that "source" and "target" don't really make sense as column names). By defining an object and a subject this means that only one form of a relation type can be used in the "relationType" column (previously named "category").
Here's a list of applicable types, excluding reciprocal types, derived from an SQL query (maybe we should add an option to the authority relationship import task to display these relationship names):
mysql> select ti.name from relation r inner join term_i18n ti on r.object_id=ti.id where r.type_id=177 and ti.culture='en' and r.object_id != r.subject_id; +-----------------------+ | name | +-----------------------+ | is the superior of | | controls | | is the owner of | | is the predecessor of | | is the parent of | | is the grandparent of | | is the provider of | +-----------------------+
Here's, as an alternative, a list of relations going in the other direction.
mysql> select ti.name from relation r inner join term_i18n ti on r.subject_id=ti.id where r.type_id=177 and ti.culture='en' and r.object_id != r.subject_id; +-----------------------+ | name | +-----------------------+ | is the subordinate of | | is controlled by | | is owned by | | is the successor of | | is the child of | | is the grandchild of | | is the client of | +-----------------------+
#8 Updated by Mike Cantelon about 2 years ago
Re: the above comment... we could dynamically create a list of allowed relation types (so any types added by the user get included), including both reciprocal types and ones with converse relation types, and display that in the command "long help" (./symfony help csv:authority-relation-import
).
#9 Updated by Mike Cantelon about 2 years ago
Actually relation import currently works for relationship types like "is controlled by" if you simply reverse the placement of the authority names in the "objectAuthorizedFormOfName" and "subjectAuthorizedFormOfName" columns so it works as expected. In general "objectAuthorizedFormOfName" is __ of/by "subjectAuthorizedFormOfName" works.
#10 Updated by Mike Cantelon about 2 years ago
If we need to provide an automated way of importing relationship types probably supporting this via our SKOS import, if it's not already supported (doesn't look like it is for SKOS export but it might be for import), would be the way to go.
#11 Updated by Peter Van Garderen about 2 years ago
- Status changed from New to QA/Review
- Assignee changed from Mike Cantelon to Peter Van Garderen
- Tested version 2.6 added
See https://github.com/artefactual/atom/commit/507780ee74b276a0a38bf439b3c00ba888c91942
QA TESTING NOTES:- Works on Vagrant Ubuntu 18.04 Bionic
- Works for both CLI (csv:authority-relation-import) and GUI import
- If a relationship already exists, it won't be overwritten by the new imported relationship. The latter will be ignored.
- If a relationship type does not already exist in AtoM, the import job will break on that CSV row with the error "Unknown relationship type ...". The rows prior to it will be imported. The rows after it will be ignored.
- The import has been successfully tested for each relationship type currently implemented in AtoM by default:
- is the associate of
- is the business partner of
- is the friend of
- is the client of
- is the provider of
- is the parent of
- is the child of
- is the sibling of
- is the cousin of
- is the grandparent of
- is the grandchild of
- is the spouse of
- controls
- is controlled by
- is owned by
- is the owner of
- is the subordinate of
- is the superior of
- is the predecessor of
- is the successor of
- Works with newly created relationship types (e.g. "is haunted by/haunts")
- The import is case-sensitive, so "Is owned by" will fail but "is owned by" will work
- The CLI CSV export task includes a Relations CSV but this does not include the Relationship Type, only the Relationship Category. Also the column names in the export are still using the older "source" and "target" label prefixes.
#13 Updated by Mike Cantelon about 2 years ago
Sounds good!
I'll make these fixes (should only take a few hours, if that):
- Make unknown relationship type simply skip the row with a warning
- Make relationship matching case insensitive
- Fix naming of export columns
#14 Updated by Peter Van Garderen almost 2 years ago
Fixed.
#15 Updated by Peter Van Garderen almost 2 years ago
- Status changed from QA/Review to In progress
- Assignee changed from Peter Van Garderen to Mike Cantelon
#16 Updated by Peter Van Garderen almost 2 years ago
One subtask remaining: https://projects.artefactual.com/issues/13329
#17 Updated by Peter Van Garderen almost 2 years ago
php symfony csv:authority-export /path/to/file
php symfony csv:authority-relation-import --index /path/to/file
#18 Updated by Peter Van Garderen almost 2 years ago
- Requires documentation changed from Yes to No
PR for documentation: https://github.com/artefactual/atom-docs/pull/152
#19 Updated by Dan Gillean almost 2 years ago
- Status changed from In progress to Verified