org.nlp2rdf.model.ModelMergeManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nif Show documentation
Show all versions of nif Show documentation
A small library for NLP Interchange Format (NIF) — Edit
The newest version!
package org.nlp2rdf.model;
import org.apache.jena.rdf.model.*;
public class ModelMergeManager {
public static void removeDuplicatedValues(Model model, Resource resource, String propertyName, String mention) {
Property property = model.createProperty(propertyName);
NodeIterator iterator = model.listObjectsOfProperty(property);
while (iterator.hasNext()) {
RDFNode node = iterator.next();
if (node.toString().contains(mention)) {
model.removeAll(resource, property, node);
}
}
}
}