Package org.wikier.trioo.jtrioo.rdf.sparql

Examples of org.wikier.trioo.jtrioo.rdf.sparql.QueryExecutor


        InsertQueryGenerator iqg = QueryGeneratorFactory.createInsertQueryGenerator();
        iqg.setUri(uri);
        iqg.visit(metaResource);
        QueryCodeGenerator qg = new QueryCodeGenerator();
        qg.visit(iqg.getQuery());
        QueryExecutor qe = this.session.getQueryExecutor();
        return qe.execInsert(qg.toString());
      }
    }
  } 
View Full Code Here


    } else {
      ConstructQueryGenerator cqg = QueryGeneratorFactory.createConstructQueryGenerator();
      cqg.visit(metaResource);
      QueryCodeGenerator qcg = new QueryCodeGenerator();
      qcg.visit(cqg.getQuery());
      QueryExecutor qe = this.session.getQueryExecutor();
      return qe.execConstruct(qcg.toString());
    }
  }
View Full Code Here

  public Model describe(String uri) {
    DescribeQueryGenerator dqg = QueryGeneratorFactory.createDescribeQueryGenerator();
    dqg.visit(uri);
    QueryCodeGenerator qcg = new QueryCodeGenerator();
    qcg.visit(dqg.getQuery());
    QueryExecutor qe = this.session.getQueryExecutor();
    return qe.execDescribe(qcg.toString());
  }
View Full Code Here

        iqg.setResourceManager(this);
        iqg.setObj(resource);
        iqg.visit(metaResource);
        QueryCodeGenerator qcg = new QueryCodeGenerator();
        qcg.visit(iqg.getQuery());
        QueryExecutor qe = this.session.getQueryExecutor();
        Model model = JenaHelper.createModel();
        return qe.execInsert(qcg.toString(), model);
      }
    } else {
      return JenaHelper.createModel();
    }
  }
View Full Code Here

        iqg.setObj(resource);
        iqg.setUri(uri);
        iqg.visit(metaResource);
        QueryCodeGenerator qcg = new QueryCodeGenerator();
        qcg.visit(iqg.getQuery());
        QueryExecutor qe = this.session.getQueryExecutor();
        Model model = JenaHelper.createModel();
        return qe.execInsert(qcg.toString(), model);
      }
    } else {
      return JenaHelper.createModel();
    }
  }
View Full Code Here

  public void load(String uri) {
    logger.warn("Resource not necessary in this implementation? ignoring it....");
  }

  public QueryExecutor getQueryExecutor() {
    QueryExecutor qe = new QueryExecutorEndpoint();
    qe.setSession(this); //FIXME
    return qe;
  }
View Full Code Here

      logger.error(uri + " does not exist");
    }
  }

  public QueryExecutor getQueryExecutor() {
    QueryExecutor qe = new QueryExecutorJena();
    qe.setSession(this); //FIXME
    return qe;
  }
View Full Code Here

      SelectQueryGenerator sqg = QueryGeneratorFactory.createSelectQueryGenerator();
      sqg.setUri(uri);
      sqg.visit(metaResource);
      QueryCodeGenerator qg = new QueryCodeGenerator();
      qg.visit(sqg.getQuery());
      QueryExecutor qe = this.session.getQueryExecutor();
      ResultSet rs = qe.execSelect(qg.toString());
      Object obj = null;
      if (rs.hasNext()) {
        obj = InstanceGenerator.create(resourceClass, rs.next());
      }
      rs = null; //FIXME: how a ResultSet can be closed?
View Full Code Here

    Variable x = new Variable("x");
    q.addTriplePattern(new TriplePattern(x, new AbbrevRdfType(), new Variable("type")));
    q.addFilter("str(" + x.toString() +") = \"" + uri + "\"");
    QueryCodeGenerator qg = new QueryCodeGenerator();
    qg.visit(q);
    QueryExecutor qe = this.session.getQueryExecutor();
    ResultSet rs = qe.execSelect(qg.toString());
    RDFMetaResource metaResource = new RDFMetaResource(Object.class);
    while (rs.hasNext()) {
      QuerySolution qs = rs.nextSolution();
      RDFNode node  = qs.get("type");
      if (node.isURIResource()) {
View Full Code Here

    } else {
      SelectQueryGenerator sqg = QueryGeneratorFactory.createSelectQueryGenerator();
      sqg.visit(metaResource);
      QueryCodeGenerator qg = new QueryCodeGenerator();
      qg.visit(sqg.getQuery());
      QueryExecutor qe = this.session.getQueryExecutor();
      ResultSet rs = qe.execSelect(qg.toString());
      List<Object> objs = new ArrayList<Object>();
      while (rs.hasNext()) {
        objs.add(InstanceGenerator.create(resourceClass, rs.next()));
      }
      rs = null; //FIXME: how a ResultSet can be closed?
View Full Code Here

TOP

Related Classes of org.wikier.trioo.jtrioo.rdf.sparql.QueryExecutor

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.