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

Examples of com.hp.hpl.jena.rdf.model.ResIterator


     *            Unique reference for which the {@link ObjectProperty} is requested.
     * @return {@link ObjectProperty} instance if there is a valid one, otherwise <code>null</code>.
     */
    public ObjectProperty getObjectPropertyByReference(String reference) throws UnsupportedPolymorphismException,
                                                                        ConversionException {
        ResIterator it = ontModel.listResourcesWithProperty(CMSAdapterVocabulary.CMSAD_RESOURCE_REF_PROP,
            reference);
        Resource resource;
        if (it.hasNext()) {
            resource = it.next();
            return resource.as(ObjectProperty.class);
        }
        return null;
    }
View Full Code Here


     *            Unique reference for which the {@link DatatypeProperty} is requested.
     * @return {@link DatatypeProperty} instance if there is a valid one, otherwise <code>null</code>.
     */
    public DatatypeProperty getDatatypePropertyByReference(String reference) throws UnsupportedPolymorphismException,
                                                                            ConversionException {
        ResIterator it = ontModel.listResourcesWithProperty(CMSAdapterVocabulary.CMSAD_RESOURCE_REF_PROP,
            reference);
        Resource resource;
        if (it.hasNext()) {
            resource = it.next();
            return resource.as(DatatypeProperty.class);
        }
        return null;
    }
View Full Code Here

     *            Unique reference for which {@link Individual} is requested.
     * @return {@link Individual} instance if there is a valid one, otherwise <code>null</code>
     */
    public Individual getLooseIndividualByReference(String reference) throws UnsupportedPolymorphismException,
                                                                     ConversionException {
        ResIterator it = ontModel.listResourcesWithProperty(CMSAdapterVocabulary.CMSAD_RESOURCE_REF_PROP,
            reference);
        Resource resource;
        if (it.hasNext()) {
            resource = it.next();
            return resource.as(Individual.class);
        }
        return null;
    }
View Full Code Here

 
  public List<Entity> getEntities(boolean validate) throws Exception {
    List<Entity> entities = new ArrayList<Entity>();
    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

 
  public List<Community> getCommunities(boolean validate) throws Exception {
    List<Community> communities = new ArrayList<Community>();
    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

 
 
  public void printReputationImporters(Model model) throws Exception {
    Resource reputationImporter = ResourceFactory.
        createResource(riNamespace + "ReputationImporter");
    ResIterator iters = model.listSubjectsWithProperty(
        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

  }
 
  public void printImportationUnits(Model model) throws Exception {
    Resource importationUnit = ResourceFactory.
        createResource(riNamespace + "ImportationUnit");
    ResIterator iters = model.listSubjectsWithProperty(
        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

  }
 
  public void printMetricMappings(Model model) throws Exception {
    Resource metricMapping = ResourceFactory.
        createResource(riNamespace + "MetricMapping");
    ResIterator iters = model.listSubjectsWithProperty(
        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

 
  public List<Metric> getMetrics(boolean validate) throws Exception {
    List<Metric> metrics = new ArrayList<Metric>();
    Resource metric = ResourceFactory.createResource(
        riNamespace + "Metric");
    ResIterator iters = model.listSubjectsWithProperty(
        RDF.type,metric);
    while (iters.hasNext()) {
      Resource resource = iters.nextResource();
      Metric metricIns = getMetric(model, resource);
      if(!validate || ValidateModel.validateMetric(metricIns)) {
        metrics.add(metricIns);
      } else {
        ModelException.sendMessage(ModelException.WARNING,"entity(" +
View Full Code Here

  }
 
  public void printMetrics(Model model) throws Exception {
    Resource metric = ResourceFactory.
        createResource(riNamespace + "Metric");
    ResIterator iters = model.listSubjectsWithProperty(
        RDF.type,metric);
    if (iters.hasNext()) {
        System.out.println("The database contains subjects" +
            " of type metric:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getLocalName());
            Metric metricInstance =
              getMetric(model,resource);
            System.out.println(metricInstance.toString("     "));           
        }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.ResIterator

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.