All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nlp2rdf.model.ModelMergeManager Maven / Gradle / Ivy

There is a newer version: 0.4.1
Show newest version
package org.nlp2rdf.model;


import com.hp.hpl.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);
            }
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy