Package com.hp.hpl.jena.reasoner

Examples of com.hp.hpl.jena.reasoner.TriplePattern


    public void testEquivalencesSimple() {
        TransitiveGraphCache cache = new TransitiveGraphCache(directP, closedP);
        cache.addRelation(new Triple(a, closedP, b));
        cache.addRelation(new Triple(b, closedP, a));
        TestUtil.assertIteratorValues(this,
                cache.find(new TriplePattern(null, closedP, null)),
                new Object[] {
                new Triple(a, closedP, b),
                new Triple(b, closedP, a),
                new Triple(b, closedP, b),
                new Triple(a, closedP, a),
        });
        TestUtil.assertIteratorLength( cache.find(new TriplePattern(null, closedP, null)), 4);
    }
View Full Code Here


        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)));
    }
View Full Code Here

  private Triple makeSubOfSomeFact(ATermAppl t1, ATermAppl t2, ATermAppl t3) {
    return Triple.create(m_Names.get( t1 ), m_Names.get( t2 ), m_Names.get( t3 ));
  }
 
  private TriplePattern makeSubclassTriple(Node t1, Node t2) {
    return new TriplePattern(t1, PRED_SUB, t2);
  }
View Full Code Here

  private TriplePattern makeSubOfSomeTriple(Node t1, ATermAppl p, Node t2) {
    return makeSubOfSomeTriple(t1, m_Names.get(p), t2);
  }
 
  private TriplePattern makeSubOfSomeTriple(Node t1, Node p, Node t2) {
    return new TriplePattern(t1, p, t2);
  }
View Full Code Here

    ExtendedIterator<Triple> i = GraphQueryHandler.findTriple( kb, this, subject, predicate, object );

    // always look at asserted triples at the end
    if( finder != null ) {
      TriplePattern tp = new TriplePattern( subject, predicate, object );
      i = i.andThen( finder.find( tp ) );
    }

    // make sure we don't have duplicates
    return UniqueExtendedIterator.create( i );
View Full Code Here

    ExtendedIterator<Triple> i = GraphQueryHandler.findTriple( kb, loader, subject, predicate, object );

    // always look at asserted triples at the end
    if( finder != null ) {
      TriplePattern tp = new TriplePattern( subject, predicate, object );
      i = i.andThen( finder.find( tp ) );
    }

    // make sure we don't have duplicates
    return UniqueExtendedIterator.create( i );
View Full Code Here

  private Triple makeSubOfSomeFact(ATermAppl t1, ATermAppl t2, ATermAppl t3) {
    return Triple.create(m_Names.get( t1 ), m_Names.get( t2 ), m_Names.get( t3 ));
  }
 
  private TriplePattern makeSubclassTriple(Node t1, Node t2) {
    return new TriplePattern(t1, PRED_SUB, t2);
  }
View Full Code Here

  private TriplePattern makeSubOfSomeTriple(Node t1, ATermAppl p, Node t2) {
    return makeSubOfSomeTriple(t1, m_Names.get(p), t2);
  }
 
  private TriplePattern makeSubOfSomeTriple(Node t1, Node p, Node t2) {
    return new TriplePattern(t1, p, t2);
  }
View Full Code Here

        object = object.substring(1, object.length()-1);
      }
      classNode = Node_RuleVariable.createURI(object);
    }
   
    ClauseEntry clauseEntry = new TriplePattern(argumnetNode, Node_RuleVariable.createURI(RDF.type.getURI()), classNode);
    return new JenaClauseEntryImpl(clauseEntry, jenaVariableMap);
  }
View Full Code Here

        predicate = predicate.substring(1, predicate.length()-1);
      }
      predicateNode = Node_RuleVariable.createURI(predicate);
    }
   
    ClauseEntry clauseEntry = new TriplePattern(subjectNode, predicateNode, objectNode);
    return new JenaClauseEntryImpl(clauseEntry, jenaVariableMap);
  }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.reasoner.TriplePattern

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.