Skip to content

Commit db3772d

Browse files
committed
Improve examples.
Relates to w3c/json-ld-syntax#26.
1 parent ce1b4f0 commit db3772d

File tree

31 files changed

+65
-134
lines changed

31 files changed

+65
-134
lines changed

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ end
77

88
desc "Extract Examples"
99
task :examples do
10-
sh %(rm -rf examples yaml trig)
11-
sh %(bundle exec common/extract-examples.rb --example-dir examples --yaml-dir yaml --trig-dir trig index.html)
10+
sh %(rm -rf examples yaml)
11+
sh %(bundle exec common/extract-examples.rb --example-dir examples --yaml-dir yaml index.html)
1212
end

examples/example-003-JSON-LD-document-using-only-terms-expanded-.jsonld

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[{
2+
"@id": "http://me.markus-lanthaler.com/",
3+
"http://xmlns.com/foaf/0.1/name": [
4+
{"@value": "Markus Lanthaler"}
5+
],
6+
"http://xmlns.com/foaf/0.1/homepage": [
7+
{"@id": "http://www.markus-lanthaler.com/"}
8+
]
9+
}]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<table class="statements" data-result-for="JSON-LD document using only terms-expanded">
2+
<thead><tr>
3+
<th>Subject</th>
4+
<th>Property</th>
5+
<th>Value</th>
6+
</tr></thead>
7+
<tbody>
8+
<tr>
9+
<td>http://me.markus-lanthaler.com/</td>
10+
<td>foaf:name</td>
11+
<td>Markus Lanthaler</td>
12+
</tr>
13+
<tr>
14+
<td>http://me.markus-lanthaler.com/</td>
15+
<td>http://xmlns.com/foaf/0.1/homepage</td>
16+
<td>http://www.markus-lanthaler.com/</td>
17+
</tr>
18+
</tbody>
19+
</table>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
2+
<http://me.markus-lanthaler.com/> foaf:name "Markus Lanthaler";
3+
foaf:homepage <http://www.markus-lanthaler.com/> .

examples/example-009-JSON-LD-document-in-compact-form.jsonld

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
"@id": "http://me.markus-lanthaler.com/",
77
"name": "Markus Lanthaler",
88
"knows": [
9-
{
10-
"name": "Dave Longley"
11-
}
9+
{"name": "Dave Longley"}
1210
]
1311
}
Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
[
2-
{
3-
"@id": "_:b0",
4-
"http://xmlns.com/foaf/0.1/name": [
5-
{ "@value": "Dave Longley" }
6-
]
7-
},
8-
{
9-
"@id": "http://me.markus-lanthaler.com/",
10-
"http://xmlns.com/foaf/0.1/name": [
11-
{ "@value": "Markus Lanthaler" }
12-
],
13-
"http://xmlns.com/foaf/0.1/knows": [
14-
{ "@id": "_:b0" }
15-
]
16-
}
17-
]
1+
[{
2+
"@id": "http://me.markus-lanthaler.com/",
3+
"http://xmlns.com/foaf/0.1/name": [
4+
{ "@value": "Markus Lanthaler" }
5+
],
6+
"http://xmlns.com/foaf/0.1/knows": [
7+
{ "@id": "_:b0" }
8+
]
9+
}, {
10+
"@id": "_:b0",
11+
"http://xmlns.com/foaf/0.1/name": [
12+
{ "@value": "Dave Longley" }
13+
]
14+
}]

examples/example-011-Flattened-and-compacted-sample-document.jsonld

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
"name": "http://xmlns.com/foaf/0.1/name",
44
"knows": "http://xmlns.com/foaf/0.1/knows"
55
},
6-
"@graph": [
7-
{
8-
"@id": "_:b0",
9-
"name": "Dave Longley"
10-
}, {
11-
"@id": "http://me.markus-lanthaler.com/",
12-
"name": "Markus Lanthaler",
13-
"knows": { "@id": "_:b0" }
14-
}
15-
]
6+
"@graph": [{
7+
"@id": "http://me.markus-lanthaler.com/",
8+
"name": "Markus Lanthaler",
9+
"knows": { "@id": "_:b0" }
10+
}, {
11+
"@id": "_:b0",
12+
"name": "Dave Longley"
13+
}]
1614
}

examples/example-014-Term-definition-with-language-map.jsonld

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/example-016-Term-definition-with-datatype.jsonld

Lines changed: 0 additions & 3 deletions
This file was deleted.

trig/example-002-Sample-JSON-LD-document.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-003-JSON-LD-documenet-using-only-terms.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-003-JSON-LD-document-using-only-terms-expanded-.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-004-Sample-JSON-LD-document-using-an-IRI-instead-of-a-term-to-express-a-property.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-005-Expanded-JSON-LD-document-using-an-IRI.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-006-Expanded-sample-document.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-007-JSON-LD-context.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-008-Compacted-sample-document.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-009-JSON-LD-document-in-compact-form.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-010-Flattened-sample-document-in-expanded-form.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-011-Flattened-and-compacted-sample-document.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-013-Sample-Turtle-document-converted-to-JSON-LD.trig

Lines changed: 0 additions & 5 deletions
This file was deleted.

trig/example-014-Term-definition-with-language-map.trig

Whitespace-only changes.

trig/example-016-Term-definition-with-datatype.trig

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Example 003: JSON-LD document using only terms (expanded)
1+
Example 003: JSON-LD document using only terms-expanded
22
---
33
- "@id": http://me.markus-lanthaler.com/
4-
http://xmlns.com/foaf/0.1/homepage:
5-
- "@id": http://www.markus-lanthaler.com/
64
http://xmlns.com/foaf/0.1/name:
75
- "@value": Markus Lanthaler
6+
http://xmlns.com/foaf/0.1/homepage:
7+
- "@id": http://www.markus-lanthaler.com/

yaml/example-003-JSON-LD-documenet-using-only-terms.yml renamed to yaml/example-003-JSON-LD-document-using-only-terms-original.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 003: JSON-LD documenet using only terms
1+
Example 003: JSON-LD document using only terms-original
22
---
33
"@context":
44
name: http://xmlns.com/foaf/0.1/name
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Example 010: Flattened sample document in expanded form
22
---
3-
- "@id": _:b0
4-
http://xmlns.com/foaf/0.1/name:
5-
- "@value": Dave Longley
63
- "@id": http://me.markus-lanthaler.com/
74
http://xmlns.com/foaf/0.1/name:
85
- "@value": Markus Lanthaler
96
http://xmlns.com/foaf/0.1/knows:
107
- "@id": _:b0
8+
- "@id": _:b0
9+
http://xmlns.com/foaf/0.1/name:
10+
- "@value": Dave Longley

yaml/example-011-Flattened-and-compacted-sample-document.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Example 011: Flattened and compacted sample document
44
name: http://xmlns.com/foaf/0.1/name
55
knows: http://xmlns.com/foaf/0.1/knows
66
"@graph":
7-
- "@id": _:b0
8-
name: Dave Longley
97
- "@id": http://me.markus-lanthaler.com/
108
name: Markus Lanthaler
119
knows:
1210
"@id": _:b0
11+
- "@id": _:b0
12+
name: Dave Longley

yaml/example-014-Term-definition-with-language-map.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

yaml/example-016-Term-definition-with-datatype.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)