151
151
color : green;
152
152
background-color : inherit;
153
153
}
154
+ aside .example {
155
+ overflow-y : hidden;
156
+ }
157
+ /* example tab selection */
158
+ .ds-selector-tabs {
159
+ padding-bottom : 2em ;
160
+ }
161
+ .ds-selector-tabs .selectors {
162
+ padding : 0 ;
163
+ border-bottom : 1px solid # ccc ;
164
+ height : 28px ;
165
+ }
166
+ .ds-selector-tabs .selectors button {
167
+ display : inline-block;
168
+ min-width : 54px ;
169
+ text-align : center;
170
+ font-size : 11px ;
171
+ font-weight : bold;
172
+ height : 27px ;
173
+ padding : 0 8px ;
174
+ line-height : 27px ;
175
+ transition : all, 0.218s ;
176
+ border-top-right-radius : 2px ;
177
+ border-top-left-radius : 2px ;
178
+ color : # 666 ;
179
+ border : 1px solid transparent;
180
+ }
181
+ .ds-selector-tabs .selectors button : first-child {
182
+ margin-left : 2px ;
183
+ }
184
+ .ds-selector-tabs .selectors button .selected {
185
+ color : # 202020 !important ;
186
+ border : 1px solid # ccc ;
187
+ border-bottom : 1px solid # fff !important ;
188
+ }
189
+ .ds-selector-tabs .selectors button : hover {
190
+ background-color : transparent;
191
+ color : # 202020 ;
192
+ cursor : pointer;
193
+ }
194
+ .ds-selector-tabs pre , .ds-selector-tabs table {
195
+ display : none;
196
+ }
197
+ .ds-selector-tabs pre .selected , .ds-selector-tabs table .selected {
198
+ display : block;
199
+ }
154
200
</ style >
155
201
</ head >
156
202
@@ -351,43 +397,64 @@ <h2>Expansion</h2>
351
397
here is an example of JSON-LD that uses only < a > terms</ a >
352
398
and is fairly compact:</ p >
353
399
354
- < pre class ="example nohighlight " data-transform ="updateExample "
355
- title ="JSON-LD documenet using only terms ">
356
- <!--
357
- {
358
- "@context": {
359
- "name": "http://xmlns.com/foaf/0.1/name",
360
- "homepage": {
361
- "@id": "http://xmlns.com/foaf/0.1/homepage",
362
- "@type": "@id"
363
- }
364
- },
365
- "@id": "http://me.markus-lanthaler.com/",
366
- "name": "Markus Lanthaler",
367
- "homepage": "http://www.markus-lanthaler.com/"
368
- }
369
- -->
370
- </ pre >
371
-
372
- < script class ="example "
373
- data-result-for ="JSON-LD documenet using only terms "
374
- title ="JSON-LD document using only terms (expanded) ">
375
- [
376
- {
377
- "@id" : "http://me.markus-lanthaler.com/" ,
378
- "http://xmlns.com/foaf/0.1/homepage" : [
379
- {
380
- "@id" : "http://www.markus-lanthaler.com/"
381
- }
382
- ] ,
383
- "http://xmlns.com/foaf/0.1/name" : [
384
- {
385
- "@value" : "Markus Lanthaler"
386
- }
387
- ]
388
- }
389
- ]
390
- </ script >
400
+ < aside class ="example ds-selector-tabs "
401
+ title ="JSON-LD document using only terms ">
402
+ < div class ="selectors ">
403
+ < button class ="selected " data-selects ="expanded "> Expanded</ button >
404
+ < button data-selects ="statements "> Statements</ button >
405
+ < button data-selects ="turtle "> Turtle</ button >
406
+ </ div >
407
+ < pre class ="original selected " data-transform ="updateExample ">
408
+ <!--
409
+ {
410
+ "@context": {
411
+ "name": "http://xmlns.com/foaf/0.1/name",
412
+ "homepage": {
413
+ "@id": "http://xmlns.com/foaf/0.1/homepage",
414
+ "@type": "@id"
415
+ }
416
+ },
417
+ "@id": "http://me.markus-lanthaler.com/",
418
+ "name": "Markus Lanthaler",
419
+ "homepage": "http://www.markus-lanthaler.com/"
420
+ }
421
+ -->
422
+ </ pre >
423
+ < pre class ="expanded "
424
+ data-result-for ="JSON-LD document using only terms-expanded ">
425
+ <!--
426
+ [{
427
+ "@id": "http://me.markus-lanthaler.com/",
428
+ "http://xmlns.com/foaf/0.1/name": [
429
+ {"@value": "Markus Lanthaler"}
430
+ ],
431
+ "http://xmlns.com/foaf/0.1/homepage": [
432
+ {"@id": "http://www.markus-lanthaler.com/"}
433
+ ]
434
+ }]
435
+ -->
436
+ </ pre >
437
+ < table class ="statements "
438
+ data-result-for ="JSON-LD document using only terms-expanded ">
439
+ < thead > < tr > < th > Subject</ th > < th > Property</ th > < th > Value</ th > </ tr > </ thead >
440
+ < tbody >
441
+ < tr > < td > http://me.markus-lanthaler.com/</ td > < td > foaf:name</ td > < td > Markus Lanthaler</ td > </ tr >
442
+ < tr > < td > http://me.markus-lanthaler.com/</ td > < td > http://xmlns.com/foaf/0.1/homepage</ td > < td > http://www.markus-lanthaler.com/</ td > </ tr >
443
+ </ tbody >
444
+ </ table >
445
+ < pre class ="turtle "
446
+ data-content-type ="text/turtle "
447
+ data-result-for ="JSON-LD document using only terms-expanded "
448
+ data-transform ="updateExample "
449
+ data-to-rdf >
450
+ <!--
451
+ @prefix foaf: <http://xmlns.com/foaf/0.1/> .
452
+
453
+ <http://me.markus-lanthaler.com/> foaf:name "Markus Lanthaler";
454
+ foaf:homepage <http://www.markus-lanthaler.com/> .
455
+ -->
456
+ </ pre >
457
+ </ aside >
391
458
392
459
< p > The next input example uses one < a > IRI</ a > to express a < a > property</ a >
393
460
and an < a > array</ a > to encapsulate another, but
@@ -582,9 +649,7 @@ <h2>Flattening</h2>
582
649
"@id": "http://me.markus-lanthaler.com/",
583
650
"name": "Markus Lanthaler",
584
651
"knows": [
585
- {
586
- "name": "Dave Longley"
587
- }
652
+ {"name": "Dave Longley"}
588
653
]
589
654
}
590
655
-->
@@ -600,23 +665,20 @@ <h2>Flattening</h2>
600
665
data-flatten
601
666
title ="Flattened sample document in expanded form ">
602
667
<!--
603
- [
604
- {
605
- "@id": "_:b0",
606
- "http://xmlns.com/foaf/0.1/name": [
607
- { "@value": "Dave Longley" }
608
- ]
609
- },
610
- {
611
- "@id": "http://me.markus-lanthaler.com/",
612
- "http://xmlns.com/foaf/0.1/name": [
613
- { "@value": "Markus Lanthaler" }
614
- ],
615
- "http://xmlns.com/foaf/0.1/knows": [
616
- { "@id": "_:b0" }
617
- ]
618
- }
619
- ]
668
+ [{
669
+ "@id": "http://me.markus-lanthaler.com/",
670
+ "http://xmlns.com/foaf/0.1/name": [
671
+ { "@value": "Markus Lanthaler" }
672
+ ],
673
+ "http://xmlns.com/foaf/0.1/knows": [
674
+ { "@id": "_:b0" }
675
+ ]
676
+ }, {
677
+ "@id": "_:b0",
678
+ "http://xmlns.com/foaf/0.1/name": [
679
+ { "@value": "Dave Longley" }
680
+ ]
681
+ }]
620
682
-->
621
683
</ pre >
622
684
@@ -645,16 +707,14 @@ <h2>Flattening</h2>
645
707
"name": "http://xmlns.com/foaf/0.1/name",
646
708
"knows": "http://xmlns.com/foaf/0.1/knows"
647
709
},
648
- "@graph": [
649
- {
650
- "@id": "_:b0",
651
- "name": "Dave Longley"
652
- }, {
653
- "@id": "http://me.markus-lanthaler.com/",
654
- "name": "Markus Lanthaler",
655
- "knows": { "@id": "_:b0" }
656
- }
657
- ]
710
+ "@graph": [{
711
+ "@id": "http://me.markus-lanthaler.com/",
712
+ "name": "Markus Lanthaler",
713
+ "knows": { "@id": "_:b0" }
714
+ }, {
715
+ "@id": "_:b0",
716
+ "name": "Dave Longley"
717
+ }]
658
718
}
659
719
-->
660
720
</ pre >
@@ -3205,21 +3265,31 @@ <h3>Examples</h3>
3205
3265
< h4 > Language Map Term</ h4 >
3206
3266
< p > If the term definition has < code > "@container": "@language"</ code > , it will only match a
3207
3267
< a > value object</ a > having no < code > @type</ code > .</ p >
3208
- < pre class ="example " title ="Term definition with language map ">
3268
+
3269
+ < aside class ="example " data-ignore
3270
+ title ="Term definition with language map ">
3271
+ < pre data-transform ="updateExample ">
3272
+ <!--
3209
3273
{
3210
3274
"@context": {"t": {"@id": "http://example.org/t", "@container": "@language"}}
3211
3275
}
3212
- </ pre >
3213
- < p > The inverse context will contain the following:</ p >
3214
- < pre >
3215
- {
3216
- "@language": {
3217
- "@language": {"@none": "t"},
3218
- "@type": {"@none": "t"},
3219
- "@any": {"@none": "t"}
3276
+ -->
3277
+ </ pre >
3278
+
3279
+ < p > The inverse context will contain the following:</ p >
3280
+
3281
+ < pre data-transform ="updateExample ">
3282
+ <!--
3283
+ {
3284
+ "@language": {
3285
+ "@language": {"@none": "t"},
3286
+ "@type": {"@none": "t"},
3287
+ "@any": {"@none": "t"}
3288
+ }
3220
3289
}
3221
- }
3222
- </ pre >
3290
+ -->
3291
+ </ pre >
3292
+ </ aside >
3223
3293
3224
3294
< aside class ="example " data-ignore title ="Language map term with language value ">
3225
3295
< p > Given the < a > member</ a > < code > {"http://example.org/t": {"@value": "foo", "@type": "http:/example.org/type"}}</ code > ,
@@ -3242,21 +3312,31 @@ <h4>Language Map Term</h4>
3242
3312
< h4 > Datatyped Term</ h4 >
3243
3313
< p > If the term definition has a datatype, it will only match a
3244
3314
< a > value object</ a > having a matching datatype.</ p >
3245
- < pre class ="example " title ="Term definition with datatype ">
3315
+
3316
+ < aside class ="example " data-ignore
3317
+ title ="Term definition with datatype ">
3318
+ < pre data-transform ="updateExample ">
3319
+ <!--
3246
3320
{
3247
3321
"@context": {"t": {"@id": "http://example.org/t", "@type": "http:/example.org/type"}}
3248
3322
}
3249
- </ pre >
3250
- < p > The inverse context will contain the following:</ p >
3251
- < pre >
3323
+ -->
3324
+ </ pre >
3325
+
3326
+ < p > The inverse context will contain the following:</ p >
3327
+
3328
+ < pre data-transform ="updateExample ">
3329
+ <!--
3252
3330
{
3253
3331
"@none": {
3254
3332
"@language": {},
3255
3333
"@type": {"http:/example.org/type": "t"},
3256
3334
"@any": {"@none": "t"}
3257
3335
}
3258
3336
}
3259
- </ pre >
3337
+ -->
3338
+ </ pre >
3339
+ </ aside >
3260
3340
3261
3341
< aside class ="example " data-ignore title ="Datatyped term with datatyped value ">
3262
3342
< p > Given the < a > member</ a > < code > {"http://example.org/t": {"@value": "foo", "@type": "http:/example.org/type"}}</ code > ,
0 commit comments