Refineries
What is a Refinery?
A refinery is a command that creates a record while simultaneously creating a relationship and relationship type associated with that same record. A refinery can also match on an existing record in a database, and create a relationship between that record and the source data.
A refinery takes a particular data format in given source data, and transforms it through a specific behavior as it is imported into CollectiveAccess. In other words, refineries tell CollectiveAccess how to import certain data, such as names, dates, and relationships, through a specific text command. This then determines how the data will be displayed once it is imported.
A refinery, at a simplistic level, is what it sounds like - it refines an individual data import mapping and allows for greater complexity in data representation.
If a data import requires related records, then refineries must be used. For more on how to implement these in an import mapping, and why, see Relationships and Creating an Import Mapping: Overview page.
Types of Refineries
There are a few types of refineries commonly used in CollectiveAccess:
- Splitters: A Splitter creates records, matches records with existing data, or parses apart specific data elements, literally "splitting" apart values, such as first and last names. Splitters can be applied to a variety of primary tables in CollectiveAccess. For more on Splitters, see Splitters in the Import Mapping tutorial.
- Joiners: A Joiner is used primarily for data that includes names and dates. Joiners are used when two or more parts of a name located in different areas of the data source need to be conjoined into a single record. A dateJoiner makes a single range out of two or more dates in the data source.
- Builders: A Builder creates an upper hierarchy above the to-be-imported data. For more, see Builders.
Splitters
entitySplitter
Creates an Entity Record or finds an exact match on Entity Name, and creates a relationship as defined in the import mapping. Breaks up parts of names, sets Entity type, and other parameters.
entitySplittler parameters:
- delimiter
- relationshipType
- entityType
- attributes
- relationshipTypeDefault
- entityTypeDefault
- interstitial
- relatedEntities
- nonPreferredLabels
- parents
- skipIfValue
- relationships
- matchOn
- displaynameFormat
- doNotParse
- dontCreate
- ignoreParent
collectionSplitter
Creates a Collection Record or finds an exact match on name, and creates a flat relationshp to the imported record, with the parent parameter building an upper hierarchy above the related collection.
Builds a hierarchy when the import table is set to ca_collections
collectionSplittler parameters:
- delimiter
- relationshipType
- collectionType
- attributes
- relationshipTypeDefault
- collectionTypeDefault
- parents
- nonPreferredLabels
- interstitial
- skipIfValue
- relationships
- matchOn
- ignoreParent
- dontCreate
placeSplitter
Creates a Place Record or finds an exact match on name, and creates a relationship as defined in the import mapping
placeSplitter parameters:
delimiter; relationshipType; placeType; attributes; relationshipTypeDefault; placeTypeDefault; placeHierarchy; nonPreferredLabels; interstitial; parents; relationships; matchOn; ignoreParent; dontCreate
movementSplitter
Creates a Movement Record or finds an exact match on name, and creates a relationship
movementSplitter parameters:
delimiter; relationshipType; movementType; attributes; parents; relationshipTypeDefault; movementTypeDefault; nonPreferredLabels; insterstitial; relationships; matchOn; ignoreParent; dontCreate
objectLotSplitter
Creates an Object Lot Record or finds an exact match on name, and creates a relationship
objectLotSplitter parameters:
delimiter; relationshipType; objectLotStatus; objectLotStatusDefault; objectLotType; attributes; relationshipTypeDefault; objectLotTypeDefault; nonPreferredLabels; interstitial; relationships; matchOn; ignoreParent; dontCreate
objectSplitter
Creates an Object Record or finds an exact match on name, and creates a relationship
objectSplitter parameters:
delimiter; relationshipType; objectType; attributes; parents; relationshipTypeDefault; objectTypeDefault; nonPreferredLabels; interstitial; relationships; matchOn; ignoreParent; dontCreate
objectRepresentationSplitter
Locates media by finding an exact match on filename, and generates an Object Representation for the object being imported
Splitter should be mapped to the name of the media to be imported
objectRepresentationSplitter parameters:
objectRepresentationType; attributes; mediaPrefix; matchOn; dontCreate
occurrenceSplitter
Creates an Occurrence Record or finds an exact match on name, and creates a relationship
occurrenceSplitter parameters:
delimiter; relationshipType; occurrenceType; attributes; parents; relationshipTypeDefault; occurrenceTypeDefault; nonPreferredLabels; interstitial; relationships; matchOn; ignoreParent; dontCreate
listItemSplitter
Creates a List Item or finds an exact match on name, and creates a relationship
listItemSplitter parameters:
delimiter; relationshipType; listItemType; attributes; parents; list; relationshipTypeDefault; listItemTypeDefault; interstitial; relationships; matchOn; ignoreParent; dontCreate
storageLocationSplitter
Creates a Storage Location Record or finds an exact match on name, and creates a relationship
storageLocationSplitter parameters:
hierarchicalStorageLocationTypes; delimiter; hierarchicalDelimiter; parents; nonPreferredLabels; interstitial; relationshipType; storageLocationType; attributes; relationshipTypeDefault; storageLocationTypeDefault; relationships; matchOn; ignoreParent; dontCreate
loanSplitter
Creates a Loan Record or finds an exact match on name, and creates a relationship
The loanSplitter creates new records, and as result, full container paths must be specified in the attributes parameter (for example, ca_table.container_code.subElement_code)
loanSplitter parameters
loanType; relationshipType; delimiter; attributes; relationshipTypeDefault; loanTypeDefault; interstitial; parents; relationships; matchOn; ignoreParent; dontCreate
measurementsSplitter
Formats data values that are mapped to an element of the datatype Length or Weight. Will parse dimension expressions in the form dimension1/delimiter/dimension2, and so on
Parsing includes applying default dimensions when none are specified, stripping extraneous trailing text and normalizing unit specifications. The measurementsSplitter does not create new records; it only maps data. As a result, full container paths must be specified in the attributes/elements parameter (for example, use subElement_code or measurementsWidth)
measurementsSplitter parameters:
delimiter; units; elements; attributes
tourStopSplitter
Creates a Tour Stop Record or finds an exact match on name, and creates a relationship
tourStopSplitter parameter:
delimiter; relationshipType; tourStopType; attributes; tour; relationshipTypeDefault; tourStopTypeDefault; nonPreferredLabels; interstitial; relationships; ignoreParent; dontCreate
tourMaker
Creates a tour parent in a tour stop mapping
tourMaker parameters:
tourType; attributes; tourTypeDefault
Joiners
entityJoiner
Merges data from two or more source data columns to make a single entity record (when first and last Entity names are in two different columns, for example).
entityJoiner parameters:
entityType; entityTypeDefault; forename; surname; other_forenames; middlename; displayname; prefix; suffix; attributes; nonPreferred_labels; relationshipType; relationshipTypeDefault; skipifValue; relatedEntities; interstitial
dateJoiner
Merges data from two or more source data columns to make a single data field in CollectiveAccess
Any text wapped with the date() function will parse as a numeric value that can be then compared as is with any other numeric quanitity. For example: "date(^start) > date(^end)" will evaluate true if the "start" date is after the end date.
dateJoiner parameters:
mode; month; day; year; startDay; startMonth; startYear; endDay; endMonth; endYear; expression; start; end; skipStartIfExpression; skipStartIfExpressionReplacementValue; skipEndIfExpression; skipEndIfExpressionReplacementValue
dateAccuracyJoiner
Merges a date input field with an accuracy input field, where the source data specifies granularity of a date in a separate column from the date value. For example, a date of 2014-04-01 with an accuracy of month would result in the date 2014-04 being stored in CollectiveAccess
Map the date value field into the CA attribute, then use the refinery and refinery settings to specify other parameters.
dateAccuracyJoiner parameters:
accuracyField; dateFormat; accuracyValueDay; accuracyValueMonth; accuracyValueYear; dateParseFailureReturnMode; unknownAccuracyValueReturnMode
Builders
entityHierarchyBuilder
Creates an upper hierarchy of occurrences only when the table of the import is set to ca_entities
Map the CA table.element (Column 3 in an import mapping) to ca_entities.parent_id instead of ca_entities
entityHierarchyBuilder parameters:
parents; doNotParse
collectionHierarchyBuilder
Creates an upper hierarchy of collections only when the import table is set to ca_collections
Map the CA table.element (Column 3 in an import mapping) to ca_collectionss.parent_id instead of ca_collections
collectionHierarchyBuilder parameters:
parents; relationships
collectionIndentedHierarchyBuilder
collectionIndentedHierarchyBuilder parameters:
levels; levelTypes; mode
placeHierarchyBuilder
Creates an upper hierarchy of places only when the import table is set to ca_places
Map the CA table.element (Column 3 in an import mapping) to ca_places.parent_id instead of ca_places
placeHierarchyBuilder parameters:
parents; relationships
objectHierarchyBuilder
Imports a hierarchy of List Items when the import table is set to ca_objects
Map the CA table.element (Column 3 in an import mapping) to ca_objects.parent_id instead of ca_objects
objectHierarchyBuilder parameters:
parents; matchOn; dontMatchOnLabel; relationships
occurrenceHierarchyBuilder
Creates an upper hierarchy fo occurrences only when the import table is set to ca_occurrences
Map the CA table.element (Column 3 in an import mapping) to ca_occurrences.parent_id instead of ca_occurrences for occurrence_Splitter
occurrenceHierarchyBuilder parameters:
parents; relationships
listItemHierarchyBuilder
Imports a hierarchy of List Items when the import table is set to ca_list_items
Map the CA table.element (Column 3 in an import mapping) to ca_list_items.parent_id instead of ca_list_items for listItemSplitter
listItemHierarchyBuilder parameters:
parents; list; relationships
listItemIndentedHierarchyBuilder
Builds a hierarchical list from data sources where indents are used (in Excel) to indicate a hierarchical structure
The list can be imported without relationships to any extant or newly created records; the list can be imported in context of and as metadata for an import that maps authority records of another type (objects that carry the list items as metadata)
listItemIndentedHierarchyBuilder parameters:
levels; levelTypes; list; mode
storageLocationHierarchyBuilder
Creates an upper hierarchy fo occurrences only when the import table is set to ca_occurrences
Map the CA table.element (Column 3 in an import mapping) to ca_storage_locations.parent_id instead of ca_storage_locations for storageLocationSplitter
storageLocationHierarchyBuilder parameters:
parents; relationships
Refinery Parameters
Refineries can't function properly without refinery parameters. Refinery parameters simply define the conditions for the refinery. An example is below:
| refinery | refinery parameter |
|---|---|
| entitySplitter | {"relationshipType": "creator", "entityType": "ind"} |
To the left (example Column 6) is the actual refinery itself, made up of CollectiveAccess-specific text that is one continuous string. On the right is the refinery parameter, written in JSON. What is this telling the source data to do?
There are no spaces used in writing Refineries.
The refinery, entitySplitter, is telling CollectiveAccess that within the source data there is a name that should be parsed, or, literally "split," or separated (first, last). Therefore, during the import CollectiveAccess will be able to identify what source data falls under this command, and execute it.
The refinery parameter is further defining the refinery by stating the type of relationship that the source data should have and the type of entity that is being imported. In this example, the names apply to a single individual (the entityType) and the relationship to the objects is the relationshipType of "creator."
Once imported into CollectiveAccess, this refinery and its parameter that exists in the import mapping will look like:

Note that Refineries are optional. If source data does not require more complex elements, they are not needed in a mapping. However, Refineries are extremely useful in pre-defining these more complex elements which determine how data is inter-connected, and automatically importing data in the most straightforward, and logical, format.
For a comprehensive list of refinery parameters for each refinery, see the tables below.
Refinery Parameter Definitions
attributes
Sets or maps metadata for the entity record by referencing the metadataElement code and the location in the data source where the data values can be found
{
"attributes": {
"idno": "OBJ.2017.1",
"address": {
"address1": "^24",
"address2": "^25",
"city": "^26",
"stateprovince": "^27",
"postalcode": "^28",
"country": "^29"
}
}
}
{
"attributes": {
"media": "^1",
"internal_notes": "^2",
"idno": "^1"
}
}
measurementSplitter usage
When using attribute in a measurementSplitter refinery, this maps to other non-measurement elements that may be in the same container. Values here are set for all measurements being split.
auto-generated idno
To map source data to idnos in a *Splitter, see the ‘attributes’ parameter above. An exception exists for when idnos are set to be auto-generated. To create auto-generated idnos within an *Splitter, use the following syntax.
{ "attributes":{"idno": "%"}}
Can be used with: entitySplitter, entityJoiner, collectionSplitter, placeSplitter, movementSplitter, objectLotSplitter, objectSplitter, objectRepresentationSplitter, occurrenceSplitter, listItemSplitter, storageLocationSplitter, loanSplitter, measurementSplitter, tourStopSplitter, tourMarker.
collectionType
Accepts a constant list item idno from the list collection_types or a reference to the location in the data source where the type can be found
{"collectionType": "box"}
Can be used with: collectionSplitter
collectionTypeDefault
Sets the default collection type that will be used if none are defined or if the data source values do not match any values in the CollectiveAccess list collection_types
{"collectionTypeDefault":"series"}
Can be used with: collectionSplitter