public class ImportHelpers extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LINK_TARGET |
static String |
OBJECT_IDENTIFIER |
static String |
UNKNOWN_PREFIX |
Constructor and Description |
---|
ImportHelpers() |
Modifier and Type | Method and Description |
---|---|
static Map<String,Object> |
extractAddress(Map<String,Object> itemData)
Extract an address node representation from the itemData.
|
static List<Map<String,Object>> |
extractDates(Map<String,Object> data)
Extract a list of entity bundles for DatePeriods from the data,
attempting to parse the unitdate attribute.
|
static Map<String,Object> |
extractDescription(Map<String,Object> itemData,
EntityClass entity)
Extract a Map containing the properties of a generic description.
|
static Map<String,Object> |
extractIdentifiers(Map<String,Object> itemData)
Extract DocumentaryUnit properties from the itemData and return them as a new Map.
|
static List<Map<String,Object>> |
extractSubNodes(String type,
Map<String,Object> data) |
static Map<String,Object> |
extractUnknownProperties(Map<String,Object> itemData)
Extract properties from the itemData Map that are marked as unknown, and return them in a new Map.
|
static Object |
flattenNonMultivaluedProperties(String key,
Object value,
EntityClass entity)
only properties that have the multivalued-status can actually be multivalued.
|
static Map<String,Object> |
getSubNode(Map<String,Object> event)
Extract the data from a sub-node.
|
static void |
overwritePropertyInGraph(Map<String,Object> c,
String property,
String value) |
static void |
putPropertyInGraph(Map<String,Object> c,
String property,
String value)
Stores this property value pair in the given graph node representation.
|
public static final String LINK_TARGET
public static final String OBJECT_IDENTIFIER
public static final String UNKNOWN_PREFIX
public static Map<String,Object> extractUnknownProperties(Map<String,Object> itemData) throws ValidationError
itemData
- a Map containing raw properties of a unitValidationError
- neverpublic static Object flattenNonMultivaluedProperties(String key, Object value, EntityClass entity)
key
- a property keyvalue
- a property valueentity
- the EntityClass with which this frameMap must complypublic static Map<String,Object> extractIdentifiers(Map<String,Object> itemData) throws ValidationError
This implementation does not throw ValidationErrors.
itemData
- a Map containing raw properties of a DocumentaryUnitValidationError
- neverpublic static Map<String,Object> extractDescription(Map<String,Object> itemData, EntityClass entity)
itemData
- a Map containing raw properties of the descriptionentity
- an EntityClasspublic static Map<String,Object> extractAddress(Map<String,Object> itemData)
itemData
- a Map containing raw properties of a unitpublic static List<Map<String,Object>> extractDates(Map<String,Object> data)
data
- the data map. This is an out parameter from which
keys associated with extracted dates will be removedpublic static Map<String,Object> getSubNode(Map<String,Object> event)
event
- a Map of event propertiespublic static void overwritePropertyInGraph(Map<String,Object> c, String property, String value)
public static void putPropertyInGraph(Map<String,Object> c, String property, String value)
c
- a Map representation of a graph nodeproperty
- the key to store the value forvalue
- the value to storeCopyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.