updates for concepts and labels
This commit is contained in:
parent
213f8ffd91
commit
91fd8a4c1b
11 changed files with 792 additions and 61 deletions
|
@ -108,20 +108,23 @@ public class AgrovocService implements ExternalConceptService {
|
|||
String lang = "";
|
||||
|
||||
for (SKOSLiteral literal : skosConcept.getSKOSRelatedConstantByProperty(dataset, manager.getSKOSDataFactory().getSKOSPrefLabelProperty())) {
|
||||
|
||||
if (!literal.isTyped()) {
|
||||
// if it has language
|
||||
SKOSUntypedLiteral untypedLiteral = literal.getAsSKOSUntypedLiteral();
|
||||
if (untypedLiteral.hasLang()) {
|
||||
lang = untypedLiteral.getLang();
|
||||
} else {
|
||||
lang = "";
|
||||
}
|
||||
}
|
||||
if (lang.equals("en")) {
|
||||
//System.out.println("prefLabel: " + literal.getLiteral());
|
||||
|
||||
concept.setLabel(literal.getLiteral());
|
||||
if(literal != null) {
|
||||
if (!literal.isTyped()) {
|
||||
// if it has language
|
||||
SKOSUntypedLiteral untypedLiteral = literal.getAsSKOSUntypedLiteral();
|
||||
if (untypedLiteral.hasLang()) {
|
||||
lang = untypedLiteral.getLang();
|
||||
} else {
|
||||
lang = "";
|
||||
}
|
||||
}
|
||||
if (lang.equals("en")) {
|
||||
//System.out.println("prefLabel: " + literal.getLiteral());
|
||||
|
||||
concept.setLabel(literal.getLiteral());
|
||||
}
|
||||
} else {
|
||||
logger.debug("Literal returned for preferred label was null and was ignored");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,21 +133,24 @@ public class AgrovocService implements ExternalConceptService {
|
|||
for (SKOSLiteral literal : skosConcept
|
||||
.getSKOSRelatedConstantByProperty(dataset, manager
|
||||
.getSKOSDataFactory().getSKOSAltLabelProperty())) {
|
||||
|
||||
if (!literal.isTyped()) {
|
||||
// if it has language
|
||||
SKOSUntypedLiteral untypedLiteral = literal
|
||||
.getAsSKOSUntypedLiteral();
|
||||
if (untypedLiteral.hasLang()) {
|
||||
lang = untypedLiteral.getLang();
|
||||
} else {
|
||||
lang = "";
|
||||
if(literal != null) {
|
||||
if (!literal.isTyped()) {
|
||||
// if it has language
|
||||
SKOSUntypedLiteral untypedLiteral = literal
|
||||
.getAsSKOSUntypedLiteral();
|
||||
if (untypedLiteral.hasLang()) {
|
||||
lang = untypedLiteral.getLang();
|
||||
} else {
|
||||
lang = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
//System.out.println("literal: "+ literal.getLiteral());
|
||||
if (lang.equals("en")) {
|
||||
//System.out.println("altLabel: " + literal.getLiteral());
|
||||
altLabelList.add(literal.getLiteral());
|
||||
//System.out.println("literal: "+ literal.getLiteral());
|
||||
if (lang.equals("en")) {
|
||||
//System.out.println("altLabel: " + literal.getLiteral());
|
||||
altLabelList.add(literal.getLiteral());
|
||||
}
|
||||
} else {
|
||||
logger.debug("Literal retrieved for altlabel was null and was ignored");
|
||||
}
|
||||
}
|
||||
concept.setAltLabelList(altLabelList);
|
||||
|
|
|
@ -269,20 +269,24 @@ public class LCSHService implements ExternalConceptService {
|
|||
String lang = "";
|
||||
List<String> literalValues = new ArrayList<String>();
|
||||
for (SKOSLiteral literal : skosLiterals) {
|
||||
if (!literal.isTyped()) {
|
||||
// if it has language
|
||||
SKOSUntypedLiteral untypedLiteral = literal
|
||||
.getAsSKOSUntypedLiteral();
|
||||
if (untypedLiteral.hasLang()) {
|
||||
lang = untypedLiteral.getLang();
|
||||
} else {
|
||||
lang = "";
|
||||
if(literal != null) {
|
||||
if (!literal.isTyped()) {
|
||||
// if it has language
|
||||
SKOSUntypedLiteral untypedLiteral = literal
|
||||
.getAsSKOSUntypedLiteral();
|
||||
if (untypedLiteral.hasLang()) {
|
||||
lang = untypedLiteral.getLang();
|
||||
} else {
|
||||
lang = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
// log.debug("literal: "+ literal.getLiteral());
|
||||
if (lang.equals("en")) {
|
||||
log.debug("literal value: " + literal.getLiteral());
|
||||
literalValues.add(literal.getLiteral());
|
||||
// log.debug("literal: "+ literal.getLiteral());
|
||||
if (lang.equals("en")) {
|
||||
log.debug("literal value: " + literal.getLiteral());
|
||||
literalValues.add(literal.getLiteral());
|
||||
}
|
||||
} else {
|
||||
log.debug("Literal returned was null so was ignored");
|
||||
}
|
||||
}
|
||||
return literalValues;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue