remove only langtag literals (#349)

This commit is contained in:
Georgy Litvinov 2022-11-23 09:38:27 +01:00 committed by GitHub
parent 57d93285ff
commit 4acb10fc3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,6 +50,7 @@ public class ProcessRdfForm {
private EditN3GeneratorVTwo populator; private EditN3GeneratorVTwo populator;
private Map<String,String> urisForNewResources = null; private Map<String,String> urisForNewResources = null;
private static final String langStringDatatypeUri = RDF.dtLangString.getURI();
// private VitroRequest _vreq; // private VitroRequest _vreq;
/** /**
* Construct the ProcessRdfForm object. * Construct the ProcessRdfForm object.
@ -368,7 +369,8 @@ public class ProcessRdfForm {
if (obj.isLiteral()) { if (obj.isLiteral()) {
Literal lit = obj.asLiteral(); Literal lit = obj.asLiteral();
String lang = lit.getLanguage(); String lang = lit.getLanguage();
if (! linguisticContext.equals(lang)) { if (langStringDatatypeUri.equals(lit.getDatatypeURI()) &&
! linguisticContext.equals(lang)) {
//UQAM Remove if linguisticContext != lang of the Literal //UQAM Remove if linguisticContext != lang of the Literal
model.remove(subj, pred, obj); model.remove(subj, pred, obj);
} }