Search in sources :

Example 81 with Query

use of org.apache.jena.query.Query in project jena by apache.

the class ParserSPARQL11 method parseTemplate.

public static Template parseTemplate(String string) {
    final Query query = new Query();
    Action action = new Action() {

        @Override
        public void exec(SPARQLParser11 parser) throws Exception {
            Template t = parser.ConstructTemplate();
            query.setConstructTemplate(t);
        }
    };
    perform(query, string, action);
    return query.getConstructTemplate();
}
Also used : SPARQLParser11(org.apache.jena.sparql.lang.sparql_11.SPARQLParser11) Query(org.apache.jena.query.Query) Template(org.apache.jena.sparql.syntax.Template)

Example 82 with Query

use of org.apache.jena.query.Query in project jena by apache.

the class SPARQLParser method parse.

public final Query parse(Query query, String queryString) throws QueryParseException {
    Query q = parse$(query, queryString);
    validateParsedQuery(q);
    return q;
}
Also used : Query(org.apache.jena.query.Query)

Example 83 with Query

use of org.apache.jena.query.Query in project jena by apache.

the class SPARQLParserBase method setUpdateSink.

//    protected UpdateSink getUpdateSink() { return sink ; }
public void setUpdateSink(UpdateSink sink) {
    this.sink = sink;
    this.query = new Query();
    setPrologue(sink.getPrologue());
}
Also used : Query(org.apache.jena.query.Query)

Example 84 with Query

use of org.apache.jena.query.Query in project jena by apache.

the class ParserARQ method parseTemplate.

public static Template parseTemplate(String string) {
    final Query query = new Query();
    Action action = new Action() {

        @Override
        public void exec(ARQParser parser) throws Exception {
            Template t = parser.ConstructTemplate();
            query.setConstructTemplate(t);
        }
    };
    perform(query, string, action);
    return query.getConstructTemplate();
}
Also used : Query(org.apache.jena.query.Query) ARQParser(org.apache.jena.sparql.lang.arq.ARQParser) Template(org.apache.jena.sparql.syntax.Template)

Example 85 with Query

use of org.apache.jena.query.Query in project jena by apache.

the class ParserARQ method parseElement.

public static Element parseElement(String string) {
    final Query query = new Query();
    Action action = new Action() {

        @Override
        public void exec(ARQParser parser) throws Exception {
            Element el = parser.GroupGraphPattern();
            query.setQueryPattern(el);
        }
    };
    perform(query, string, action);
    return query.getQueryPattern();
}
Also used : Query(org.apache.jena.query.Query) ARQParser(org.apache.jena.sparql.lang.arq.ARQParser) Element(org.apache.jena.sparql.syntax.Element)

Aggregations

Query (org.apache.jena.query.Query)106 Test (org.junit.Test)22 Op (org.apache.jena.sparql.algebra.Op)17 QueryExecution (org.apache.jena.query.QueryExecution)13 ResultSet (org.apache.jena.query.ResultSet)11 Var (org.apache.jena.sparql.core.Var)11 HashMap (java.util.HashMap)9 QuerySolution (org.apache.jena.query.QuerySolution)9 ContractTest (org.xenei.junit.contract.ContractTest)9 Node (org.apache.jena.graph.Node)8 WhereHandler (org.apache.jena.arq.querybuilder.handlers.WhereHandler)7 VarExprList (org.apache.jena.sparql.core.VarExprList)7 Element (org.apache.jena.sparql.syntax.Element)7 Triple (org.apache.jena.graph.Triple)6 Before (org.junit.Before)6 Map (java.util.Map)5 QueryEngineHTTP (org.apache.jena.sparql.engine.http.QueryEngineHTTP)5 Context (org.apache.jena.sparql.util.Context)5 StringReader (java.io.StringReader)4 NodeAlignment (mom.trd.opentheso.bdd.helper.nodes.NodeAlignment)4