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

com.ontology2.bakemono.primitiveTriples.PrimitiveTriplePredicateRewriter Maven / Gradle / Ivy

There is a newer version: 3.2
Show newest version
package com.ontology2.bakemono.primitiveTriples;

import com.google.common.base.Function;
import com.hp.hpl.jena.rdf.model.Model;

public class PrimitiveTriplePredicateRewriter implements Function {
    private final String from;
    private final String to;

    public PrimitiveTriplePredicateRewriter(String from, String to) {
        this.from = from;
        this.to = to;
    }

    public PrimitiveTriple apply(PrimitiveTriple obj)  {
        if(from.equals(obj.getPredicate())) {
            return new PrimitiveTriple(
                    obj.getSubject(),
                    to,
                    obj.getObject()	
                    );
        } else {
            return obj;
        }	
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy