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

com.ontology2.rdf.TripleEconomizer Maven / Gradle / Ivy

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

import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;

public class TripleEconomizer implements Economizer {

    private final Economizer innerEconomizer;

    public TripleEconomizer(Economizer innerEconomizer) {
        this.innerEconomizer=innerEconomizer;
    }

    public TripleEconomizer() {
        this(new CacheEconomizer());
    }

    private Node e(Node n) {
        return innerEconomizer.economize(n);
    }

    @Override
    public Triple economize(Triple that) {
        return new Triple(
                e(that.getSubject()),
                e(that.getPredicate()),
                e(that.getObject())
                );
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy