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 (int i = 0; i < num; i += 1)
    {
      it.nextNode();
      if (retain[i] == 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

    final List<RDFNode> retained = new ArrayList<RDFNode>();
    //
    final NodeIterator nIter = seq.iterator();
    for (int i = 0; i < num; i += 1)
    {
      final RDFNode x = nIter.nextNode();
      if (retain[i])
      {
        retained.add(x);
      }
      else
View Full Code Here

        Property resultVariable = modelStreamed.getProperty("http://www.w3.org/2001/sw/DataAccess/tests/result-set#variable");
        Property resultValue = modelStreamed.getProperty("http://www.w3.org/2001/sw/DataAccess/tests/result-set#value");
       
        NodeIterator nodeIt = modelStreamed.listObjectsOfProperty(resultVariable);
        while (nodeIt.hasNext()) {
      RDFNode node = (RDFNode) nodeIt.nextNode();
      if(node.isLiteral()){
        System.out.println(node.toString());
        System.out.println(modelStreamed.listSubjectsWithProperty(resultVariable, node).nextResource().getURI());
      }
     
View Full Code Here

        .getProperty("http://www.w3.org/2001/sw/DataAccess/tests/result-set#value");

    NodeIterator nodeIt = modelStreamed
        .listObjectsOfProperty(resultVariable);
    while (nodeIt.hasNext()) {
      RDFNode node = (RDFNode) nodeIt.nextNode();
      if (node.isLiteral()) {
        LOG.debug(node.toString());
        LOG.debug(modelStreamed.listSubjectsWithProperty(
            resultVariable, node).nextResource().getURI());
      }
View Full Code Here

    final List<RDFNode> retained = new ArrayList<>();
    //
    final NodeIterator nIter = seq.iterator();
        for ( boolean aRetain : retain )
        {
            final RDFNode x = nIter.nextNode();
            if ( aRetain )
            {
                retained.add( x );
            }
            else
View Full Code Here

  protected void checkNumericContent( final Container cont2, final int num )
  {
    final NodeIterator nit = cont2.iterator();
    for (int i = 0; i < num; i += 1)
    {
      Assert.assertEquals(i, ((Literal) nit.nextNode()).getInt());
    }
    Assert.assertFalse(nit.hasNext());
  }

  protected void retainOnlySpecified( final Container cont2, final int num,
View Full Code Here

      final boolean[] retain )
  {
    final NodeIterator nit = cont2.iterator();
    for (int i = 0; i < num; i++)
    {
      nit.nextNode();
      if (retain[i] == false)
      {
        nit.remove();
      }
    }
View Full Code Here

  protected void seeWhatsThere( final Container cont2, final boolean[] found )
  {
    final NodeIterator nit = cont2.iterator();
    while (nit.hasNext())
    {
      final int v = ((Literal) nit.nextNode()).getInt();
      Assert.assertFalse(found[v]);
      found[v] = true;
    }
  }
View Full Code Here

    }
    Assert.assertEquals(num, c.size());
    final NodeIterator it = c.iterator();
    for (int i = 0; i < num; i += 1)
    {
      Assert.assertEquals(i, ((Literal) it.nextNode()).getInt());
    }
    Assert.assertFalse(it.hasNext());
  }

  public void testContainerOfIntegersRemovingA()
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.