@@ -488,23 +488,48 @@ <h2>Syntax Tokens and Keywords</h2>
488
488
< a class ="sectionRef " href ="#interpreting-json-as-json-ld "> </ a > . For convenience, normative
489
489
statements for documents are often phrased as statements on the properties of the document.</ p >
490
490
491
- < p > This specification makes use of the following namespaces:</ p >
492
- < dl >
493
- < dt > < code > dc</ code > :</ dt >
494
- < dd > < code > http://purl.org/dc/terms/</ code > </ dd >
495
- < dt > < code > cred</ code > :</ dt >
496
- < dd > < code > https://w3id.org/credentials#</ code > </ dd >
497
- < dt > < code > foaf</ code > :</ dt >
498
- < dd > < code > http://xmlns.com/foaf/0.1/</ code > </ dd >
499
- < dt > < code > prov</ code > </ dt >
500
- < dd > < code > http://www.w3.org/ns/prov#</ code > </ dd >
501
- < dt > < code > rdf</ code > :</ dt >
502
- < dd > < code > http://www.w3.org/1999/02/22-rdf-syntax-ns#</ code > </ dd >
503
- < dt > < code > schema</ code > :</ dt >
504
- < dd > < code > http://schema.org/</ code > </ dd >
505
- < dt > < code > xsd</ code > :</ dt >
506
- < dd > < code > http://www.w3.org/2001/XMLSchema#</ code > </ dd >
507
- </ dl >
491
+ < p > This specification makes use of the following namespace prefixes:</ p >
492
+ < table class ="simple ">
493
+ < thead > < tr >
494
+ < th > Prefix</ th >
495
+ < th > IRI</ th >
496
+ </ tr > </ thead >
497
+ < tbody >
498
+ < tr >
499
+ < td > dc</ td >
500
+ < td > http://purl.org/dc/terms/</ td >
501
+ </ tr >
502
+ < tr >
503
+ < td > cred</ td >
504
+ < td > https://w3id.org/credentials#</ td >
505
+ </ tr >
506
+ < tr >
507
+ < td > foaf</ td >
508
+ < td > http://xmlns.com/foaf/0.1/</ td >
509
+ </ tr >
510
+ < tr >
511
+ < td > geojson</ td >
512
+ < td > https://purl.org/geojson/vocab#</ td >
513
+ </ tr >
514
+ < tr >
515
+ < td > prov</ td >
516
+ < td > http://www.w3.org/ns/prov#</ td >
517
+ </ tr >
518
+ < tr >
519
+ < td > rdf</ td >
520
+ < td > http://www.w3.org/1999/02/22-rdf-syntax-ns#</ td >
521
+ </ tr >
522
+ < tr >
523
+ < td > schema</ td >
524
+ < td > http://schema.org/</ td >
525
+ </ tr >
526
+ < tr >
527
+ < td > xsd</ td >
528
+ < td > http://www.w3.org/2001/XMLSchema#</ td >
529
+ </ tr >
530
+ </ tbody >
531
+ </ table >
532
+
508
533
< p > These are used within this document as part of a < a > compact IRI</ a >
509
534
as a shorthand for the resulting < a > absolute IRI</ a > , such as < code > dc:title</ code >
510
535
used to represent < code > http://purl.org/dc/terms/title</ code > .</ p >
@@ -593,6 +618,7 @@ <h2>The Context</h2>
593
618
look something like this:</ p >
594
619
595
620
< pre class ="example nohighlight " data-transform ="updateExample "
621
+ data-context-for ="Sample JSON document "
596
622
title ="Context for the sample document in the previous section ">
597
623
<!--
598
624
{
@@ -1076,13 +1102,13 @@ <h1>Advanced Concepts</h1>
1076
1102
<!--
1077
1103
[
1078
1104
{
1079
- ****"@context": "http ://example .org/contexts/person.jsonld",****
1105
+ ****"@context": "https ://json-ld .org/contexts/person.jsonld",****
1080
1106
"name": "Manu Sporny",
1081
1107
"homepage": "http://manu.sporny.org/",
1082
1108
"depiction": "http://twitter.com/account/profile_image/manusporny"
1083
1109
},
1084
1110
{
1085
- ****"@context": "http ://example .org/contexts/place.jsonld",****
1111
+ ****"@context": "https ://json-ld .org/contexts/place.jsonld",****
1086
1112
"name": "The Empire State Building",
1087
1113
"description": "The Empire State Building is a 102-story landmark in New York City.",
1088
1114
"geo": {
@@ -1275,6 +1301,7 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
1275
1301
</ pre >
1276
1302
< p > If this document were located at < code > http://example/document</ code > , it would expand as follows:</ p >
1277
1303
< pre class ="example nohighlight " data-transform ="updateExample "
1304
+ data-result-for ="Using "" as the vocabulary mapping "
1278
1305
title ="Using "" as the vocabulary mapping (expanded) ">
1279
1306
<!--
1280
1307
[{
@@ -1629,7 +1656,8 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
1629
1656
definition of < em > term2</ em > if < em > term2</ em > also depends on
1630
1657
< em > term1</ em > . For example, the following < a > context</ a > definition
1631
1658
is illegal:</ p >
1632
- < pre class ="example nohighlight " data-transform ="updateExample "
1659
+ < pre class ="illegal-example nohighlight " data-transform ="updateExample "
1660
+ data-ignore
1633
1661
title ="Illegal circular definition of terms within a context ">
1634
1662
<!--
1635
1663
{
@@ -1680,6 +1708,7 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
1680
1708
< p > Expanding this document, uses a combination of terms defined in the outer context, and those defined specifically for that term in an < a > embedded context</ a > .</ p >
1681
1709
1682
1710
< pre class ="example nohighlight " data-transform ="updateExample "
1711
+ data-result-for ="Defining an @context within a term definition "
1683
1712
title ="Expanded document using a scoped context ">
1684
1713
<!--
1685
1714
[{
@@ -1805,13 +1834,24 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
1805
1834
< tbody >
1806
1835
< tr >
1807
1836
< td > http://example.com/docs/1</ td >
1808
- < td > http://purl.org/dc/terms/ modified</ td >
1837
+ < td > dc: modified</ td >
1809
1838
< td > 2010-05-29T14:17:39+02:00</ td >
1810
1839
< td > xsd:dateTime</ td >
1811
1840
</ tr >
1812
1841
</ tbody >
1813
1842
</ table >
1814
1843
1844
+ < script class ="example " data-content-type ="text/turtle "
1845
+ title ="term definition with type coercion Turtle "
1846
+ data-result-for ="Expanded term definition with type coercion "
1847
+ data-to-rdf >
1848
+ <!--
1849
+ @prefix dc : < http ://purl.org/dc/terms/> .
1850
+ @prefix xsd : < http ://www.w3.org/2001/XMLSchema#> .
1851
+ < http ://example.com/docs/1> dc:modified "2010-05-29T14:17:39+02:00"^^xsd:dateTime .
1852
+ -->
1853
+ </ script >
1854
+
1815
1855
< p > The second example uses the expanded form of setting the type information
1816
1856
in the body of a JSON-LD document:</ p >
1817
1857
@@ -1865,6 +1905,19 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
1865
1905
-->
1866
1906
</ pre >
1867
1907
1908
+ < script class ="example " data-content-type ="text/turtle "
1909
+ title ="Example demonstrating the context-sensitivity for @type Turtle "
1910
+ data-result-for ="Example demonstrating the context-sensitivity for @type "
1911
+ data-to-rdf >
1912
+ <!--
1913
+ @prefix dc : < http ://purl.org/dc/terms/> .
1914
+ @prefix schema : < http ://schema.org/> .
1915
+ @prefix xsd : < http ://www.w3.org/2001/XMLSchema#> .
1916
+ < http ://example.org/posts#TripToWestVirginia> a schema:BlogPosting;
1917
+ dc :modified "2010-05-29T14:17:39+02:00" ^ ^ xsd :dateTime .
1918
+ -->
1919
+ </ script >
1920
+
1868
1921
< p > The first use of < code > @type</ code > associates a < a > node type</ a >
1869
1922
(< code > http://schema.org/BlogPosting</ code > ) with the < a > node</ a > ,
1870
1923
which is expressed using the < code > @id</ code > < a > keyword</ a > .
@@ -1961,6 +2014,21 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
1961
2014
1962
2015
< p > The example shown above would generate the following data:</ p >
1963
2016
2017
+ < script class ="example " data-content-type ="text/turtle "
2018
+ title ="Expanded term definition with types Turtle "
2019
+ data-result-for ="Expanded term definition with types "
2020
+ data-to-rdf >
2021
+ <!--
2022
+ @prefix dc: < http ://purl.org/dc/terms/> .
2023
+ @prefix foaf : < http ://xmlns.com/foaf/0.1/> .
2024
+ < http ://example.com/people#john> foaf:name "John Smith";
2025
+ foaf :age 41 ;
2026
+ foaf :homepage < http ://personal.example.org/>,
2027
+ < http ://work.example.com/jsmith/>
2028
+ .
2029
+ -->
2030
+ </ script >
2031
+
1964
2032
< table class ="example ">
1965
2033
< thead > < tr >
1966
2034
< th > Subject</ th >
@@ -2277,7 +2345,8 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
2277
2345
"@language": "en"
2278
2346
}
2279
2347
]****
2280
- }-->
2348
+ }
2349
+ -->
2281
2350
</ pre >
2282
2351
2283
2352
< p > The example shown above would generate the following data, again with
@@ -2474,11 +2543,13 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
2474
2543
2475
2544
< pre class ="example " data-transform ="updateExample "
2476
2545
data-content-type ="text/turtle "
2546
+ data-result-for ="Specifying that a collection is ordered in the context "
2547
+ data-to-rdf
2477
2548
title ="An ordered collection of values in Turtle ">
2478
2549
<!--
2479
2550
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
2480
2551
2481
- <http://example.org/people#joebob> foaf:nick ("joe" "bob" "jaybe ") .
2552
+ <http://example.org/people#joebob> foaf:nick ("joe" "bob" "jaybee ") .
2482
2553
-->
2483
2554
</ pre >
2484
2555
@@ -2488,7 +2559,7 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
2488
2559
< em > coordinates</ em > are an ordered list of < em > positions</ em > , which are
2489
2560
represented as an array of two or more numbers:</ p >
2490
2561
2491
- < pre class ="example changed "
2562
+ < pre class ="example changed nohighlight " data-transform =" updateExample "
2492
2563
data-content-type ="application/json "
2493
2564
title ="Coordinates expressed in GeoJSON ">
2494
2565
{
@@ -2505,7 +2576,7 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
2505
2576
]
2506
2577
]
2507
2578
}
2508
- //...
2579
+ #### //...####
2509
2580
}
2510
2581
</ pre >
2511
2582
@@ -2580,21 +2651,24 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
2580
2651
2581
2652
< pre class ="example changed "
2582
2653
data-content-type ="text/turtle "
2654
+ data-transform ="updateExample "
2655
+ data-to-rdf
2656
+ data-result-for ="Coordinates expressed in JSON-LD "
2583
2657
title ="Coordinates expressed in Turtle ">
2584
2658
<!--
2585
2659
@prefix geojson: <https://purl.org/geojson/vocab#>.
2586
2660
2587
2661
[
2588
2662
a geojson:Feature ;
2589
- geojson:bbox (-10.0 -10.0 10.0 10.0 ) ;
2663
+ geojson:bbox (-1.0e1 -1.0e1 1.0e1 1.0e1 ) ;
2590
2664
geojson:geometry [
2591
2665
a geojson:Polygon ;
2592
2666
geojson:coordinates (
2593
2667
(
2594
- (-10.0 -10.0 )
2595
- (10.0 -10.0 )
2596
- (10.0 10.0 )
2597
- (-10.0 -10.0 )
2668
+ (-1.0e1 -1.0e1 )
2669
+ (1.0e1 -1.0e1 )
2670
+ (1.0e1 1.0e1 )
2671
+ (-1.0e1 -1.0e1 )
2598
2672
)
2599
2673
)
2600
2674
]
@@ -3151,6 +3225,7 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
3151
3225
<!--
3152
3226
{
3153
3227
"@context": {
3228
+ ****"@version": 1.1,****
3154
3229
"vocab": "http://example.com/vocab/",
3155
3230
"label": {
3156
3231
"@id": "vocab:label",
@@ -4704,6 +4779,7 @@ <h3>Graph Containers</h3>
4704
4779
4705
4780
< pre class ="example nohighlight " data-transform ="updateExample "
4706
4781
data-content-type ="http "
4782
+ data-ignore
4707
4783
title ="Referencing a JSON-LD context from a JSON document via an HTTP Link Header ">
4708
4784
<!--
4709
4785
GET /ordinary-json-document.json HTTP/1.1
@@ -4742,6 +4818,7 @@ <h3>Graph Containers</h3>
4742
4818
4743
4819
< pre class ="example nohighlight " data-transform ="updateExample "
4744
4820
data-content-type ="text/html "
4821
+ data-ignore
4745
4822
title ="Embedding JSON-LD in HTML ">
4746
4823
<!--
4747
4824
****<script type="application/ld+json">****
@@ -4809,6 +4886,7 @@ <h1>Data Model</h1>
4809
4886
i.e., nodes which are not connected by an < a > edge</ a > to any other < a > node</ a > .
4810
4887
< pre class ="illegal-example "
4811
4888
data-transform ="updateExample "
4889
+ data-ignore
4812
4890
title ="Illegal Unconnected Node ">
4813
4891
<!--
4814
4892
{
@@ -5560,6 +5638,8 @@ <h3>Serializing/Deserializing RDF</h3>
5560
5638
5561
5639
< pre class ="example " data-transform ="updateExample "
5562
5640
data-content-type ="text/turtle "
5641
+ data-result-for ="Flattened and expanded form for the previous example "
5642
+ data-to-rdf
5563
5643
title ="Turtle representation of expanded/flattened document ">
5564
5644
<!--
5565
5645
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@@ -5663,6 +5743,8 @@ <h4>Prefix definitions</h4>
5663
5743
5664
5744
< pre class ="example " data-transform ="updateExample "
5665
5745
data-content-type ="text/turtle "
5746
+ data-result-for ="The same set of statements serialized in JSON-LD "
5747
+ data-to-rdf
5666
5748
title ="A set of statements serialized in Turtle ">
5667
5749
<!--
5668
5750
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@@ -5697,6 +5779,8 @@ <h4>Embedding</h4>
5697
5779
5698
5780
< pre class ="example " data-transform ="updateExample "
5699
5781
data-content-type ="text/turtle "
5782
+ data-to-rdf
5783
+ data-result-for ="Same embedding example in JSON-LD "
5700
5784
title ="Embedding in Turtle ">
5701
5785
<!--
5702
5786
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@@ -5757,6 +5841,8 @@ <h4>Conversion of native data types</h4>
5757
5841
5758
5842
< pre class ="example " data-transform ="updateExample "
5759
5843
data-content-type ="text/turtle "
5844
+ data-result-for ="JSON-LD using native data types for numbers and boolean values "
5845
+ data-to-rdf
5760
5846
title ="Same example in Turtle using typed literals ">
5761
5847
<!--
5762
5848
@prefix ex: <http://example.com/vocab#> .
@@ -5776,6 +5862,8 @@ <h4>Lists</h4>
5776
5862
5777
5863
< pre class ="example " data-transform ="updateExample "
5778
5864
data-content-type ="text/turtle "
5865
+ data-to-rdf
5866
+ data-result-for ="Same example with a list of values in JSON-LD "
5779
5867
title ="A list of values in Turtle ">
5780
5868
<!--
5781
5869
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@@ -5812,7 +5900,9 @@ <h3>RDFa</h3>
5812
5900
homepages in RDFa [[RDFA-CORE]].</ p >
5813
5901
5814
5902
< pre class ="example nohighlight " data-transform ="updateExample "
5815
- data-content-type ="text/html "
5903
+ data-content-type ="text/html "
5904
+ data-to-rdf
5905
+ data-result-for ="Same description in JSON-LD (context shared among node objects) "
5816
5906
title ="RDFa fragment that describes three people ">
5817
5907
<!--
5818
5908
<div ****prefix="foaf: http://xmlns.com/foaf/0.1/"****>
@@ -5874,7 +5964,8 @@ <h3>Microformats</h3>
5874
5964
how Microformats [[MICROFORMATS]] are represented in JSON-LD.</ p >
5875
5965
5876
5966
< pre class ="example " data-transform ="updateExample "
5877
- data-content-type ="text/html "
5967
+ data-content-type ="text/html "
5968
+ data-ignore
5878
5969
title ="HTML fragment with a simple Microformats hCard ">
5879
5970
<!--
5880
5971
<div class="vcard">
@@ -5915,8 +6006,10 @@ <h3>Microdata</h3>
5915
6006
a Microdata Work item.</ p >
5916
6007
5917
6008
< pre class ="example " data-transform ="updateExample "
5918
- data-content-type ="text/html "
5919
- title ="HTML fragments that describes a book using microdata ">
6009
+ data-content-type ="text/html "
6010
+ data-result-for ="Same book description in JSON-LD (avoiding contexts) "
6011
+ data-to-rdf
6012
+ title ="HTML that describes a book using microdata ">
5920
6013
<!--
5921
6014
<dl itemscope
5922
6015
itemtype="http://purl.org/vocab/frbr/core#Work"
0 commit comments