public class Linker extends Object
Constructor and Description |
---|
Linker(com.tinkerpop.frames.FramedGraph<?> graph) |
Modifier and Type | Method and Description |
---|---|
int |
createAndLinkRepositoryVocabulary(Repository repository,
Vocabulary vocabulary,
Actioner user)
Populate a pre-created vocabulary with concepts created based on
access points for all collections within a repository, then link
those concepts to the relevant documentary units.
|
Linker |
withAccessPointTypes(Set<AccessPointType> accessPointTypes)
Set the linker to include only the given access point types, discarding
those already configured.
|
Linker |
withDefaultLanguage(String defaultLanguageCode)
Set the default language code to use for concept descriptions.
|
Linker |
withExcludeSingles(boolean excludeSingles)
Set the linker to ignore concepts which would only connect to a single
item.
|
Linker |
withLogMessage(Optional<String> logMessage)
Set the log message for the created items.
|
Linker |
withTolerant(boolean tolerant)
Set the linker to proceed even if there are integrity errors caused
by two distinct concept names slugifying to the
same string.
|
public int createAndLinkRepositoryVocabulary(Repository repository, Vocabulary vocabulary, Actioner user) throws ValidationError, PermissionDenied
One creation event will be generated for the newly-created concepts (with the vocabulary as the scope) and another for the newly-created links. Currently events will still be created if no concepts/links are made.
It should be advised that this function is not idempotent and running it twice will generate concepts/links twice.
NB. One could argue this function does too much...
repository
- the repositoryvocabulary
- an existing (presumably empty) vocabularyuser
- the user to whom to attribute the operationValidationError
PermissionDenied
public Linker withExcludeSingles(boolean excludeSingles)
excludeSingles
- a boolean valuepublic Linker withTolerant(boolean tolerant)
tolerant
- a boolean valuepublic Linker withDefaultLanguage(String defaultLanguageCode)
defaultLanguageCode
- a three-letter ISO-639-2 codepublic Linker withLogMessage(Optional<String> logMessage)
logMessage
- a descriptive stringpublic Linker withAccessPointTypes(Set<AccessPointType> accessPointTypes)
accessPointTypes
- a list of access point typesCopyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.