Example #1
0
 @Override
 public boolean equals(Object other) {
   if (other instanceof Service && super.equals(other)) {
     Service o = (Service) other;
     return serviceRef.equals(o.getServiceRef());
   }
   return false;
 }
  @Override
  public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(
      String sparqlQueryString,
      BindingSet bindings,
      String baseUri,
      QueryType type,
      Service service)
      throws QueryEvaluationException {
    RepositoryConnection conn = endpoint.getConn();
    try {
      TupleQuery query = conn.prepareTupleQuery(QueryLanguage.SPARQL, sparqlQueryString, baseUri);

      Iterator<Binding> bIter = bindings.iterator();
      while (bIter.hasNext()) {
        Binding b = bIter.next();
        if (service.getServiceVars().contains(b.getName()))
          query.setBinding(b.getName(), b.getValue());
      }

      TupleQueryResult qRes = query.evaluate();
      return new InsertBindingsIteration(qRes, bindings);
    } catch (OpenRDFException e) {
      throw new QueryEvaluationException(e);
    }
  }
Example #3
0
 @Override
 public Service clone() {
   Service clone = (Service) super.clone();
   clone.setServiceRef(serviceRef.clone());
   return clone;
 }