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

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()


   
    iters = model.listSubjectsWithProperty(RDF.type);
    if (iters.hasNext()) {
        System.out.println("The database contains RDF.type for:");
        while (iters.hasNext()) {
          Resource resource = iters.nextResource();
          NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
          String resourceName = null;
          if(resource.getLocalName() != null) {
            resourceName = resource.getLocalName();
          } else if(resource.getId() != null) {
View Full Code Here


        Iterator<WDSingleTest> it = tests.iterator();
        while (it.hasNext())
          it.next().exec(earl);
        ResIterator rit = earl.listSubjectsWithProperty(RDF.type, EARL.Assertion);
    while (rit.hasNext())
      rit.nextResource().
         addProperty(EARL.assertedBy,assertor)
         .addProperty(EARL.subject, system);
  }
}
View Full Code Here

    boolean found = false;
    final ResIterator rIter = model.listSubjects();
    while (rIter.hasNext())
    {
      final Resource subj = rIter.nextResource();
      found = false;
      for (int i = 0; i < num; i++)
      {
        if (subj.equals(subject[i]))
        {
View Full Code Here

      // Find the bNode that will be rewritten
      final Property name = incoming.createProperty(
          "http://xmlns.com/foaf/0.1/", "name");
      final ResIterator ri = incoming.listSubjectsWithProperty(name,
          "Ian Dickinson");
      final Resource bNode = ri.nextResource();
      ri.close();

      // Rewrite it to ground form
      final int originalCount = bNode.listProperties().toList().size();
      final Resource newR = incoming
View Full Code Here

        }

    protected void writeRDFStatements( Model model, PrintWriter writer )
        {
    ResIterator rIter = model.listSubjects();
    while (rIter.hasNext()) writeRDFStatements( model, rIter.nextResource(), writer );
    }

  protected void writeRDFTrailer( PrintWriter writer, String base )
        { writer.println( "</" + rdfEl( "RDF" ) + ">" ); }
View Full Code Here

    Resource entity = ResourceFactory.createResource(
        riNamespace + "Entity");
    ResIterator iters = model.listSubjectsWithProperty(
        RDF.type,entity);
    while (iters.hasNext()) {
      Resource resource = iters.nextResource();
      Entity entityIns = getEntity(model,resource,null);
      if(!validate || ValidateModel.validateEntity(entityIns)) {
        entities.add(entityIns);
      } else {
        ModelException.sendMessage(ModelException.WARNING,"entity(" +
View Full Code Here

    Resource community = ResourceFactory.createResource(
        riNamespace + "Community");
    ResIterator iters = model.listSubjectsWithProperty(
        RDF.type,community);
    while (iters.hasNext()) {
      Resource resource = iters.nextResource();
      Community communityIns = getCommunity(model,resource);
      if(!validate || ValidateModel.validateCommunity(communityIns)) {
        communities.add(communityIns);
      } else {
        ModelException.sendMessage(ModelException.WARNING,"community(" +
View Full Code Here

        RDF.type,reputationImporter);
    if (iters.hasNext()) {
        System.out.println("The database contains subjects" +
            " of type reputationImporter:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getLocalName());
            ReputationAlgorithmImplementation repImpInstance =
              getReputationImporter(model,resource);
            System.out.println(repImpInstance.toString("     "));
        }
View Full Code Here

        RDF.type,importationUnit);
    if (iters.hasNext()) {
        System.out.println("The database contains subjects" +
            " of type ImportationUnit:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getLocalName());
            ImportationUnit impUniInstance =
              getImportationUnit(model,resource);           
            System.out.println(impUniInstance.toString("     "));
        }
View Full Code Here

        RDF.type,metricMapping);
    if (iters.hasNext()) {
        System.out.println("The database contains subjects" +
            " of type MetricMappings:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getLocalName());
            MetricMapping metMapInstance =
              getMetricMapping(model,resource);
            System.out.println(metMapInstance.toString("     "));           
        }
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.