|
3113 | 3113 | end
|
3114 | 3114 | end
|
3115 | 3115 |
|
| 3116 | + context "JSON-LD*" do |
| 3117 | + { |
| 3118 | + "subject-iii": { |
| 3119 | + input: %([{ |
| 3120 | + "@id": { |
| 3121 | + "@id": "http://example/s1", |
| 3122 | + "http://example/p1": [{"@id": "http://example/o1"}] |
| 3123 | + }, |
| 3124 | + "http://example/p": [{"@id": "http://example/o"}] |
| 3125 | + }]), |
| 3126 | + context: %({"ex": "http://example/"}), |
| 3127 | + output: %({ |
| 3128 | + "@context": {"ex": "http://example/"}, |
| 3129 | + "@id": { |
| 3130 | + "@id": "ex:s1", |
| 3131 | + "ex:p1": {"@id": "ex:o1"} |
| 3132 | + }, |
| 3133 | + "ex:p": {"@id": "ex:o"} |
| 3134 | + }) |
| 3135 | + }, |
| 3136 | + "subject-iib": { |
| 3137 | + input: %([{ |
| 3138 | + "@id": { |
| 3139 | + "@id": "http://example/s1", |
| 3140 | + "http://example/p1": [{"@id": "_:o1"}] |
| 3141 | + }, |
| 3142 | + "http://example/p": [{"@id": "http://example/o"}] |
| 3143 | + }]), |
| 3144 | + context: %({"ex": "http://example/"}), |
| 3145 | + output: %({ |
| 3146 | + "@context": {"ex": "http://example/"}, |
| 3147 | + "@id": { |
| 3148 | + "@id": "ex:s1", |
| 3149 | + "ex:p1": {"@id": "_:o1"} |
| 3150 | + }, |
| 3151 | + "ex:p": {"@id": "ex:o"} |
| 3152 | + }) |
| 3153 | + }, |
| 3154 | + "subject-iil": { |
| 3155 | + input: %([{ |
| 3156 | + "@id": { |
| 3157 | + "@id": "http://example/s1", |
| 3158 | + "http://example/p1": [{"@value": "o1"}] |
| 3159 | + }, |
| 3160 | + "http://example/p": [{"@id": "http://example/o"}] |
| 3161 | + }]), |
| 3162 | + context: %({"ex": "http://example/"}), |
| 3163 | + output: %({ |
| 3164 | + "@context": {"ex": "http://example/"}, |
| 3165 | + "@id": { |
| 3166 | + "@id": "ex:s1", |
| 3167 | + "ex:p1": "o1" |
| 3168 | + }, |
| 3169 | + "ex:p": {"@id": "ex:o"} |
| 3170 | + }) |
| 3171 | + }, |
| 3172 | + "subject-bii": { |
| 3173 | + input: %([{ |
| 3174 | + "@id": { |
| 3175 | + "@id": "_:s1", |
| 3176 | + "http://example/p1": [{"@id": "http://example/o1"}] |
| 3177 | + }, |
| 3178 | + "http://example/p": [{"@id": "http://example/o"}] |
| 3179 | + }]), |
| 3180 | + context: %({"ex": "http://example/"}), |
| 3181 | + output: %({ |
| 3182 | + "@context": {"ex": "http://example/"}, |
| 3183 | + "@id": { |
| 3184 | + "@id": "_:s1", |
| 3185 | + "ex:p1": {"@id": "ex:o1"} |
| 3186 | + }, |
| 3187 | + "ex:p": {"@id": "ex:o"} |
| 3188 | + }) |
| 3189 | + }, |
| 3190 | + "subject-bib": { |
| 3191 | + input: %([{ |
| 3192 | + "@id": { |
| 3193 | + "@id": "_:s1", |
| 3194 | + "http://example/p1": [{"@id": "_:o1"}] |
| 3195 | + }, |
| 3196 | + "http://example/p": [{"@id": "http://example/o"}] |
| 3197 | + }]), |
| 3198 | + context: %({"ex": "http://example/"}), |
| 3199 | + output: %({ |
| 3200 | + "@context": {"ex": "http://example/"}, |
| 3201 | + "@id": { |
| 3202 | + "@id": "_:s1", |
| 3203 | + "ex:p1": {"@id": "_:o1"} |
| 3204 | + }, |
| 3205 | + "ex:p": {"@id": "ex:o"} |
| 3206 | + }) |
| 3207 | + }, |
| 3208 | + "subject-bil": { |
| 3209 | + input: %([{ |
| 3210 | + "@id": { |
| 3211 | + "@id": "_:s1", |
| 3212 | + "http://example/p1": [{"@value": "o1"}] |
| 3213 | + }, |
| 3214 | + "http://example/p": [{"@id": "http://example/o"}] |
| 3215 | + }]), |
| 3216 | + context: %({"ex": "http://example/"}), |
| 3217 | + output: %({ |
| 3218 | + "@context": {"ex": "http://example/"}, |
| 3219 | + "@id": { |
| 3220 | + "@id": "_:s1", |
| 3221 | + "ex:p1": "o1" |
| 3222 | + }, |
| 3223 | + "ex:p": {"@id": "ex:o"} |
| 3224 | + }) |
| 3225 | + }, |
| 3226 | + "object-iii": { |
| 3227 | + input: %([{ |
| 3228 | + "@id": "http://example/s", |
| 3229 | + "http://example/p": [{ |
| 3230 | + "@id": { |
| 3231 | + "@id": "http://example/s1", |
| 3232 | + "http://example/p1": [{"@id": "http://example/o1"}] |
| 3233 | + } |
| 3234 | + }] |
| 3235 | + }]), |
| 3236 | + context: %({"ex": "http://example/"}), |
| 3237 | + output: %({ |
| 3238 | + "@context": {"ex": "http://example/"}, |
| 3239 | + "@id": "ex:s", |
| 3240 | + "ex:p": { |
| 3241 | + "@id": { |
| 3242 | + "@id": "ex:s1", |
| 3243 | + "ex:p1": {"@id": "ex:o1"} |
| 3244 | + } |
| 3245 | + } |
| 3246 | + }) |
| 3247 | + }, |
| 3248 | + "object-iib": { |
| 3249 | + input: %([{ |
| 3250 | + "@id": "http://example/s", |
| 3251 | + "http://example/p": [{ |
| 3252 | + "@id": { |
| 3253 | + "@id": "http://example/s1", |
| 3254 | + "http://example/p1": [{"@id": "_:o1"}] |
| 3255 | + } |
| 3256 | + }] |
| 3257 | + }]), |
| 3258 | + context: %({"ex": "http://example/"}), |
| 3259 | + output: %({ |
| 3260 | + "@context": {"ex": "http://example/"}, |
| 3261 | + "@id": "ex:s", |
| 3262 | + "ex:p": { |
| 3263 | + "@id": { |
| 3264 | + "@id": "ex:s1", |
| 3265 | + "ex:p1": {"@id": "_:o1"} |
| 3266 | + } |
| 3267 | + } |
| 3268 | + }) |
| 3269 | + }, |
| 3270 | + "object-iil": { |
| 3271 | + input: %([{ |
| 3272 | + "@id": "http://example/s", |
| 3273 | + "http://example/p": [{ |
| 3274 | + "@id": { |
| 3275 | + "@id": "http://example/s1", |
| 3276 | + "http://example/p1": [{"@value": "o1"}] |
| 3277 | + } |
| 3278 | + }] |
| 3279 | + }]), |
| 3280 | + context: %({"ex": "http://example/"}), |
| 3281 | + output: %({ |
| 3282 | + "@context": {"ex": "http://example/"}, |
| 3283 | + "@id": "ex:s", |
| 3284 | + "ex:p": { |
| 3285 | + "@id": { |
| 3286 | + "@id": "ex:s1", |
| 3287 | + "ex:p1": "o1" |
| 3288 | + } |
| 3289 | + } |
| 3290 | + }) |
| 3291 | + }, |
| 3292 | + "recursive-subject": { |
| 3293 | + input: %([{ |
| 3294 | + "@id": { |
| 3295 | + "@id": { |
| 3296 | + "@id": "http://example/s2", |
| 3297 | + "http://example/p2": [{"@id": "http://example/o2"}] |
| 3298 | + }, |
| 3299 | + "http://example/p1": [{"@id": "http://example/o1"}] |
| 3300 | + }, |
| 3301 | + "http://example/p": [{"@id": "http://example/o"}] |
| 3302 | + }]), |
| 3303 | + context: %({"ex": "http://example/"}), |
| 3304 | + output: %({ |
| 3305 | + "@context": {"ex": "http://example/"}, |
| 3306 | + "@id": { |
| 3307 | + "@id": { |
| 3308 | + "@id": "ex:s2", |
| 3309 | + "ex:p2": {"@id": "ex:o2"} |
| 3310 | + }, |
| 3311 | + "ex:p1": {"@id": "ex:o1"} |
| 3312 | + }, |
| 3313 | + "ex:p": {"@id": "ex:o"} |
| 3314 | + }) |
| 3315 | + }, |
| 3316 | + }.each do |name, params| |
| 3317 | + it(name) {run_compact(params.merge(rdfstar: true))} |
| 3318 | + end |
| 3319 | + end |
3116 | 3320 |
|
3117 | 3321 | context "problem cases" do
|
3118 | 3322 | {
|
@@ -3200,8 +3404,8 @@ def run_compact(params)
|
3200 | 3404 | expect(jld).to produce_jsonld(output, logger)
|
3201 | 3405 |
|
3202 | 3406 | # Compare expanded jld/output too to make sure list values remain ordered
|
3203 |
| - exp_jld = JSON::LD::API.expand(jld, processingMode: 'json-ld-1.1') |
3204 |
| - exp_output = JSON::LD::API.expand(output, processingMode: 'json-ld-1.1') |
| 3407 | + exp_jld = JSON::LD::API.expand(jld, processingMode: 'json-ld-1.1', rdfstar: params[:rdfstar]) |
| 3408 | + exp_output = JSON::LD::API.expand(output, processingMode: 'json-ld-1.1', rdfstar: params[:rdfstar]) |
3205 | 3409 | expect(exp_jld).to produce_jsonld(exp_output, logger)
|
3206 | 3410 | end
|
3207 | 3411 | end
|
|
0 commit comments