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

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


        Container resourceBag = (Container) resource;
        NodeIterator nodeI = resourceBag.iterator();
        //OntResource resourceBag = (OntResource) resource;
        //NodeIterator nodeI = resourceBag.listPropertyValues(null);
        while(nodeI.hasNext()) {
          RDFNode node = nodeI.nextNode();
          System.out.println("   node to check:" + node);               
          if(node.isResource()) {
            NodeIterator nodess = model.listObjectsOfProperty((Resource)node,null);
            while(nodess.hasNext()) {
              RDFNode profile = nodess.nextNode();
View Full Code Here


          RDFNode node = nodeI.nextNode();
          System.out.println("   node to check:" + node);               
          if(node.isResource()) {
            NodeIterator nodess = model.listObjectsOfProperty((Resource)node,null);
            while(nodess.hasNext()) {
              RDFNode profile = nodess.nextNode();
              System.out.println("     " + profile);               
            }
          }           
          //System.out.println("   triple "+statement.getPredicate()+" - "+statement.getObject());
        }
View Full Code Here

              resourceName = resource.getURI();
            }
            System.out.println("  " + resourceName+" class:"+resource.getClass());
            NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
            while(nodes.hasNext()) {
              RDFNode node = nodes.nextNode();
              if(node.isResource()) {
                System.out.println("   type " + node.asResource().getURI());
              }
            }
            StmtIterator stmtI = model.listStatements(resource, null, (RDFNode)null);
View Full Code Here

    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

    }
    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.