Package com.hp.hpl.jena.query.engine

Examples of com.hp.hpl.jena.query.engine.QueryIterator


   
    map.addTriple(Triple.create("?paul http://xmlns.com/foaf/0.1/name 'Paul\\sShabajee'"));
    map.addTriple(Triple.create("?paul http://jena.hpl.hp.com/schemas/hpcorp#manager ?manager"));
    map.addTriple(Triple.create("?manager http://xmlns.com/foaf/0.1/name ?name"));
   
    QueryIterator results = new QueryIterSingleton(new BindingRoot());
   
    results = map.execute(results, null);
   
    assertTrue("I have a manager for Paul", results.hasNext());
   
    Binding binding = results.nextBinding();
   
    assertEquals("I have the right manager for Paul", Node.createLiteral("Martin John Merry"), binding.get("name"));
  }
View Full Code Here


   
    map.addTriple(Triple.create("?person http://xmlns.com/foaf/0.1/mbox mailto:martin.merry@hp.com"));
    map.addTriple(Triple.create("?underling http://jena.hpl.hp.com/schemas/hpcorp#manager ?person"));
    map.addTriple(Triple.create("?underling http://xmlns.com/foaf/0.1/name ?name"));
   
    QueryIterator results = new QueryIterSingleton(new BindingRoot());
   
    results = map.execute(results, null);
   
    assertTrue("I got a result", results.hasNext());
   
    while (results.hasNext())
    {
      Binding nextBinding = results.nextBinding();
      log.info("Name: " + nextBinding.get("name"));
    }
  }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.query.engine.QueryIterator

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.