Skip to content
Snippets Groups Projects
Commit 99b90f2b authored by Stefan E. Funk's avatar Stefan E. Funk
Browse files

Merge branch '3-test-openaire-responses' into 'develop'

Resolve "Test OpenAIRE responses"

Closes #3

See merge request dariah-de/dariah-de-oai-pmh-services!80
parents 9c47c668 601ef948
No related branches found
No related tags found
No related merge requests found
Pipeline #342195 passed
Showing
with 505 additions and 361 deletions
......@@ -19,7 +19,7 @@ import info.textgrid.middleware.oaipmh.ResumptionTokenType;
/**
* @author Stefan E. Funk, SUB Göttingen
* @version 2022-09-07
* @version 2023-01-03
* @since 2014-02-20
*/
public abstract class IdentifierListDelivererAbstract implements IdentifierListDelivererInterface {
......@@ -154,7 +154,7 @@ public abstract class IdentifierListDelivererAbstract implements IdentifierListD
JSONObject json = new JSONObject(hit.getSourceAsMap());
// Get modifiedDate field and convert datestamp.
this.datestamp = OaipmhUtilities.fieldLoader(json, this.dateOfObjectCreation);
this.datestamp = OaipmhUtilities.firstEnrtryFieldLoader(json, this.dateOfObjectCreation);
try {
this.datestamp = OaipmhUtilities.convertDateFormat(this.datestamp).toXMLFormat();
} catch (ParseException e) {
......@@ -166,7 +166,7 @@ public abstract class IdentifierListDelivererAbstract implements IdentifierListD
}
// Get identifier field.
String identifier = OaipmhUtilities.fieldLoader(json, this.identifierField);
String identifier = OaipmhUtilities.firstEnrtryFieldLoader(json, this.identifierField);
lit = setListIdentifierHeader(this.datestamp, identifier, lit, set);
}
}
......
......@@ -22,7 +22,7 @@ import info.textgrid.middleware.oaipmh.ResumptionTokenType;
/**
* @author Max Brodhun, SUB Göttingen
* @author Stefan E. Funk, SUB Göttingen
* @version 2022-09-23
* @version 2023-01-03
*/
public class IdentifierListDelivererIdiom extends IdentifierListDelivererAbstract {
......@@ -73,6 +73,7 @@ public class IdentifierListDelivererIdiom extends IdentifierListDelivererAbstrac
BoolQueryBuilder both = QueryBuilders.boolQuery().should(artefactQuery).should(conedakorQuery);
// TODO bla???
BoolQueryBuilder bla =
QueryBuilders.boolQuery().must(rangeQuery).must(projectQuery.filter(both));
recordFilterForClassicMayan = bla;
......@@ -121,10 +122,11 @@ public class IdentifierListDelivererIdiom extends IdentifierListDelivererAbstrac
for (SearchHit hit : scrollResp.getHits().getHits()) {
i++;
String textgridURI =
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), OaipmhTGConstants.URI);
String createdDate = OaipmhUtilities.oaiDatestampAsString(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), OaipmhTGConstants.CREATED));
String textgridURI = OaipmhUtilities
.firstEnrtryFieldLoader(new JSONObject(hit.getSourceAsMap()), OaipmhTGConstants.URI);
String createdDate =
OaipmhUtilities.oaiDatestampAsString(OaipmhUtilities.firstEnrtryFieldLoader(
new JSONObject(hit.getSourceAsMap()), OaipmhTGConstants.CREATED));
identifierList.getHeader().add(OaipmhUtilities.computeResponseHeader(createdDate,
OaipmhUtilities.getTextGridBaseURI(textgridURI), ""));
......
......@@ -390,90 +390,113 @@ public class OaipmhUtilities {
/**
* <p>
* Loads the field with MORE params from an array!
* Loops over all fields and collects field contents.
* </p>
*
* @param resultFromGetRequestInES
* @param fields
* @return Returns MORE params as a list!
* @return Returns a list with all field entries.
*/
public static List<String> fieldLoader(JSONObject resultFromGetRequestInES, String[] fields) {
public static List<String> loopListFieldLoader(final JSONObject resultFromGetRequestInES,
final String[] fields) {
log.fine("JSON: " + (resultFromGetRequestInES == null ? "NULL" : resultFromGetRequestInES));
log.fine("FIELDS: " + fields);
List<String> fieldResults = new ArrayList<String>();
List<String> result = new ArrayList<String>();
int count = 0;
for (String field : fields) {
String[] fieldPathForESIndex = field.split(ES_DIVIDER_REGEXP);
log.fine("field[" + count++ + "]: " + field);
JSONObject singlePath = resultFromGetRequestInES;
try {
for (int i = 0; i < fieldPathForESIndex.length; i++) {
if (i < fieldPathForESIndex.length - 1) {
singlePath = singlePath.getJSONObject(fieldPathForESIndex[i]);
} else if (fieldPathForESIndex.length == 1) {
JSONObject resultiDingsda =
resultFromGetRequestInES.getJSONObject(fieldPathForESIndex[i]);
fieldResults.add(resultiDingsda.toString());
} else {
String res = singlePath.get(fieldPathForESIndex[i]).toString();
if (res.startsWith("[")) {
JSONArray array = new JSONArray(res);
for (int j = 0; j < array.length(); j++) {
String find = array.getString(j).toString();
fieldResults.add(find);
}
} else {
fieldResults.add(singlePath.get(fieldPathForESIndex[i]).toString());
}
}
}
} catch (JSONException e) {
log.fine("IGNORING JSON ERROR: " + e.getMessage());
}
for (String f : fields) {
result.addAll(listFieldLoader(resultFromGetRequestInES, f));
}
log.fine("field results: " + fieldResults);
return fieldResults;
return result;
}
/**
* <p>
* Loads the field with ONE param!
* Loads the field with one param.
* </p>
*
* @param resultFromGetRequestInES
* @param field
* @return Returns only ONE String!
* @return Returns one or more params as a list.
*/
public static String fieldLoader(JSONObject resultFromGetRequestInES, String field) {
public static List<String> listFieldLoader(final JSONObject resultFromGetRequestInES,
final String field) {
String fieldResults = "";
List<String> fieldResults = new ArrayList<String>();
log.fine("JSON: " + (resultFromGetRequestInES == null ? "NULL" : resultFromGetRequestInES));
log.fine("FIELD: " + field);
// Check if field has got "." in it, such as
// "edition.source.bibliographicCitation.placeOfPublication".
String[] fieldPathForESIndex = field.split(ES_DIVIDER_REGEXP);
JSONObject singlePath = resultFromGetRequestInES;
try {
// Loop the splitted field components, such as "edition", "source", etcpp.
for (int i = 0; i < fieldPathForESIndex.length; i++) {
String fieldComponent = fieldPathForESIndex[i];
log.fine("i=" + i);
log.fine("fieldPathLength=" + fieldPathForESIndex.length);
// Case 1: Reduce JSON object.
if (i < fieldPathForESIndex.length - 1) {
log.fine(
"case 1: " + i + "<" + (fieldPathForESIndex.length - 1) + " : reduce singlePath");
singlePath = singlePath.getJSONObject(fieldPathForESIndex[i]);
} else if (fieldPathForESIndex.length == 1) {
fieldResults = resultFromGetRequestInES.get(fieldPathForESIndex[i]).toString();
} else {
fieldResults = singlePath.get(fieldPathForESIndex[i]).toString();
}
// Case 2: We have one field component.
else if (fieldPathForESIndex.length == 1) {
log.fine("case 2: we have only one field component in field " + field);
// Add content from JSON, Array or String.
fieldResults.addAll(getFieldContent(singlePath, fieldComponent));
}
// Case 3: We have got more field components.
else {
log.fine("case 3: we have " + fieldPathForESIndex.length + " components in " + field);
// Add content from JSON, Array or String.
fieldResults.addAll(getFieldContent(singlePath, fieldComponent));
}
}
} catch (JSONException e) {
log.fine("IGNORING JSON ERROR: " + e.getMessage());
}
log.fine("field results: " + fieldResults);
return fieldResults;
}
/**
* <p>
* Loads the field with the first param from. Please use for single value fields only.
* </p>
*
* @param resultFromGetRequestInES
* @param field
* @return Returns only the first String from the result list, or "" if list is empty.
*/
public static String firstEnrtryFieldLoader(JSONObject resultFromGetRequestInES, String field) {
String result = "";
List<String> list = listFieldLoader(resultFromGetRequestInES, field);
if (!list.isEmpty()) {
result = list.get(0);
}
return result;
}
/**
* @param theESClient The ES client to use.
* @param idInElasticSearchIndex The ID to get the ES record from.
......@@ -494,7 +517,12 @@ public class OaipmhUtilities {
log.fine("esclient/index: " + (theESClient != null ? theESClient : "null") + "/"
+ (theESClient != null ? theESClient.getEsIndex() : "null"));
// Building the getRequest against the elastic search index
// Check for ES client.
if (theESClient == null) {
throw new IOException("elasticsearch client is NULL!");
}
// Building the getRequest against the elastic search index.
GetRequest getRequest =
new GetRequest(theESClient.getEsIndex(), theESClient.getEsType(), idInElasticSearchIndex)
.fetchSourceContext(fetchSourceContext);
......@@ -707,6 +735,54 @@ public class OaipmhUtilities {
return result.trim();
}
// **
// PRIVATE METHODS
// **
/**
* <p>
* Get List of Strings from JSON object, Array or String!
* </p>
*
* @param singlePath
* @param fieldComponent
* @return
*/
private static List<String> getFieldContent(JSONObject singlePath, String fieldComponent) {
List<String> result = new ArrayList<String>();
// Examine JSONArray, take String if not applicable.
try {
JSONArray singlePathArray = singlePath.getJSONArray(fieldComponent);
log.fine("get json array: " + singlePathArray.toString(2));
for (int j = 0; j < singlePathArray.length(); j++) {
result.add(singlePathArray.getString(j));
}
} catch (JSONException e) {
Object noArray = singlePath.get(fieldComponent);
if (noArray instanceof String) {
log.fine("get string: " + noArray);
result.add(singlePath.getString(fieldComponent));
} else if (noArray instanceof Integer) {
log.fine("get int: " + noArray);
result.add(String.valueOf(singlePath.getInt(fieldComponent)));
} else {
log.fine("no string & no int: " + noArray);
}
}
return result;
}
// **
// GETTERS & SETTERS
// **
......
......@@ -14,7 +14,7 @@ import info.textgrid.middleware.oaipmh.RecordType;
/**
* @author Maximilian Brodhun, SUB Göttingen
* @author Stefan E. Funk, SUB Göttingen
* @version 2022-09-07
* @version 2023-01-03
* @since 2014-02-17
*/
@Component
......@@ -30,10 +30,8 @@ public class RecordDelivererDC extends RecordDelivererAbstract {
super(textgrid, dariah);
}
/*
* (non-Javadoc)
*
* @see info.textgrid.middleware.RecordDelivererInterface#getRecordById(java.lang.String)
/**
*
*/
@Override
public GetRecordType getRecordById(String id)
......@@ -73,14 +71,14 @@ public class RecordDelivererDC extends RecordDelivererAbstract {
if (this.dariah == true) {
dublinCoreBuilder = putContentIntoDCFieldListsDH(esResultObject);
JSONObject json = new JSONObject(esResultObject.getSourceAsMap());
identifier = OaipmhUtilities.fieldLoader(json, this.identifierField);
identifier = OaipmhUtilities.firstEnrtryFieldLoader(json, this.identifierField);
String dateOfCreation = "NO_DATE_SET!";
if (OaipmhUtilities.fieldLoader(json, this.dateOfObjectCreation) != null) {
if (OaipmhUtilities.firstEnrtryFieldLoader(json, this.dateOfObjectCreation) != null) {
try {
dateOfCreation = OaipmhUtilities
.convertDateFormat(
OaipmhUtilities.fieldLoader(json, this.dateOfObjectCreation).toString())
.convertDateFormat(OaipmhUtilities
.firstEnrtryFieldLoader(json, this.dateOfObjectCreation).toString())
.toXMLFormat();
} catch (ParseException e) {
// TODO Auto-generated catch block
......@@ -91,7 +89,7 @@ public class RecordDelivererDC extends RecordDelivererAbstract {
}
}
String setSpec = OaipmhUtilities.fieldLoader(json, this.specField);
String setSpec = OaipmhUtilities.firstEnrtryFieldLoader(json, this.specField);
String setSpecValue =
OaipmhUtilities.getSetSpec(setSpec, this.specFieldPrefix, identifier);
......@@ -238,46 +236,36 @@ public class RecordDelivererDC extends RecordDelivererAbstract {
DublinCoreBuilder result = new DublinCoreBuilder();
// Set DublinCore lists with content from elastic search results due to configuration.
result.setContributor(OaipmhUtilities
.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()), this.contributorList));
result.setCoverage(
OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.coverageList));
result
.setCreator(OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.creatorList));
result.setDate(OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.dateList));
result.setDescription(
OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.descriptionList));
result
.setFormat(OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.formatList));
result.setIdentifier(
OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.identifierList));
result.setLanguage(
OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.languageList));
result.setPublisher(
OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.publisherList));
result.setRelation(
OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.relationList));
result
.setRights(OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.rightsList));
result
.setSource(OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.sourceList));
result.setSubject(OaipmhUtilities
.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()), this.subjectList));
result.setContributor(OaipmhUtilities.loopListFieldLoader(
new JSONObject(responseWorkValues.getSourceAsMap()), this.contributorList));
result.setCoverage(OaipmhUtilities.loopListFieldLoader(
new JSONObject(responseWorkValues.getSourceAsMap()), this.coverageList));
result.setCreator(OaipmhUtilities.loopListFieldLoader(
new JSONObject(responseWorkValues.getSourceAsMap()), this.creatorList));
result.setDate(OaipmhUtilities
.loopListFieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()), this.dateList));
result.setDescription(OaipmhUtilities.loopListFieldLoader(
new JSONObject(responseWorkValues.getSourceAsMap()), this.descriptionList));
result.setFormat(OaipmhUtilities
.loopListFieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()), this.formatList));
result.setIdentifier(OaipmhUtilities.loopListFieldLoader(
new JSONObject(responseWorkValues.getSourceAsMap()), this.identifierList));
result.setLanguage(OaipmhUtilities.loopListFieldLoader(
new JSONObject(responseWorkValues.getSourceAsMap()), this.languageList));
result.setPublisher(OaipmhUtilities.loopListFieldLoader(
new JSONObject(responseWorkValues.getSourceAsMap()), this.publisherList));
result.setRelation(OaipmhUtilities.loopListFieldLoader(
new JSONObject(responseWorkValues.getSourceAsMap()), this.relationList));
result.setRights(OaipmhUtilities
.loopListFieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()), this.rightsList));
result.setSource(OaipmhUtilities
.loopListFieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()), this.sourceList));
result.setSubject(OaipmhUtilities.loopListFieldLoader(
new JSONObject(responseWorkValues.getSourceAsMap()), this.subjectList));
result.setTitle(OaipmhUtilities
.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()), this.titleList));
result.setType(OaipmhUtilities.fieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()),
this.typeList));
.loopListFieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()), this.titleList));
result.setType(OaipmhUtilities
.loopListFieldLoader(new JSONObject(responseWorkValues.getSourceAsMap()), this.typeList));
return result;
}
......
......@@ -24,7 +24,7 @@ import info.textgrid.middleware.oaipmh.RecordType;
/**
* @author Maximilian Brodhun, SUB Göttingen
* @author Stefan E. Funk, SUB Göttingen
* @version 2022-10-06
* @version 2023-01-03
* @since 2019-03-12
*/
@Component
......@@ -218,7 +218,7 @@ public class RecordDelivererIdiom extends RecordDelivererAbstract {
json = new JSONObject(OaipmhUtilities.getRcordByIDFromElasticSearch(this.oaiEsClient, changedId,
searchField, Strings.EMPTY_ARRAY).getSource());
result = OaipmhUtilities.fieldLoader(json, theSearchField);
result = OaipmhUtilities.firstEnrtryFieldLoader(json, theSearchField);
return result;
}
......
......@@ -191,7 +191,7 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
if (hit != null && hit.getFields() != null) {
JSONObject json = new JSONObject(hit.getSourceAsMap());
this.modifiedValue = OaipmhUtilities.fieldLoader(json, this.modifiedField);
this.modifiedValue = OaipmhUtilities.firstEnrtryFieldLoader(json, this.modifiedField);
// **
// TEXTGRID SEARCH
......@@ -240,7 +240,7 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
else if (this.dariah) {
// Get identifier and setSpec field, add setSpec prefix if not already set.
String identifier = OaipmhUtilities.fieldLoader(json, this.identifierField);
String identifier = OaipmhUtilities.firstEnrtryFieldLoader(json, this.identifierField);
String setSpec = OaipmhUtilities.getSetSpec(set, this.specFieldPrefix, identifier);
try {
......@@ -415,8 +415,8 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
result.setDescription(
DublinCoreFieldLoader.fillListFromTGWorkValues(responseWorkValues, this.descriptionList));
result.setFormat(DublinCoreFieldLoader.fillList(hit, this.formatList));
result.setIdentifier(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.identifierList));
result.setIdentifier(OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()),
this.identifierList));
result.setLanguage(DublinCoreFieldLoader.fillList(hit, this.languageList));
result.setPublisher(DublinCoreFieldLoader.fillList(hit, this.publisherList));
result.setRelation(DublinCoreFieldLoader.fillList(hit, this.relationList));
......@@ -443,36 +443,36 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
DublinCoreBuilder result = new DublinCoreBuilder();
result.setContributor(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.contributorList));
result.setCoverage(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.coverageList));
result.setCreator(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.creatorList));
result
.setDate(OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.dateList));
result.setDescription(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.descriptionList));
result.setContributor(OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()),
this.contributorList));
result.setCoverage(OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()),
this.coverageList));
result.setCreator(OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()),
this.creatorList));
result.setDate(
OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()), this.dateList));
result.setDescription(OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()),
this.descriptionList));
result.setFormat(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.formatList));
result.setIdentifier(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.identifierList));
result.setLanguage(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.languageList));
result.setPublisher(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.publisherList));
result.setRelation(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.relationList));
OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()), this.formatList));
result.setIdentifier(OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()),
this.identifierList));
result.setLanguage(OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()),
this.languageList));
result.setPublisher(OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()),
this.publisherList));
result.setRelation(OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()),
this.relationList));
result.setRights(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.rightsList));
OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()), this.rightsList));
result.setSource(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.sourceList));
result.setSubject(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.subjectList));
OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()), this.sourceList));
result.setSubject(OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()),
this.subjectList));
result.setTitle(
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.titleList));
result
.setType(OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), this.typeList));
OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()), this.titleList));
result.setType(
OaipmhUtilities.loopListFieldLoader(new JSONObject(hit.getSourceAsMap()), this.typeList));
return result;
}
......
......@@ -124,8 +124,8 @@ public class RecordListDelivererIdiom extends RecordListDelivererAbstract {
log.fine("hit no." + i + ": id=" + hit.getId());
String textgridURI =
OaipmhUtilities.fieldLoader(new JSONObject(hit.getSourceAsMap()), "textgridUri");
String textgridURI = OaipmhUtilities
.firstEnrtryFieldLoader(new JSONObject(hit.getSourceAsMap()), "textgridUri");
log.fine("textgrid uri: " + textgridURI);
......
......@@ -63,7 +63,6 @@ public class TestTGOaipmhLocally {
private static IdentifierListDelivererIdiom identifierListIDIOM =
new IdentifierListDelivererIdiom(true, false);
private static SetListDeliverer setListTextGrid;
private static IdiomImages idiomImages;
// **
// CLASS
......@@ -148,9 +147,9 @@ public class TestTGOaipmhLocally {
// System.out.println(json);
DublinCoreBuilder result = new DublinCoreBuilder();
List<String> identifier = new ArrayList<String>();
String[] fieldsForIdentifier = {"descriptiveMetadata.dc:identifier"};
System.out.println(OaipmhUtilities.fieldLoader(json, OaipmhConstants.TEST_DARIAH_IDENTIFIER));
identifier = OaipmhUtilities.fieldLoader(json, fieldsForIdentifier);
System.out.println(
OaipmhUtilities.firstEnrtryFieldLoader(json, OaipmhConstants.TEST_DARIAH_IDENTIFIER));
identifier = OaipmhUtilities.listFieldLoader(json, "descriptiveMetadata.dc:identifier");
for (String id : identifier) {
System.out.println(id);
}
......@@ -198,9 +197,9 @@ public class TestTGOaipmhLocally {
JSONObject json = new JSONObject(jsonAsString);
DublinCoreBuilder result = new DublinCoreBuilder();
List<String> identifier = new ArrayList<String>();
String[] fieldsForIdentifier = {"descriptiveMetadata.dc:identifier"};
System.out.println(OaipmhUtilities.fieldLoader(json, OaipmhConstants.TEST_DARIAH_IDENTIFIER));
identifier = OaipmhUtilities.fieldLoader(json, fieldsForIdentifier);
System.out.println(
OaipmhUtilities.firstEnrtryFieldLoader(json, OaipmhConstants.TEST_DARIAH_IDENTIFIER));
identifier = OaipmhUtilities.listFieldLoader(json, "descriptiveMetadata.dc:identifier");
for (String id : identifier) {
System.out.println(id);
}
......
###############################################################################
## OAI-PMH Configuration File ##
###############################################################################
##################################
## OAI-PMH Configuration File ##
##################################
RS_ENDPOINT = https://repository.de.dariah.eu/1.0/oaipmh
......@@ -47,10 +47,14 @@ fields = administrativeMetadata.dcterms:creator, administrativeMetadata.datacite
workFields = descriptiveMetadata.dc:title
######################
## OpenAireRecords ###
## OpenAireRecords ##
######################
oar.identifierField = administrativeMetadata.datacite:identifier
oar.sizeField = administrativeMetadata.dcterms:extent
oar.relationToWorkObject =
oar.handle = administrativeMetadata.dcterms:identifier
oar.titleFields = descriptiveMetadata.dc:title
oar.dateFields = administrativeMetadata.dcterms:created, administrativeMetadata.dcterms:modified
oar.contributorFields = administrativeMetadata.dcterms:creator, descriptiveMetadata.dc:contributor
......@@ -61,12 +65,9 @@ oar.formatFields = administrativeMetadata.dcterms:format
oar.rightsFields = descriptiveMetadata.dc:rights
oar.descriptionFields = descriptiveMetadata.dc:description
oar.relatedIdentifierFields = descriptiveMetadata.dc:relation
oar.relationToWorkObject =
oar.geoLocationFields = descriptiveMetadata.dc:coverage
oar.handle = administrativeMetadata.dcterms:identifier
oar.versionFields =
oar.subjectFields = descriptiveMetadata.dc:subject
oar.sizeField = administrativeMetadata.dcterms:extent
##########################
## Dublin Core Fields ##
......@@ -105,15 +106,15 @@ identifierField = administrativeMetadata.dcterms:identifier
modifiedField = administrativeMetadata.dcterms:modified
searchResponseSize = 100
#######################
### More Settings ###
#######################
#####################
## More Settings ##
#####################
specField = administrativeMetadata.dcterms:relation
specFieldPrefix = hdl:
########################################
### IDIOM Metadata Format Settings ###
########################################
######################################
## IDIOM Metadata Format Settings ##
######################################
idiomResponseSize = 30
###############################################################################
## OAI-PMH Configuration File ##
###############################################################################
##################################
## OAI-PMH Configuration File ##
##################################
RS_ENDPOINT = https://dev.textgridlab.org/1.0/tgoaipmh
......@@ -47,13 +47,17 @@ fields = extent, work.subject, revision, edition.source.bibliographicCitation, e
workFields = created, work.abstract, relations.isDerivedFrom, textgridUri, work.genre, title, work.type, work.spatial.value, work.temporal.spatial, work.agent.value, work.subject.id.value
######################
## OpenAireRecords ###
## OpenAireRecords ##
######################
oar.identifierField = pid.value
oar.titleFields = title, edition.source.bibliographicCitation.editionTitle
oar.dateFields = created, issued, lastModified
oar.contributorFields = dataContributor, project
oar.sizeField = extent
oar.relationToWorkObject = edition.isEditionOf
oar.handle = pid.value
oar.titleFields = title
oar.dateFields = created,issued,lastModified
oar.contributorFields = dataContributor
oar.creatorFields = TODO
oar.languageFields = edition.language
oar.alternateIdentifierFields = textgridUri
......@@ -61,12 +65,9 @@ oar.formatFields = format
oar.rightsFields = edition.license
oar.descriptionFields = work.abstract
oar.relatedIdentifierFields = edition.isEditionOf
oar.relationToWorkObject = edition.isEditionOf
oar.geoLocationFields = edition.source.bibliographicCitation.placeOfPublication
oar.handle = pid.value
oar.versionFields = revision
oar.subjectFields = work.subject
oar.sizeField = extent
##########################
## Dublin Core Fields ##
......@@ -105,16 +106,16 @@ identifierField = textgridUri
modifiedField = lastModified
searchResponseSize = 100
#######################
### More Settings ###
#######################
#####################
## More Settings ##
#####################
specField = project.id
specFieldPrefix = project:
########################################
### IDIOM Metadata Format Settings ###
########################################
######################################
## IDIOM Metadata Format Settings ##
######################################
idiomResponseSize = 30
# NONPUBLIC index only TextGrid IDIOM queries!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment