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

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


    this.input = m;
    this.repair = report;
    this.output = this.input;
   
   
      ResIterator it = repair.listSubjectsWithProperty( EYE.unknownPredicate );
      while ( it.hasNext() )
        {
        Resource curr = it.nextResource();
        NodeIterator it2 = repair.listObjectsOfProperty( curr, EYE.newValue );
       
        if ( it2.hasNext() )
          {
          // Replace all instances of statement predicate curr in input with replacement
View Full Code Here


  public void analyse( Report r, Model m, Model config )
      {
      this.input = m;
      this.repair = r.model();
     
      ResIterator it1 = repair.listSubjectsWithProperty( EYE.badURI );
      while( it1.hasNext() )
        {
        Resource curr = it1.nextResource();
        NodeIterator it2 = repair.listObjectsOfProperty( curr, EYE.forReason );
        RDFNode uri = repair.listObjectsOfProperty( curr, EYE.badURI ).nextNode();
        String work = uri.asNode().getLiteralLexicalForm();
        while ( it2.hasNext() )
          {
View Full Code Here

    scaleClasses.add(ResourceFactory.
        createResource(riNamespace + "NumericScale"));
    scaleClasses.add(ResourceFactory.
        createResource(riNamespace + "CategoricScale"));
    for(Resource scale : scaleClasses) {
      ResIterator iters = model.listSubjectsWithProperty(
          RDF.type,scale);
      while (iters.hasNext()) {
          resourcesCache.add(iters.nextResource());
      }
    }   
   
    if (!resourcesCache.isEmpty()) {
      System.out.println("The database contains subjects" +
View Full Code Here

  }
   
  public void printReputationAlgorithms(Model model) throws Exception {
    Resource reputationAlgorithm = ResourceFactory.
        createResource(riNamespace + "ReputationAlgorithm");
    ResIterator iters = model.listSubjectsWithProperty(
        RDF.type,reputationAlgorithm);
    if (iters.hasNext()) {
        System.out.println("The database contains subjects" +
            " of type ReputationAlgorithm:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getLocalName());
            ReputationAlgorithmImplementation repAlgInstance =
              getReputationAlgorithm(model,resource,null);
            System.out.println(repAlgInstance.toString("     "));                     
        }
View Full Code Here

 
  public void printAllReputationAlgorithms(Model model) throws Exception {
    Set<Resource> resourcesCache = new HashSet<Resource>();
    Resource reputationAlgorithm = ResourceFactory.
        createResource(riNamespace + "ReputationAlgorithm");
    ResIterator iters = model.listSubjectsWithProperty(
        RDF.type,reputationAlgorithm);
    while (iters.hasNext()) {
        resourcesCache.add(iters.nextResource());
    }
    for(Resource subclass : reputationAlgorithmSubclasses.keySet()) {
      iters = model.listSubjectsWithProperty(RDF.type,subclass);
      while (iters.hasNext()) {
           resourcesCache.add(iters.nextResource());
      }
    }
    for(Property property : reputationSubclassesProperties.keySet()) {
      StmtIterator stmtI1 = model.listStatements((Resource) null, property, (RDFNode) null);
      while (stmtI1.hasNext()) {
View Full Code Here

  }
 
  public void printReputationModels(Model model) throws Exception {
    Resource reputationModel = ResourceFactory.
        createResource(riNamespace + "ReputationModel");
    ResIterator iters = model.listSubjectsWithProperty(
        RDF.type,reputationModel);
    if (iters.hasNext()) {
        System.out.println("The database contains subjects" +
            " of type ReputationModel:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getURI());
            ReputationAlgorithmImplementation repModInstance =
              getReputationModel(model,resource);
            System.out.println(repModInstance.toString("     "));                     
        }
View Full Code Here

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

  public List<MetricTransformer> getMetricTransformers(
      boolean validate) throws Exception {
    List<MetricTransformer> transformers = new ArrayList<MetricTransformer>();
    Resource metricTransformer = ResourceFactory.createResource(
        riNamespace + "MetricTransformer");
    ResIterator iters = model.listSubjectsWithProperty(
        RDF.type,metricTransformer);
    while (iters.hasNext()) {
      Resource resource = iters.nextResource();
      MetricTransformer tranformerIns = getMetricTransformer(model,resource,null);
      if(!validate || ValidateModel.validateMetricTransformer(tranformerIns)) {
        transformers.add(tranformerIns);
      } else {
        ModelException.sendMessage(ModelException.WARNING,"entity(" +
View Full Code Here

  }
 
  public void printExponentialNumericTransformers(Model model) throws Exception {
    Resource exponentialNumericTransformer = ResourceFactory.
        createResource(riNamespace + "ExponentialNumericTransformer");
    ResIterator iters = model.listSubjectsWithProperty(
        RDF.type,exponentialNumericTransformer);
    if (iters.hasNext()) {
        System.out.println("The database contains subjects" +
            " of type ExponentialNumericTransformer:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getLocalName());
            ExponentialNumericTransformer expNumInstance =
              getExponentialNumericTransformer(model,resource);
            System.out.println("     sourceMetric:" +
                expNumInstance.getSourceMetric());
View Full Code Here

  }
 
  public void printSqrtNumericTransformers(Model model) throws Exception {
    Resource sqrtNumericTransformer = ResourceFactory.
        createResource(riNamespace + "SqrtNumericTransformer");
    ResIterator iters = model.listSubjectsWithProperty(
        RDF.type,sqrtNumericTransformer);
    if (iters.hasNext()) {
        System.out.println("The database contains subjects" +
            " of type SqrtNumericTransformer:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getLocalName());
            SqrtNumericTransformer sqrtNumInstance =
              getSqrtNumericTransformer(model,resource);
            System.out.println("     sourceMetric:" +
                sqrtNumInstance.getSourceMetric());
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.