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

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


    int count = 0;
    NodeIterator iter;
    iter = model.listObjects();
    while (iter.hasNext())
    {
      iter.nextNode();
      count++;
    }
    Assert.assertEquals(num * num, count);
  }

View Full Code Here


      object[i] = false;
    }
    iter = model.listObjectsOfProperty(predicate[0]);
    while (iter.hasNext())
    {
      final Literal l = (Literal) iter.nextNode();
      final int i = l.getInt();
      object[i] = true;
    }
    for (int i = 0; i < (num * num); i++)
    {
View Full Code Here

    }

    iter = model.listObjectsOfProperty(subj, RDF.value);
    while (iter.hasNext())
    {
      final int i = ((Literal) iter.nextNode()).getInt();
      object[i] = true;
    }
    for (int i = 0; i < (num); i++)
    {
      Assert.assertTrue(object[i]);
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

                    m.add( a, p, b );
                    m.add( a, p, l );
                    NodeIterator ni = a.listPropertyValues( p );

                    while (ni.hasNext()) {
                        RDFNode n = ni.nextNode();
                        if (n.isResource()) {
                            assertEquals( b, n );
                            assertTrue( "Return value should be an OntResource", n instanceof OntResource );
                        }
                    }
View Full Code Here

  public Set<IDoapCategory> getAll() throws SimalRepositoryException {
    Model model = ((JenaSimalRepository) getRepository()).getModel();
      NodeIterator itr = model.listObjectsOfProperty(Doap.CATEGORY);
      Set<IDoapCategory> categories = new HashSet<IDoapCategory>();
      while (itr.hasNext()) {
        String uri = itr.nextNode().toString();
        categories.add(new Category(model.getResource(uri)));
      }
      return categories;
  }
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.