Class SparqlQueryResult


  • public class SparqlQueryResult
    extends Object
    A result of a generic SPARQL query that holds the result value(s) depending on the query type.
    Author:
    burgetr
    • Constructor Detail

      • SparqlQueryResult

        public SparqlQueryResult()
    • Method Detail

      • createTuple

        public static SparqlQueryResult createTuple​(List<org.eclipse.rdf4j.query.BindingSet> tupleResult)
        Creates a tuple query result from a list of bindings.
        Parameters:
        tupleResult - the bindings
        Returns:
        the new query result
      • createGraph

        public static SparqlQueryResult createGraph​(List<org.eclipse.rdf4j.model.Statement> graphResult)
        Creates a graph query result from a list of statements.
        Parameters:
        graphResult - the statements
        Returns:
        the new query result
      • createBoolean

        public static SparqlQueryResult createBoolean​(boolean booleanResult)
        Creates a boolean query result from a boolean value.
        Parameters:
        booleanResult - the result value
        Returns:
        the new query result
      • getType

        public SparqlQueryResult.Type getType()
        The result type: TUPLE, GRAPH or BOOLEAN
        Returns:
        result type
      • getTupleResult

        public List<org.eclipse.rdf4j.query.BindingSet> getTupleResult()
        Gets the tuple query result data - a list of variable bindings.
        Returns:
        the list of bindings
      • getGraphResult

        public List<org.eclipse.rdf4j.model.Statement> getGraphResult()
        Gets the graph query result data - a list of statements
        Returns:
        the list of statements
      • getBooleanResult

        public boolean getBooleanResult()
        Gets the boolean query result data - a boolean value
        Returns:
        the boolean value of the result