1{ 2 "Additional Examples 1":{ 3 "level":4, 4 "variables":{ 5 "id" : "person", 6 "token" : "12345", 7 "fields" : ["id", "name", "picture"], 8 "format" : "json", 9 "q" : "URI Templates", 10 "page" : "5", 11 "lang" : "en", 12 "geocode" : ["37.76","-122.427"], 13 "first_name" : "John", 14 "last.name" : "Doe", 15 "Some%20Thing" : "foo", 16 "number" : 6, 17 "long" : 37.76, 18 "lat" : -122.427, 19 "group_id" : "12345", 20 "query" : "PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?book ?who WHERE { ?book dc:creator ?who }", 21 "uri" : "http://example.org/?uri=http%3A%2F%2Fexample.org%2F", 22 "word" : "drücken", 23 "Stra%C3%9Fe" : "Grüner Weg", 24 "random" : "šö䟜ñꀣ¥‡ÑÒÓÔÕÖ×ØÙÚàáâãäåæçÿ", 25 "assoc_special_chars" : 26 { "šö䟜ñꀣ¥‡ÑÒÓÔÕ" : "Ö×ØÙÚàáâãäåæçÿ" } 27 }, 28 "testcases":[ 29 30 [ "{/id*}" , "/person" ], 31 [ "{/id*}{?fields,first_name,last.name,token}" , [ 32 "/person?fields=id,name,picture&first_name=John&last.name=Doe&token=12345", 33 "/person?fields=id,picture,name&first_name=John&last.name=Doe&token=12345", 34 "/person?fields=picture,name,id&first_name=John&last.name=Doe&token=12345", 35 "/person?fields=picture,id,name&first_name=John&last.name=Doe&token=12345", 36 "/person?fields=name,picture,id&first_name=John&last.name=Doe&token=12345", 37 "/person?fields=name,id,picture&first_name=John&last.name=Doe&token=12345"] 38 ], 39 ["/search.{format}{?q,geocode,lang,locale,page,result_type}", 40 [ "/search.json?q=URI%20Templates&geocode=37.76,-122.427&lang=en&page=5", 41 "/search.json?q=URI%20Templates&geocode=-122.427,37.76&lang=en&page=5"] 42 ], 43 ["/test{/Some%20Thing}", "/test/foo" ], 44 ["/set{?number}", "/set?number=6"], 45 ["/loc{?long,lat}" , "/loc?long=37.76&lat=-122.427"], 46 ["/base{/group_id,first_name}/pages{/page,lang}{?format,q}","/base/12345/John/pages/5/en?format=json&q=URI%20Templates"], 47 ["/sparql{?query}", "/sparql?query=PREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%20SELECT%20%3Fbook%20%3Fwho%20WHERE%20%7B%20%3Fbook%20dc%3Acreator%20%3Fwho%20%7D"], 48 ["/go{?uri}", "/go?uri=http%3A%2F%2Fexample.org%2F%3Furi%3Dhttp%253A%252F%252Fexample.org%252F"], 49 ["/service{?word}", "/service?word=dr%C3%BCcken"], 50 ["/lookup{?Stra%C3%9Fe}", "/lookup?Stra%C3%9Fe=Gr%C3%BCner%20Weg"], 51 ["{random}" , "%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF"], 52 ["{?assoc_special_chars*}", "?%C5%A1%C3%B6%C3%A4%C5%B8%C5%93%C3%B1%C3%AA%E2%82%AC%C2%A3%C2%A5%E2%80%A1%C3%91%C3%92%C3%93%C3%94%C3%95=%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%BF"] 53 ] 54 }, 55 "Additional Examples 2":{ 56 "level":4, 57 "variables":{ 58 "id" : ["person","albums"], 59 "token" : "12345", 60 "fields" : ["id", "name", "picture"], 61 "format" : "atom", 62 "q" : "URI Templates", 63 "page" : "10", 64 "start" : "5", 65 "lang" : "en", 66 "geocode" : ["37.76","-122.427"] 67 }, 68 "testcases":[ 69 70 [ "{/id*}" , ["/person/albums","/albums/person"] ], 71 [ "{/id*}{?fields,token}" , [ 72 "/person/albums?fields=id,name,picture&token=12345", 73 "/person/albums?fields=id,picture,name&token=12345", 74 "/person/albums?fields=picture,name,id&token=12345", 75 "/person/albums?fields=picture,id,name&token=12345", 76 "/person/albums?fields=name,picture,id&token=12345", 77 "/person/albums?fields=name,id,picture&token=12345", 78 "/albums/person?fields=id,name,picture&token=12345", 79 "/albums/person?fields=id,picture,name&token=12345", 80 "/albums/person?fields=picture,name,id&token=12345", 81 "/albums/person?fields=picture,id,name&token=12345", 82 "/albums/person?fields=name,picture,id&token=12345", 83 "/albums/person?fields=name,id,picture&token=12345"] 84 ] 85 ] 86 }, 87 "Additional Examples 3: Empty Variables":{ 88 "variables" : { 89 "empty_list" : [], 90 "empty_assoc" : {} 91 }, 92 "testcases":[ 93 [ "{/empty_list}", [ "" ] ], 94 [ "{/empty_list*}", [ "" ] ], 95 [ "{?empty_list}", [ ""] ], 96 [ "{?empty_list*}", [ "" ] ], 97 [ "{?empty_assoc}", [ "" ] ], 98 [ "{?empty_assoc*}", [ "" ] ] 99 ] 100 }, 101 "Additional Examples 4: Numeric Keys":{ 102 "variables" : { 103 "42" : "The Answer to the Ultimate Question of Life, the Universe, and Everything", 104 "1337" : ["leet", "as","it", "can","be"], 105 "german" : { 106 "11": "elf", 107 "12": "zwölf" 108 } 109 }, 110 "testcases":[ 111 [ "{42}", "The%20Answer%20to%20the%20Ultimate%20Question%20of%20Life%2C%20the%20Universe%2C%20and%20Everything"], 112 [ "{?42}", "?42=The%20Answer%20to%20the%20Ultimate%20Question%20of%20Life%2C%20the%20Universe%2C%20and%20Everything"], 113 [ "{1337}", "leet,as,it,can,be"], 114 [ "{?1337*}", "?1337=leet&1337=as&1337=it&1337=can&1337=be"], 115 [ "{?german*}", [ "?11=elf&12=zw%C3%B6lf", "?12=zw%C3%B6lf&11=elf"] ] 116 ] 117 } 118} 119