Package com.hp.hpl.jena.util.iterator

Examples of com.hp.hpl.jena.util.iterator.ExtendedIterator


    return subsumers;
  }
 
  protected MultiValueMap<ATermAppl, ATermAppl> getSubsumptions(Graph graph) {
    MultiValueMap<ATermAppl, ATermAppl> subsumers = new MultiValueMap<ATermAppl, ATermAppl>();
    ExtendedIterator it = graph.find(Node.ANY, PRED_SUB, Node.ANY);
    while (it.hasNext()) {
      Triple tri = (Triple) it.next();
      Node sub = tri.getSubject();
      Node sup = tri.getObject();
      if (NameStore.isAnon(sub) || NameStore.isAnon(sup)) continue;
     
      subsumers.add(toATermAppl(sub), toATermAppl(sup));
    }
    it.close();
   
    return subsumers;
  }
View Full Code Here


    // cause timeout exceptions nearly all the time
    timers.mainTimer.restart();

    try {
      // run a simple query using Jena interface
      ExtendedIterator results = model.listIndividuals( cls );
     
      // print if the query succeeded
      int size = results.toList().size();
      System.out.print( "completed in " + timers.mainTimer.getElapsed() + "ms" );
      System.out.println(" (" + size + " results)" );
    } catch( TimeoutException e ) {
      System.out.println( "interrupted after " + timers.mainTimer.getElapsed() + "ms" );
    }
View Full Code Here

    Graph entailmentsGraph = entailments.getGraph();
    PelletInfGraph pellet = (PelletInfGraph) model.getGraph();

    GraphLoader savedLoader = pellet.attachTemporaryGraph( entailmentsGraph );

    ExtendedIterator i = entailmentsGraph.find( Triple.ANY );
   
    while( i.hasNext() ) {
      Triple triple = (Triple) i.next();
      if( !pellet.entails( triple ) ) {
        assertFalse( "Entailment failed for " + triple, positiveEntailment );
        return;       
      }
    }
View Full Code Here

    return subsumers;
  }
 
  protected MultiValueMap<ATermAppl, ATermAppl> getSubsumptions(Graph graph) {
    MultiValueMap<ATermAppl, ATermAppl> subsumers = new MultiValueMap<ATermAppl, ATermAppl>();
    ExtendedIterator it = graph.find(Node.ANY, PRED_SUB, Node.ANY);
    while (it.hasNext()) {
      Triple tri = (Triple) it.next();
      Node sub = tri.getSubject();
      Node sup = tri.getObject();
      if (NameStore.isAnon(sub) || NameStore.isAnon(sup)) continue;
     
      subsumers.add(toATermAppl(sub), toATermAppl(sup));
    }
    it.close();
   
    return subsumers;
  }
View Full Code Here

    Graph entailmentsGraph = entailments.getGraph();
    PelletInfGraph pellet = (PelletInfGraph) model.getGraph();

    GraphLoader savedLoader = pellet.attachTemporaryGraph( entailmentsGraph );

    ExtendedIterator i = entailmentsGraph.find( Triple.ANY );
   
    while( i.hasNext() ) {
      Triple triple = (Triple) i.next();
      if( !pellet.entails( triple ) ) {
        assertFalse( "Entailment failed for " + triple, positiveEntailment );
        return;       
      }
    }
View Full Code Here

  graph.getTransactionHandler().commit();
  System.out.println("commit Transaction.");
  System.out.println("graph.isEmpty() = " + graph.isEmpty());
  System.out.println("graph.getCount() = " + graph.getCount());

  ExtendedIterator iter = graph.find(Node.ANY, Node.ANY, Node.ANY);
  System.out.println ("\ngraph.find(Node.ANY, Node.ANY, Node.ANY) \nResult:");
  for ( ; iter.hasNext() ; )
      System.out.println ((Triple) iter.next());

  graph.clear ();
  System.out.println("\nCLEAR graph <Example6>");
  System.out.println("graph.isEmpty() = " + graph.isEmpty());

  System.out.println("Add 1 triples to graph <Example6>.");
  graph.add(new Triple(foo1, bar1, baz1));

  System.out.println("\nStart test Transaction Abort.");
  graph.getTransactionHandler().begin();
  System.out.println("begin Transaction.");
  System.out.println("Add 2 triples to graph <Example6>.");

  graph.add(new Triple(foo2, bar2, baz2));
  graph.add(new Triple(foo3, bar3, baz3));

  graph.getTransactionHandler().abort();
  System.out.println("abort Transaction.");
  System.out.println("End test Transaction Abort.\n");

  System.out.println("graph.isEmpty() = " + graph.isEmpty());
  System.out.println("graph.getCount() = " + graph.getCount());

  iter = graph.find(Node.ANY, Node.ANY, Node.ANY);
  System.out.println ("\ngraph.find(Node.ANY, Node.ANY, Node.ANY) \nResult:");
  for ( ; iter.hasNext() ; )
      System.out.println ((Triple) iter.next());

  graph.clear ();
  System.out.println("\nCLEAR graph <Example6>");

    }
