public class Extractor extends Object
| Modifier and Type | Field and Description |
|---|---|
protected VocabularyMongoServer |
mongoServer |
protected ControlledVocabularyImpl |
vocabulary |
| Constructor and Description |
|---|
Extractor()
Default constructor
|
Extractor(ControlledVocabularyImpl controlledVocabulary)
Constructor for use with object injection
|
Extractor(ControlledVocabularyImpl controlledVocabulary,
VocabularyMongoServer server)
Constructor with the MongoDBServer for use without object Injection
|
| Modifier and Type | Method and Description |
|---|---|
ControlledVocabularyImpl |
findVocabularyByName(String name,
String uri)
Find a Dereferencing vocabulary by name and URI
|
List<ControlledVocabularyImpl> |
getControlledVocabularies()
Retrieve all the stored controlled vocabularies
|
List<EdmMappedField> |
getEdmLabel(String field)
Retrieve the value of a field.
|
String |
getMappedField(EdmLabel europeanaField)
Get the mapped field value from an EdmLabel
|
boolean |
isMapped(String field)
Method to check if a field is mapped or not
|
HashMap<String,List<EdmMappedField>> |
readSchema(String location)
Read an XML file from a location (locally)
|
void |
removeVocabulary(String vocabularyName)
Remove a controlled vocabulary and its mappings
|
boolean |
saveMapping(int iterations,
String[] vocabularyRules,
String vocabularyUrl)
Save the mapping of a controlled vocabulary
|
void |
setMappedField(String fieldToMap,
EdmLabel europeanaField,
String attribute)
Map a field to an EdmLabel.
|
void |
setMongoServer(VocabularyMongoServer server)
Set a MongoServer
|
void |
setVocabulary(ControlledVocabularyImpl vocabulary)
Set active Vocabulary
|
protected VocabularyMongoServer mongoServer
protected ControlledVocabularyImpl vocabulary
public Extractor(ControlledVocabularyImpl controlledVocabulary)
controlledVocabulary - - The vocabulary to usepublic Extractor()
public Extractor(ControlledVocabularyImpl controlledVocabulary, VocabularyMongoServer server)
controlledvocabulary - - The vocabulary to useserver - - The server to connect topublic List<ControlledVocabularyImpl> getControlledVocabularies()
public List<EdmMappedField> getEdmLabel(String field)
field - The field to checkpublic void setMappedField(String fieldToMap, EdmLabel europeanaField, String attribute)
Map mappings = new HashMap();
mappings.put(field,edmLabel);
vocabulary.setElements(mappings);
fieldToMap - europeanaField - public String getMappedField(EdmLabel europeanaField)
europeanaField - - the EdmLabel field string representationpublic boolean isMapped(String field)
field - - The string representation of the fieldpublic HashMap<String,List<EdmMappedField>> readSchema(String location)
location - The file path of the XML filepublic void removeVocabulary(String vocabularyName)
vocabularyName - public boolean saveMapping(int iterations,
String[] vocabularyRules,
String vocabularyUrl)
public ControlledVocabularyImpl findVocabularyByName(String name, String uri)
name - uri - public void setMongoServer(VocabularyMongoServer server)
server - The server to usepublic void setVocabulary(ControlledVocabularyImpl vocabulary)
vocabulary - The vocabulary currently being usedCopyright © 2017 Europeana Foundation. All rights reserved.