ReoPath Test Cases: The default namespace is http://www.xulplanet.com/rdf/movies# The mv prefix is also mapped to this namespace. The rr namespace is not defined. The context node is {urn:actor:Myers-Mike} The RDF datasource used is http://www.xulplanet.com/ndeakin/arts/reopath/movies-small.rdf These tests only test features that are currently implemented. Results marked with a * may vary as the results may have different anonymous node IDs or have results returned in a different order. Test Expected Result ----------------------------------------------------------------------------- 7 7 '75' '75' "75" '75' 'Strawberry''Jam' 'StrawberryJam' 'Strawberry'"Jam" 'StrawberryJam' 'Nathan'"'s house" 'Nathan's house' 5 + 10 + 20 35 20 + 10 - 12 18 (1,2,3) ( 1 , 2 , 3 ) ((1,2),(2,3)) ( 1 , 2 , 2 , 3 ) ((((1000)))) 1000 (5,'Hello') ( 5 , 'Hello' ) (1,2,3) + (4,5,6) ( 5 , 7 , 9 ) (10,20) - (8,7) ( 2 , 13 ) ((1 + 2) + 6) 9 ((5 + 8) - (5 + 5)) 3 ((1,2) + (3,4) + (5,6)) ( 9 , 12 ) '10' + '20' 30 '10' - '5' 5 'a' + 'b' 0 -- should be () (1,2,3,4) | (2,3,5) ( 1 , 2 , 3 , 4 , 5 ) (1,2,3,4) & (2,3,5) ( 2 , 3 ) (1,2) || (3,4) ( 1 , 2 ) () || (3,4) ( 3 , 4 ) (1,1,1,1) || () ( 1 , 1 , 1 , 1 ) (1,2) && (3,4) ( 3 , 4 ) () && (3,4) () 5 > 1 5 5 > 10 () 5 >= 5 5 5 >= 6 () 5 < 10 5 5 < 5 () 5 <= 10 5 5 <> 5 () 5 <> 10 1 5 = 5 1 -- should return 5 5 = 10 () (1,2) = (1,2) 1 -- should return ( 1 , 2 ) (1,2) = (3,4) () (1,2) = (1,2,3) () (1,2) = (1) () (5) = 5 1 -- should return 5 (1,2,3) <> (1,2,3) () (1,2,3) <> (1,2) () -- should return ( 1 , 2 , 3 ) (1,2,3,4)[>2] ( 3 , 4 ) (1,2,3,4)[=3] ( 3 ) ((1,2),(2,3))[=2] ( 2 , 2 ) (5,10,15)#2 10 (5,10,15)#4 () ((5,10,15),(20,25,30))#5 25 25/15 15 1/2/3/4/5 5 (1,2,3)/1 ( 1 , 1 , 1 ) (1,2)/. ( 1 , 2 ) (1,2)/(. + 2) ( 3 , 4 ) (1,2)/(2 + .) ( 3 , 4 ) (1,2)/(3,4) ( 3 , 4 , 3 , 4 ) (1,2,3,4)/[>2] ( 3 , 4 ) {urn:test} {urn:test} dc:{title} {http://purl.org/dc/elements/1.1/title} rr:{title} {title} -- correct? dc:{} {http://purl.org/dc/elements/1.1/} rr:{} {} :birthdate {http://www.xulplanet.com/rdf/movies#birthdate} :{} {http://www.xulplanet.com/rdf/movies#} . {urn:actor:Myers-Mike} (.,.) ( {urn:actor:Myers-Mike} , {urn:actor:Myers-Mike} ) birthdate '25 May 1963' :birthdate '25 May 1963' mv:birthdate '25 May 1963' birthdate#1 '25 May 1963' name () name#1 () title () dc:title 'Mike Myers' dc:title^dc:title {urn:actor:Myers-Mike} rdf:type {http://www.xulplanet.com/rdf/movies#actor} ^playedBy *{rdf:#$dHONJ3} ^playedBy^cast {urn:movie:Shrek} ^mv:playedBy *{rdf:#$dHONJ3} ^mv:playedBy^mv:cast {urn:movie:Shrek} 'Mike Myers'^dc:title {urn:actor:Myers-Mike} ^:{playedBy} *{rdf:#$dHONJ3} ^mv:{playedBy} *{rdf:#$dHONJ3} ^(mv:{playedBy}) *{rdf:#$dHONJ3} ^dc:{title} () ^rr:title () (.,5,10) ( {urn:actor:Myers-Mike} , 5 , 10 ) (.,dc:title) ( {urn:actor:Myers-Mike} , 'Mike Myers' ) (.,name) {urn:actor:Myers-Mike} count() 1 count(.) 1 count((1,3,5)) 3 count(birthdate) 1 count((1,3,5)#2) 1 count((1,(2,3),5)#2) 1 (1,2,3,4)/count() 4 (1,2,3,4)/count(.) ( 1 , 1 , 1 , 1 ) (1,2,3,4)/count((.,5)) ( 2 , 2 , 2 , 2 ) ('Cat','Parrot')/(count(),count(.)) ( 2 , 1 , 2 , 1 ) ('Cat','Parrot')/(count(.),count()) ( 1 , 2 , 1 , 2 ) 1/(2/count()) 1 (1,2)/(count()) 2 (1,2)/(count()/count()) ( 1 , 1 ) (1,2)/(2/count()) ( 1 , 1 ) pos((5,10,15,20),15) 3 pos((5,10,15,20),25) () pos(5,5) 1 pos(((5,10),(15,20)),10) 2 ('Cat','Dog','Parrot')/pos('Dog') 2 lc() 'urn:actor:myers-mike' lc('Cat') 'cat' lc('cat') 'cat' lc('CAT') 'cat' lc('MiSSiSSiPPi') 'mississippi' uc('Cat') 'CAT' uc('cat') 'CAT' uc('CAT') 'CAT' uc('MiSSiSSiPPi') 'MISSISSIPPI' 'cat'='CAT' () uc('cat')='CAT' 1 - should return 'CAT' stringlength() 20 stringlength(.) 20 stringlength('Mississippi') 11 stringlength(7) 1 stringlength(5624) 4 stringlength(('Cat','Parrot')) ( 3 , 6 ) stringlength(birthdate) 11 'Antarctica'/stringlength() 10 birthdate/stringlength() 11 ('Cat','Parrot')/stringlength() ( 3 , 6 ) ('Cat','Parrot')/stringlength(.) ( 3 , 6 ) ('Cat','Parrot')/stringlength('Fish') ( 4 , 4 ) ('Cat','Parrot')[stringlength() = 3] 'Cat' ('Cat','Parrot')/[stringlength() = 3] 'Cat' ('Cat','Parrot')/[stringlength()] ( 'Cat' , 'Parrot' ) ('Cat','Parrot')/(stringlength(),stringlength(.)) ( 3 , 6 , 3 , 3 , 6 , 6 ) ('Cat','Parrot')/(stringlength(.),stringlength()) ( 3 , 3 , 6 , 6 , 3 , 6 ) ('Cat','Parrot')/stringlength(1) ( 1 , 1 ) startswith('urn') {urn:actor:Myers-Mike} startswith('Mississippi','Miss') 'Mississippi' startswith('Mississippi','Cat') () 'Mississippi'/startswith('Miss') 'Mississippi' 'Mississippi'/startswith(.,'Miss') 'Mississippi' startswith('Mississippi','miss') () startswith('mississippi',lc('Miss')) 'mississippi' lc('Mississippi')/startswith('miss') 'mississippi' startswith(('Cat','Dog','Canary'),'C') ('Cat','Canary') startswith(('Cat','Dog','Canary'),'X') () startswith('Mississippi','') () startswith(5624,56) 5624 startswith('5624',56) '5624' 4000/startswith(stringlength()) 4000 5000/startswith(stringlength()) () endswith('urn') () endswith('Mike') {urn:actor:Myers-Mike} ./endswith('Mike') {urn:actor:Myers-Mike} (.,.)/endswith('Mike') ( {urn:actor:Myers-Mike} , {urn:actor:Myers-Mike} ) endswith(substring(17)) {urn:actor:Myers-Mike} endswith(substring(dc:title,1,5)) {urn:actor:Myers-Mike} contains('Mike') {urn:actor:Myers-Mike} contains('Cat') () contains('Catch','Cat') 'Catch' contains('Mississippi','ss') 'Mississippi' contains(.,'Mike') {urn:actor:Myers-Mike} contains(5624,62) 5624 25/contains(5) 25 6 + 25/contains(5) 31 (6 + 25)/contains(5) () (51,52,53,54,62)/contains(2) ( 52 , 62 ) contains('Mississippi','SS') () contains(uc('Mississippi'),'SS') 'MISSISSIPPI' 'Mississippi'/contains(uc(),'SS') 'MISSISSIPPI' dc:title/endswith('Mike') () dc:title/endswith('Myers') 'Mike Myers' startswith('urn') && endswith('Mike') {urn:actor:Myers-Mike} startswith('urn') && endswith('Myers') () startswith('urn') & endswith('Mike') {urn:actor:Myers-Mike} substring(5) 'actor:Myers-Mike' substring(.,5) 'actor:Myers-Mike' substring(.,5,10) 'actor' substring(,5) 'actor:Myers-Mike' substring(,5,10) 'actor' substring(birthdate,4,7) 'May' substring(birthdate,1,3) - 5 20 substring('Forest',3) 'rest' substring('Forest',1) 'Forest' substring('Forest',7) () substring('Forest',3,5) 're' substring('Forest',3,15) 'rest' substring('Forest',0) () substring(5,10) () substring(5,1) '5' substring(5624,2) '624' 3004/contains(substring(4)) 3004 52/contains(substring(2),stringlength()) '2' ('Cat','Parrot')/substring(3) ( 't' , 'rrot' ) ('Cat','Parrot')/substring(,3) ( 't' , 'rrot' ) ('Cat','Parrot')/substring(.,3) ( 't' , 'rrot' ) substringbefore('M') 'urn:actor:' substringbefore('X') () substringbefore('actor') 'urn:' substringbefore(.,'actor') 'urn:' substringbefore('Forest','r') 'Fo' substringbefore('Forest','F') () substringbefore('Forest','x') () substringbefore('Mississippi','ss') 'Mi' substringafter('M') 'yers-Mike' substringafter('Forest','r') 'est' substringafter('Forest','x') () substringafter('Mississippi','ss') 'issippi' concat('Apple','Tree') 'AppleTree' concat('Apple','') 'Apple' concat('','Apple') 'Apple' 'Apple'/concat('Tree') 'AppleTree' ('Apple','Pear')/concat('Tree') ( 'AppleTree' , 'PearTree' ) concat(1,5) '15' concat(1,5) + 10 25 concat(.,':Junior') 'urn:actor:Myers-Mike:Junior' concat(':Junior') 'urn:actor:Myers-Mike:Junior' ^(concat(:{},'playedBy')) *{rdf:#$dHONJ3} mult(5,10) 50 mult(5,0) 0 mult((5,10),15) ( 75 , 150 ) div(100,5) 20 div(100,3) 33 div(100,0) () div((100,50),5) ( 20 , 10 ) 8 + mult(2,8)/div(4) 12 (8 + mult(2,8))/div(4) 6 (8 + mult(2,8),7)/div(count()) ( 12 , 3 ) isres(.) {urn:actor:Myers-Mike} isres({urn:test}) {urn:test} isres({urn:test}) {urn:test} isres(dc:{title}) {http://purl.org/dc/elements/1.1/title} isres(rr:{title}) {title} -- correct? isres(dc:{}) {http://purl.org/dc/elements/1.1/} isres(rr:{}) {} isres(dc:title) () isres('Forest') () isres(100) () islit(.) () islit({urn:test}) () islit(dc:title) 'Mike Myers' islit('Forest') 'Forest' islit(100) () isnum(.) () isnum({urn:test}) () isnum(dc:title) () isnum('Forest') () isnum('100') () isnum(100) 100 res(.) {urn:actor:Myers-Mike} res('urn:test') {urn:test} res(27) {27} res(('urn:test','urn:example')) ( {urn:test} , {urn:example} ) ({urn:test},'Forest')/isres() {urn:test} ({urn:test},'Forest')/(isres(),islit()) ( {urn:test} , 'Forest' ) not(.) () not(0) () not(1) () not(()) 1 not((1,2)) () 'Cat'/not(='Parrot') 1 ('Cat','Parrot')[not(.)] () ('Cat','Parrot')[not(='Parrot')] 'Cat' if(10,'Yes','No') 'Yes' if(0,'Yes','No') 'Yes' if(.,'Yes','No') 'Yes' if((),'Yes','No') 'No' if(not(()),'Yes','No') 'Yes' if((),'Yes') () if(.,.,'No') {urn:actor:Myers-Mike} /* *( {http://www.xulplanet.com/rdf/movies#actor} , 'Mike Myers' , '25 May 1963' , 'Scarborough, Ontario, Canada' ) /*#2 *( 'Mike Myers' ) count(/*) 4 /*/count() 4 ^* *( {rdf:#$dHONJ3} , {urn:actor:all} ) ^*#2 *( {urn:actor:all} ) {urn:movie:Shrek}/cast* *( {rdf:#$dHONJ3} , {rdf:#$iHONJ3} , {rdf:#$kHONJ3} , {rdf:#$mHONJ3} ) {urn:movie:Shrek}/mv:cast* *( {rdf:#$dHONJ3} , {rdf:#$iHONJ3} , {rdf:#$kHONJ3} , {rdf:#$mHONJ3} ) {urn:movie:Shrek}/cast/playedBy *{urn:actor:Myers-Mike} {urn:movie:Shrek}/cast*/playedBy *( {urn:actor:Myers-Mike} , {urn:actor:Murphy-Eddie} , {urn:actor:Diaz-Cameron} , {urn:actor:Lithgow-John} ) {urn:movie:Shrek}/cast*/playedBy* *( {urn:actor:Myers-Mike} , {urn:actor:Murphy-Eddie} , {urn:actor:Diaz-Cameron} , {urn:actor:Lithgow-John} ) {urn:actor:Diaz-Cameron}^playedBy *{rdf:#$LNCxz2} {urn:actor:Diaz-Cameron}^playedBy* *( {rdf:#$LNCxz2} , {rdf:#$kHONJ3} ) {urn:actor:Diaz-Cameron}^playedBy*^cast *( {urn:movie:Being-John-Malkovich} , {urn:movie:Shrek} ) {urn:actor:Diaz-Cameron}^playedBy*^cast* *( {urn:movie:Being-John-Malkovich} , {urn:movie:Shrek} ) arcsin() *( {http://www.xulplanet.com/rdf/movies#playedBy} , {http://www.w3.org/1999/02/22-rdf-syntax-ns#_6} ) arcsin('Mike Myers') {http://purl.org/dc/elements/1.1/title} arcsin({urn:actor:Diaz-Cameron}) ( {http://www.xulplanet.com/rdf/movies#playedBy} , {http://www.w3.org/1999/02/22-rdf-syntax-ns#_8} ) arcsin({urn:movie:Shrek}) () arcsout() *( {http://www.w3.org/1999/02/22-rdf-syntax-ns#type} , {http://purl.org/dc/elements/1.1/title} , {http://www.xulplanet.com/rdf/movies#birthdate} , {http://www.xulplanet.com/rdf/movies#birthplace} ) {urn:actor:all}/rdf:_7 {urn:actor:Willis-Bruce} {urn:actor:all}/rdf:_17 () {urn:actor:all}%7 {urn:actor:Willis-Bruce} {urn:actor:all}%17 () ({urn:actor:all}%1,{urn:actor:all}%3) ( {urn:actor:Bacon-Kevin} , {urn:actor:Lithgow-John} ) {urn:actor:all}/.%7 {urn:actor:Willis-Bruce} {urn:actor:all}/(%7) {urn:actor:Willis-Bruce} {urn:actor:all}%* ( {urn:actor:Bacon-Kevin} , {urn:actor:Cusack-John} , {urn:actor:Lithgow-John} , {urn:actor:Malkovich-John} , {urn:actor:Murphy-Eddie} , {urn:actor:Myers-Mike} , {urn:actor:Willis-Bruce} , {urn:actor:Diaz-Cameron} , {urn:actor:Keener-Catherine} , {urn:actor:Kidman-Nicole} ) {urn:actor:all}%*/dc:title ( 'Kevin Bacon' , 'John Cusack' , 'John Lithgow' , 'John Malkovich' , 'Eddie Murphy' , 'Mike Myers' , 'Bruce Willis' , 'Cameron Diaz' , 'Catherine Keener' , 'Nicole Kidman' ) {urn:actor:all}%*/birthdate ( '8 July 1958' , '19 October 1945' , '9 December 1953' , '3 April 1961' , '25 May 1963' , '19 March 1955' , '30 August 1972' , '20 June 1967' ) %1 () 'Mississippi'%1 () sublist((5,10,15),2) ( 10 , 15 ) sublist((5,10,15),4) () sublist((5,10,15,20,25,30),3,5) ( 15 , 20 ) sublist((5,10,15,20,25,30),3,10) ( 15 , 20 , 25 , 30 ) sublist(1) {urn:actor:Myers-Mike} sublist(5) () sublist(5624,1) 5624 sublist(5624,5) () (5,10,15)/sublist(2) ( 10 , 15 ) (5,10,15)/sublist(4) () (5,10,15,20,25,30)/sublist(,3,5) ( 15 , 20 ) sublist((5,10,15,20,25,30),3,10) ( 15 , 20 , 25 , 30 ) sublist({urn:actor:all}%*,4,6) ( {urn:actor:Malkovich-John} , {urn:actor:Murphy-Eddie} ) {urn:actor:all}%*/sublist(,4,6) ( {urn:actor:Malkovich-John} , {urn:actor:Murphy-Eddie} ) @ *( {urn:movie:Footloose} , {urn:actor:Willis-Bruce} , {urn:actor:Malkovich-John} , {urn:actor:Murphy-Eddie} , {urn:actor:Diaz-Cameron} , {urn:movie:Being-John-Malkovich} , {urn:movie:Dead-Calm} , {urn:actor:Myers-Mike} , {urn:movie:Shrek} , {urn:actor:Cusack-John} , {urn:actor:all}, {urn:actor:Lithgow-John} , {urn:actor:Keener-Catherine} , {urn:movie:Con-Air} , {urn:actor:Bacon-Kevin} , {urn:actor:Kidman-Nicole} ) @[contains(dc:title,'John')] *( {urn:actor:Malkovich-John} , {urn:movie:Being-John-Malkovich} , {urn:actor:Cusack-John} , {urn:actor:Lithgow-John} ) @[rdf:type=mv:{movie}] *( {urn:movie:Footloose} , {urn:movie:Being-John-Malkovich} , {urn:movie:Dead-Calm} , {urn:movie:Shrek} , {urn:movie:Con-Air} ) repeat('Mississippi',substringafter('ss'),2) 'ippi' repeat(1,.+1,10) 11 repeat('a',concat('a'),10) 'aaaaaaaaaaa' repeat('a',concat(.),5) 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' chain(1,10,.+1) ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ) chain(.,{urn:actor:Diaz-Cameron},^playedBy*^cast||cast*/playedBy) ( {urn:actor:Myers-Mike} , {urn:movie:Shrek} , {urn:actor:Diaz-Cameron} ) chain({urn:actor:Cusack-John},{urn:actor:Bacon-Kevin},^playedBy*^cast||cast*/playedBy) ( {urn:actor:Cusack-John} , {urn:movie:Being-John-Malkovich} , {urn:actor:Diaz-Cameron} , {urn:movie:Shrek} , {urn:actor:Lithgow-John} , {urn:movie:Footloose} , {urn:actor:Bacon-Kevin} )