View Full Code Here

  graph.getTransactionHandler().commit();
  System.out.println("commit Transaction.");
  System.out.println("graph.isEmpty() = " + graph.isEmpty());
  System.out.println("graph.getCount() = " + graph.getCount());

  ExtendedIterator iter = graph.find(Node.ANY, Node.ANY, Node.ANY);
  System.out.println ("\ngraph.find(Node.ANY, Node.ANY, Node.ANY) \nResult:");
  for ( ; iter.hasNext() ; )
      System.out.println ((Triple) iter.next());

  graph.clear ();
  System.out.println("\nCLEAR graph <Example6>");
  System.out.println("graph.isEmpty() = " + graph.isEmpty());

  System.out.println("Add 1 triples to graph <Example6>.");
  graph.add(new Triple(foo1, bar1, baz1));

  System.out.println("test Transaction Abort.");
  graph.getTransactionHandler().begin();
  System.out.println("begin Transaction.");
  System.out.println("Add 2 triples to graph <Example6>.");

  graph.add(new Triple(foo2, bar2, baz2));
  graph.add(new Triple(foo3, bar3, baz3));

  graph.getTransactionHandler().abort();
  System.out.println("abort Transaction.");
  System.out.println("graph.isEmpty() = " + graph.isEmpty());
  System.out.println("graph.getCount() = " + graph.getCount());

  iter = graph.find(Node.ANY, Node.ANY, Node.ANY);
  System.out.println ("\ngraph.find(Node.ANY, Node.ANY, Node.ANY) \nResult:");
  for ( ; iter.hasNext() ; )
      System.out.println ((Triple) iter.next());

  graph.clear ();
  System.out.println("\nCLEAR graph <Example6>");

    }
View Full Code Here

  graph.add(new Triple(foo1, bar3, baz3));

  System.out.println("graph.isEmpty() = " + graph.isEmpty());
  System.out.println("graph.getCount() = " + graph.getCount());

  ExtendedIterator iter = graph.find(foo1, Node.ANY, Node.ANY);
  System.out.println ("\ngraph.find(foo1, Node.ANY, Node.ANY) \nResult:");
  for ( ; iter.hasNext() ; )
      System.out.println ((Triple) iter.next());

  iter = graph.find(Node.ANY, Node.ANY, baz3);
  System.out.println ("\ngraph.find(Node.ANY, Node.ANY, baz3) \nResult:");
  for ( ; iter.hasNext() ; )
      System.out.println ((Triple) iter.next());

  iter = graph.find(foo1, Node.ANY, baz3);
  System.out.println ("\ngraph.find(foo1, Node.ANY, baz3) \nResult:");
  for ( ; iter.hasNext() ; )
      System.out.println ((Triple) iter.next());

  graph.clear ();

    }
View Full Code Here

  graph.getBulkUpdateHandler().add(triples1);

  System.out.println("graph.isEmpty() = " + graph.isEmpty());
  System.out.println("graph.getCount() = " + graph.getCount());

  ExtendedIterator iter = graph.find(Node.ANY, Node.ANY, Node.ANY);
  System.out.println ("\ngraph.find(Node.ANY, Node.ANY, Node.ANY) \nResult:");
  for ( ; iter.hasNext() ; )
      System.out.println ((Triple) iter.next());


  System.out.println("\n\nDelete List of 2 triples from graph <Example7> via BulkUpdateHandler.");

  graph.getBulkUpdateHandler().delete(triples2);

  System.out.println("graph.isEmpty() = " + graph.isEmpty());
  System.out.println("graph.getCount() = " + graph.getCount());

  iter = graph.find(Node.ANY, Node.ANY, Node.ANY);
  System.out.println ("\ngraph.find(Node.ANY, Node.ANY, Node.ANY) \nResult:");
  for ( ; iter.hasNext() ; )
      System.out.println ((Triple) iter.next());

  graph.clear ();
  System.out.println("\nCLEAR graph <Example7>");

    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.util.iterator.ExtendedIterator

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.