Created
May 25, 2010 15:17
-
-
Save shellac/413250 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Op op = constraintsToOp(constraints); | |
// Using count(*) -- lost! | |
E_Aggregator agg = new E_Aggregator("name", AggCount.get().create()); | |
op = new OpGroupAgg(op, new VarExprList(), Collections.singletonList(agg)); | |
Query q = OpAsQuery.asQuery(op); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Op op = constraintsToOp(constraints); | |
Query q = OpAsQuery.asQuery(op); | |
q.setQuerySelectType(); | |
q.setQueryResultStar(false); | |
E_Aggregator agg = q.allocAggregate(AggCount.get()); | |
q.addResultVar("count", agg); | |
q.addProjectVars(Arrays.asList(Var.alloc("count"))); | |
QueryExecution qe = qef.get(q); | |
ResultSet r = qe.execSelect(); | |
int count = r.next().getLiteral("count").getInt(); | |
qe.close(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(join | |
(graph ?v34 | |
(filter (&& (<= "5"^^<http://www.w3.org/2001/XMLSchema#int> ?v33) (< ?v33 "9"^^<http://www.w3.org/2001/XMLSchema#int>)) | |
(bgp (triple ?s <http://example.com/ns#range> ?v33)))) | |
(graph ?v36 | |
(filter (regex (str ?v35) "^x" "i") | |
(bgp (triple ?s <http://example.com/ns#label> ?v35))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment