Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.NodeIterator.nextNode()


      c.add(i);
    }
    final NodeIterator it = c.iterator();
        for ( boolean aRetain : retain )
        {
            it.nextNode();
            if ( aRetain == false )
            {
                it.remove();
            }
        }
View Full Code Here


            }
        }
    final NodeIterator s = c.iterator();
    while (s.hasNext())
    {
      final int v = ((Literal) s.nextNode()).getInt();
      Assert.assertFalse(found[v]);
      found[v] = true;
    }
    for (int i = 0; i < num; i += 1)
    {
View Full Code Here

    MultiPartBody body = (MultiPartBody) request.getBody();
    NodeIterator objects = importing.listObjects();
    Map uploadedFiles = null;
    Set processingRes = new HashSet();
    while (objects.hasNext()) {
      RDFNode currentNode = objects.nextNode();
      if (currentNode instanceof Resource) {
        Resource current = (Resource) currentNode;
        if (!current.isAnon()
            && current.getURI().startsWith("formfile:")) {
          if (uploadedFiles == null) {
View Full Code Here

          return null;
        }

        NodeIterator it = s_i.listPropertyValues(p_p);
        while (it.hasNext()) {
          RDFNode node = it.nextNode();
          if (node.isLiteral()
              && OntologyElement.LITERAL.equals(qr.getType())) {
            qr.add(wrap((Literal) node));
          } else if (node.canAs(Individual.class)
              && OntologyElement.INDIVIDUAL.equals(qr.getType())) {
View Full Code Here

    }
    String uriPrefix = baseURI + '#';
    NodeIterator nodes = resultModel.listObjects();
    Set<Resource> expandingURIs = new HashSet<Resource>();
    while (nodes.hasNext()) {
      RDFNode current = nodes.nextNode();
      if (!(current instanceof Resource)) {
        continue;
      }
      if (((Resource) current).isAnon()) {
        continue;
View Full Code Here

  private void removeTree(Resource resource, Model removedModel) {
    Model resourceExpansion = JenaUtil.getExpandedResource(resource, 7);
    saveRemove(resource, removedModel);
    NodeIterator objects = resourceExpansion.listObjects();
    OUTER: while (objects.hasNext()) {
      RDFNode current = objects.nextNode();
      if (!(current instanceof Resource)) {
        continue;
      }
      StmtIterator stmts = model.listStatements(null, null, current);
      while (stmts.hasNext()) {
View Full Code Here

       
        IndexLARQ index = b.getIndex() ;
        NodeIterator nIter = index.searchModelByIndex("foo") ;
        assertEquals(1, TestLARQUtils.count(nIter)) ;
        nIter = index.searchModelByIndex("foo") ;
        Resource r2 = (Resource)nIter.nextNode() ;
        assertEquals(r, r2) ;
    }
   
    @Test public void test_ext_2()
    {
View Full Code Here

       
        IndexLARQ index = b.getIndex() ;
        NodeIterator nIter = index.searchModelByIndex("foo") ;
        assertEquals(1, TestLARQUtils.count(nIter)) ;
        nIter = index.searchModelByIndex("foo") ;
        Literal lit2 = (Literal)nIter.nextNode() ;
        assertEquals(lit, lit2) ;
    }

    @Test public void test_ext_3()
    {
View Full Code Here

       
        IndexLARQ index = b.getIndex() ;
        NodeIterator nIter = index.searchModelByIndex("foo") ;
        assertEquals(1, TestLARQUtils.count(nIter)) ;
        nIter = index.searchModelByIndex("foo") ;
        Resource bnode2 = (Resource)nIter.nextNode() ;
        assertEquals(bnode, bnode2) ;
        assertTrue(bnode2.isAnon()) ;
    }

    @Test public void test_ext_4()
View Full Code Here

       
        IndexLARQ index = b.getIndex() ;
        NodeIterator nIter = index.searchModelByIndex("foo") ;
        assertEquals(1, TestLARQUtils.count(nIter)) ;
        nIter = index.searchModelByIndex("foo") ;
        Resource r2 = (Resource)nIter.nextNode() ;
        assertEquals(r, r2) ;
    }
   
    // Test what happens when the index is updated after a reader index (LARQIndex) is created
    @Test public void test_ext_6()
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.