Class AGGraphQuery

java.lang.Object
org.eclipse.rdf4j.query.impl.AbstractOperation
org.eclipse.rdf4j.query.impl.AbstractQuery
com.franz.agraph.repository.AGQuery
com.franz.agraph.repository.AGGraphQuery
All Implemented Interfaces:
org.eclipse.rdf4j.query.GraphQuery, org.eclipse.rdf4j.query.Operation, org.eclipse.rdf4j.query.Query

public class AGGraphQuery extends AGQuery implements org.eclipse.rdf4j.query.GraphQuery
Implements the Sesame GraphQuery interface for AllegroGraph.
  • Constructor Details

    • AGGraphQuery

      public AGGraphQuery(AGRepositoryConnection con, org.eclipse.rdf4j.query.QueryLanguage ql, String queryString, String baseURI)
      Creates an AGGraphQuery instance for the given connection.
      Parameters:
      con - the connection
      ql - the query language
      queryString - the query
      baseURI - the base URI for the query
  • Method Details

    • evaluate

      public org.eclipse.rdf4j.query.GraphQueryResult evaluate() throws org.eclipse.rdf4j.query.QueryEvaluationException
      Evaluates the query and returns a GraphQueryResult.
      Specified by:
      evaluate in interface org.eclipse.rdf4j.query.GraphQuery
      Throws:
      org.eclipse.rdf4j.query.QueryEvaluationException
    • evaluate

      public void evaluate(org.eclipse.rdf4j.rio.RDFHandler handler) throws org.eclipse.rdf4j.query.QueryEvaluationException, org.eclipse.rdf4j.rio.RDFHandlerException
      Evaluates the query and uses handler to process the result.
      Specified by:
      evaluate in interface org.eclipse.rdf4j.query.GraphQuery
      Throws:
      org.eclipse.rdf4j.query.QueryEvaluationException
      org.eclipse.rdf4j.rio.RDFHandlerException
    • count

      public long count() throws org.eclipse.rdf4j.query.QueryEvaluationException
      Evaluates the query and returns only the number of results to the client (counting is done on the server, the results are not returned).
      Returns:
      long the number of results
      Throws:
      org.eclipse.rdf4j.query.QueryEvaluationException - if an error occurs while evaluating the query
    • download

      public void download(File file, org.eclipse.rdf4j.rio.RDFFormat format) throws org.eclipse.rdf4j.query.QueryEvaluationException
      Evaluates the query and saves the results to a file.
      Parameters:
      file - Output path.
      format - Output format.
      Throws:
      org.eclipse.rdf4j.query.QueryEvaluationException - if there is an error while evaluating query
    • download

      public void download(String file, org.eclipse.rdf4j.rio.RDFFormat format) throws org.eclipse.rdf4j.query.QueryEvaluationException
      Evaluates the query and saves the results to a file.
      Parameters:
      file - Output path.
      format - Output format.
      Throws:
      org.eclipse.rdf4j.query.QueryEvaluationException - if there is an error while evaluating query
    • stream

      public InputStream stream(org.eclipse.rdf4j.rio.RDFFormat format) throws org.eclipse.rdf4j.query.QueryEvaluationException
      Evaluates the query and returns the result as an input stream.

      Note that it is important to close the returned stream, to avoid resource leaks.

      Parameters:
      format - Output format.
      Returns:
      An input stream containing response data. The caller MUST close this stream to release connection resources.
      Throws:
      org.eclipse.rdf4j.query.QueryEvaluationException - if there is an error while evaluating query