Search in sources :

Example 11 with TransitiveGraphCache

use of org.apache.jena.reasoner.transitiveReasoner.TransitiveGraphCache in project jena by apache.

the class TestTransitiveGraphCache method testEquivalences.

/**
     * Test equivalences case
     */
public void testEquivalences() {
    TransitiveGraphCache cache = new TransitiveGraphCache(directP, closedP);
    cache.addRelation(new Triple(a, closedP, b));
    cache.addRelation(new Triple(b, closedP, a));
    cache.addRelation(new Triple(c, closedP, d));
    cache.addRelation(new Triple(d, closedP, c));
    cache.addRelation(new Triple(b, closedP, d));
    cache.addRelation(new Triple(d, closedP, b));
    assertTrue("Test eq", cache.contains(new TriplePattern(a, closedP, d)));
}
Also used : Triple(org.apache.jena.graph.Triple) TriplePattern(org.apache.jena.reasoner.TriplePattern) TransitiveGraphCache(org.apache.jena.reasoner.transitiveReasoner.TransitiveGraphCache)

Aggregations

Triple (org.apache.jena.graph.Triple)11 TransitiveGraphCache (org.apache.jena.reasoner.transitiveReasoner.TransitiveGraphCache)11 TriplePattern (org.apache.jena.reasoner.TriplePattern)9