Package org.openrdf.query

Examples of org.openrdf.query.TupleQueryResultHandlerException


  public void handleSolution(BindingSet bindingSet)
    throws TupleQueryResultHandlerException
  {
    if (closed) {
      throw new TupleQueryResultHandlerException("Result closed");
    }
    try {
      queue.put(bindingSet);
    }
    catch (InterruptedException e) {
      throw new TupleQueryResultHandlerException(e);
    }
  }
View Full Code Here


      // Write start of results
      xmlWriter.startTag(RESULT_SET_TAG);
    }
    catch (IOException e) {
      throw new TupleQueryResultHandlerException(e);
    }
  }
View Full Code Here

      xmlWriter.endTag(ROOT_TAG);

      xmlWriter.endDocument();
    }
    catch (IOException e) {
      throw new TupleQueryResultHandlerException(e);
    }
  }
View Full Code Here

      }

      xmlWriter.endTag(RESULT_TAG);
    }
    catch (IOException e) {
      throw new TupleQueryResultHandlerException(e);
    }
  }
View Full Code Here

      List<Value> nullTuple = Collections.nCopies(this.bindingNames.size(), (Value)null);
      previousBindings = new ListBindingSet(this.bindingNames, nullTuple);
      nextNamespaceID = 0;
    }
    catch (IOException e) {
      throw new TupleQueryResultHandlerException(e);
    }
  }
View Full Code Here

    try {
      out.writeByte(TABLE_END_RECORD_MARKER);
      out.flush();
    }
    catch (IOException e) {
      throw new TupleQueryResultHandlerException(e);
    }
  }
View Full Code Here

          }
          else if (value instanceof Literal) {
            writeLiteral((Literal)value);
          }
          else {
            throw new TupleQueryResultHandlerException("Unknown Value object type: " + value.getClass());
          }
        }

        previousBindings = bindingSet;
      }
    }
    catch (IOException e) {
      throw new TupleQueryResultHandlerException(e);
    }
  }
View Full Code Here

                    public void startQueryResult(List<String> bindingNames) throws TupleQueryResultHandlerException {
                        subject = triples.getValueFactory().createURI(resource.stringValue());
                        try {
                            con = triples.getConnection();
                        } catch (RepositoryException e) {
                            throw new TupleQueryResultHandlerException("error while creating repository connection",e);
                        }
                    }

                    @Override
                    public void endQueryResult() throws TupleQueryResultHandlerException   {
                        try {
                            con.commit();
                            con.close();
                        } catch (RepositoryException e) {
                            throw new TupleQueryResultHandlerException("error while closing repository connection",e);
                        }
                    }

                    @Override
                    public void handleSolution(BindingSet bindingSet) throws TupleQueryResultHandlerException {

                        try {
                            Value predicate = bindingSet.getValue("p");
                            Value object    = bindingSet.getValue("o");

                            if(predicate instanceof URI) {
                                con.add(triples.getValueFactory().createStatement(subject,(URI)predicate,object));
                            } else {
                                log.error("ignoring binding as predicate {} is not a URI",predicate);
                            }
                        } catch (RepositoryException e) {
                            throw new TupleQueryResultHandlerException("error while adding triple to repository connection",e);
                        }
                    }
                },
                triples.getValueFactory());
View Full Code Here

      openArray();

      firstTupleWritten = false;
    }
    catch (IOException e) {
      throw new TupleQueryResultHandlerException(e);
    }
  }
View Full Code Here

      closeBraces(); // results braces
      closeBraces(); // root braces
      writer.flush();
    }
    catch (IOException e) {
      throw new TupleQueryResultHandlerException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.openrdf.query.TupleQueryResultHandlerException

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.