Formal Interpretation of RQL v2.1
RDFSuite
Overview
RQL Online Demo
Download RQL
Instructions
Documentation
Manual
Expression Interpretation subClassOf(c) {c' C | c' c} subClassOf^(c) {c' C | c' c, $c'' C, c'' < c & c' < c''} p [[ p ]] ^p [[ p ]]-p' p([[ p' ]]) col1 intersect col2 [[ col1 ]] [[ col2 ]] count(col) n, if $ i1, ..., in, $ vi1, ..., vin, " j, i1 j in (j, vj) [[ col ]] seq [n] vn, if 1 n l, (n, vn) [[ seq ]]
Table 1: Formal Interpretation of the core RQL Queries
In order to describe all the cases presented above in a uniform manner, we introduce the general form of a path expression (for both properties and classes): <v1, c1, p, v2, c2> . In the case of properties:
Path expression Interpretation Data Path: P1.1 c{X} {v | v[[ tc ]]} P1.2 {X}p{Y} {[v1, v2] | [v1, v2][[ tp[t1,t2] ]]} P1.3 {X}@P{Y} {[v1, p, v2] | p[[ tMp ]] , [v1, v2][[ tp[t1,t2] ]]} P1.4 $X{Y} {[c, v] | c[[ tMc ]] , v[[ tc ]]} Schema path: P2.1 Class{X} {c | c[[ tMc ]]} P2.2 $X {c | c [[ tMc ]]} P2.3 Property{P} {p | p[[ tMp ]] } P2.4 @P {p | p [[ tMp ]]} P2.5 c{$C} {c' | c'[[ tMc ]], c' c} P2.6 {$X}p{$Y}
{[c1, c2] | c1, c2[[ tMc ]], c1 domain(p), c2 range(p)} P2.7 $X{$Y}
{[c1, c2] | c1, c2 [[ tMc ]], c2 c1} P2.8 {$X}@P{$Y}
{[c1, p, c2] | p [[ tMP ]], c1, c2 [[ tMc ]], c1 domain(p), c2 range(p)} Mixed path: P3.1 c{X;$C} {[v, c'] | c'[[ tMc ]], c' c, v[[ tc' ]]} P3.2 {X;$Z}p{Y;$W}
{[v1, c1, v2, c2]| c1, c2[[ tMC ]],c1domain(p), v1[[ tc1 ]], c2 range(p), v2[[ tc2 ]], [v1, v2][[ tp[t1,t2] ]]} P3.3 p{Y;$W}
{[v2, c2] | c2[[ tMc ]], c2 range(p), v2[[ tc2 ]], [v1, v2][[ tp[t1,t2] ]]} P3.4 {X}p{Y;$W}
{[v1, v2, c2] | c2[[ tMc ]], c2 range(p), v2[[ tc2 ]], [v1, v2][[ tp[t1,t2] ]]} P3.5 {X}p{$W}
{[v1, c2] | c2[[ tMc ]], c2 range(p), v2[[ tc2 ]], [v1, v2][[ tp[t1,t2] ]]} P3.6 {$Z}p{Y;$W}
{[c1, v2, c2] | c1, c2[[ tMC ]], c1 domain(p), v1[[ tc1 ]], c2 range(p), v2[[ tc2 ]], [v1, v2][[ tp[t1,t2] ]]} P3.7 {X;$Z}@P{Y;$W}
{[v1, c1, p, v2, c2] | p[[ tMp ]], c1, c2[[ tMc ]], c1 domain(p), v1[[ tc1 ]], c2 range(p), v2[[ tc2 ]], [v1, v2][[ tp[t1,t2] ]]}
Table 2: Formal Interpretation of the basic RQL path expressions
Composed paths (Left, Right) Example (from table 2) Join condition(s)
<-, -, -, v, 0> <v', 0, -, -, -> <-, -, -, v, 0> <v', c, -, -, -> <-, -, -, v, c> <v', 0, -, -, ->
(P1.2).(P1.2) (P1.2).(P3.2) (P3.2).(P1.2)
v = v'
<-, -, -, v, 0> <0, c, -, -, -> <-, -, -, 0, c> <v, 0, -, -, ->
(P1.2).(P2.6) (P2.6).(P1.2)
if c constant: v [[ c ]] if c variable: v ^[[ c ]]
<-, -, -, v, 0> <0, 0, p, -, -> <-, -, p, 0, 0> <v, 0, -, -, ->
(P1.2).(P2.4) (P2.4).(P1.2)
if p property variable: v [[ domain(p) ]] (in second case v [[ range(p) ]] ) if p class variable: v [[ p ]]
<-, -, -, 0, c> <0, c', -, -, -> <-, -, -, 0, c> <v, c', -, -, -> <-, -, -, v, c> <0, c', -, -, ->
(P2.6).(P2.6) (P2.6).(P3.2) (P3.2).(P2.6)
if c, c' constants: c c' or c' c if c, c' iterators: c = c' if c constant, c' iterator: c' c
<-, -, -, 0, c> <0, 0, p, -, -> <-, -, p, 0, 0> <0, c, -, -, ->
(P2.6).(P2.4) (P2.4).(P2.6)
c domain(p) (in second case c range(p)) (c constant or iterator)
<-, -, -, v, c> <v', c', -, -, ->
(P3.2).(P3.2)
v = v' and: if c, c' constants: c c' or c' c if c, c' iterators: c = c' if c constant, c' iterator: c' c
<-, -, -, v, c> <0, 0, p, -, -> <-, -, p, 0, 0> <v, c, -, -, ->
(P3.2).(P2.4) (P2.4).(P3.2)
c domain(p) (in second case c range(p))
<-, -, p, 0, 0> <0, 0, q, -, ->
(P2.4).(P2.4)
range(p) domain(q) or domain(q) range(p)
Table 3: Formal Interpretation of RQL path compositions
This document was translated from LATEX by HEVEA.
Last modified: June 27, 2003