Type-ARQuE example transformation: test/ssws2010/type-inference-no-type.rq (simple-inline)
SPARQL Query
SELECT *
WHERE {
?a ?b ?c
FILTER (?c>=45.1 && ?c>='a' && ?c=?c && bound(?a))
}
Query translated into AQL
(aql-query ("triple_1_1")
(select "a" (property (string IRI double integer boolean datetime)
"triple_1_1" subject))
(select "b" (property (string IRI double integer boolean datetime)
"triple_1_1" predicate))
(select "c" (property (string IRI double integer boolean datetime)
"triple_1_1" object))
(criterion (and (and (and (comp-ge (property (string IRI double integer boolean datetime)
"triple_1_1" object)
(literal double 45.1))
(comp-ge (property (string IRI double integer boolean datetime)
"triple_1_1" object)
(literal string "a")))
(comp-eq (property (string IRI double integer boolean datetime)
"triple_1_1" object)
(property (string IRI double integer boolean datetime)
"triple_1_1" object)))
(function"builtin:is-not-null" (string IRI double integer boolean datetime)
(property (string IRI double integer boolean datetime)
"triple_1_1" subject)))))
Lowered and optimized AQL
(aql-query ("triple_1_1")
(select "a" (custom (IRI)
FlexibleSQLLayout::SQLAccessExpr INLINE subj_value USING JOIN triple_1_1))
(select "b" (custom (IRI)
FlexibleSQLLayout::SQLAccessExpr INLINE pred_value USING JOIN triple_1_1))
(select "c" (null))
(criterion (function"builtin:and" (boolean) ### variant [(boolean) (boolean) (boolean) (boolean)] : (boolean)
(function"builtin:comp-ge" (boolean) ### variant [(double) (double)] : (boolean)
(null)
(literal double 45.1))
(function"builtin:comp-ge" (boolean) ### variant [(string) (string)] : (boolean)
(null)
(literal string "a"))
(function"builtin:comp-eq" (boolean) ### variant [(string) (string)] : (boolean)
(null)
(null))
(function"builtin:is-not-null" (boolean) ### variant [(string IRI double integer boolean datetime)] : (boolean)
(custom (IRI)
FlexibleSQLLayout::SQLAccessExpr INLINE subj_value USING JOIN triple_1_1))))
# Inference map = {
# triple_1_1.subject: (IRI)
# triple_1_1.predicate: (IRI)
# triple_1_1.object: ()
)
SQL
SELECT triple_1_1.subj_value AS c0,
triple_1_1.pred_value AS c1,
NULL AS c2
FROM InlinedTriples AS triple_1_1
WHERE NULL>=45.1 AND NULL>='a' AND NULL=NULL AND triple_1_1.subj_value IS NOT NULL
Execution result
| a | b | c |
=============
0 rows