Package uk.ac.osswatch.simal.model.jena

Examples of uk.ac.osswatch.simal.model.jena.Category


    Property o = Doap.CATEGORY;
    com.hp.hpl.jena.rdf.model.Resource r = model.createResource(uri);
    Statement s = model.createStatement(r, RDF.type, o);
    model.add(s);

    IDoapCategory cat = new Category(r);
    cat.setSimalID(getNewID());
    return cat;
  }
View Full Code Here


    IDoapCategory category = null;
    while (results.hasNext()) {
      QuerySolution soln = results.nextSolution();
      RDFNode node = soln.get("category");
      if (node.isResource()) {
        category = new Category(
            (com.hp.hpl.jena.rdf.model.Resource) node);
      }
    }
    qe.close();
View Full Code Here

  }

  public IDoapCategory get(String uri) throws SimalRepositoryException {
    if (getRepository().containsResource(uri)) {
      Model model = ((JenaSimalRepository) getRepository()).getModel();
      return new Category(model.getResource(uri));
    } else {
      return null;
    }
  }
View Full Code Here

    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

Related Classes of uk.ac.osswatch.simal.model.jena.Category

Copyright © 2018 www.massapicom. 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.