Skip to content

Commit cfca7c8

Browse files
committed
Change "dc" as a prefix to "dcterms".
1 parent df7e8e0 commit cfca7c8

File tree

2 files changed

+40
-32
lines changed

2 files changed

+40
-32
lines changed

common/extract-examples.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424

2525
PREFIXES = {
2626
dc: "http://purl.org/dc/terms/",
27+
dct: "http://purl.org/dc/terms/",
28+
dcterms:"http://purl.org/dc/terms/",
29+
dc11: "http://purl.org/dc/elements/1.1/",
30+
dce: "http://purl.org/dc/elements/1.1/",
2731
cred: "https://w3id.org/credentials#",
2832
ex: "http://example.org/",
2933
foaf: "http://xmlns.com/foaf/0.1/",
@@ -90,11 +94,11 @@ def table_to_dataset(table)
9094
else RDF::Vocabulary.expand_pname(cell)
9195
end
9296
when 'Property'
93-
predicate = RDF::Vocabulary.expand_pname(cell)
97+
predicate = RDF::Vocabulary.expand_pname(cell.sub("dcterms:", "dc:"))
9498
when 'Value'
9599
object = case cell
96100
when /^_:/ then RDF::Node.intern(cell[2..-1])
97-
when /^\w+:/ then RDF::Vocabulary.expand_pname(cell)
101+
when /^\w+:/ then RDF::Vocabulary.expand_pname(cell.sub("dcterms:", "dc:"))
98102
else RDF::Literal(cell)
99103
end
100104
when 'Value Type'
@@ -103,7 +107,7 @@ def table_to_dataset(table)
103107
else
104108
# We might think something was an IRI, but determine that it's not
105109
object = RDF::Literal(object.to_s) unless object.literal?
106-
object.datatype = RDF::Vocabulary.expand_pname(cell)
110+
object.datatype = RDF::Vocabulary.expand_pname(cell.sub("dcterms:", "dc:"))
107111
end
108112
when 'Language'
109113
case cell
@@ -150,7 +154,7 @@ def dataset_to_table(repo)
150154
row << (statement.graph_name || "&nbsp;").to_s if has_graph
151155
row += statement.to_triple.map do |term|
152156
if term.uri? && RDF::Vocabulary.find_term(term)
153-
RDF::Vocabulary.find_term(term).pname
157+
RDF::Vocabulary.find_term(term).pname.sub("dc:", "dcterms:")
154158
else
155159
term.to_s
156160
end

index.html

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,11 @@ <h2>Syntax Tokens and Keywords</h2>
601601
</tr></thead>
602602
<tbody>
603603
<tr>
604-
<td>dc</td>
604+
<td>dc11</td>
605+
<td>http://purl.org/dc/elements/1.1/</td>
606+
</tr>
607+
<tr>
608+
<td>dcterms</td>
605609
<td>http://purl.org/dc/terms/</td>
606610
</tr>
607611
<tr>
@@ -640,7 +644,7 @@ <h2>Syntax Tokens and Keywords</h2>
640644
</table>
641645

642646
<p>These are used within this document as part of a <a>compact IRI</a>
643-
as a shorthand for the resulting <a>absolute IRI</a>, such as <code>dc:title</code>
647+
as a shorthand for the resulting <a>absolute IRI</a>, such as <code>dcterms:title</code>
644648
used to represent <code>http://purl.org/dc/terms/title</code>.</p>
645649
</section>
646650

@@ -1841,8 +1845,8 @@ <h1>Advanced Concepts</h1>
18411845
<tr><td>_:b0</td><td>foaf:name</td><td>Manu Sporny</td><td></td></tr>
18421846
<tr><td>_:b0</td><td>foaf:homepage</td><td>http://manu.sporny.org/</td><td></td></tr>
18431847
<tr><td>_:b0</td><td>foaf:depiction</td><td>http://twitter.com/account/profile_image/manusporny</td><td></td></tr>
1844-
<tr><td>_:b1</td><td>dc:title</td><td>The Empire State Building</td><td></td></tr>
1845-
<tr><td>_:b1</td><td>dc:description</td><td>The Empire State Building is a 102-story landmark in New York City.</td><td></td></tr>
1848+
<tr><td>_:b1</td><td>dcterms:title</td><td>The Empire State Building</td><td></td></tr>
1849+
<tr><td>_:b1</td><td>dcterms:description</td><td>The Empire State Building is a 102-story landmark in New York City.</td><td></td></tr>
18461850
<tr><td>_:b2</td><td>geo:lat</td><td>40.75</td><td>xsd:decimal</td></tr>
18471851
<tr><td>_:b2</td><td>geo:long</td><td>73.98</td><td>xsd:decimal</td></tr>
18481852
<tr><td>_:b1</td><td>schema:geo</td><td>_:b2</td><td></td></tr>
@@ -1854,7 +1858,7 @@ <h1>Advanced Concepts</h1>
18541858
data-transform="updateExample"
18551859
data-to-rdf>
18561860
<!--
1857-
@prefix dc: <http://purl.org/dc/terms/> .
1861+
@prefix dcterms: <http://purl.org/dc/terms/> .
18581862
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
18591863
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
18601864
@prefix schema: <http://schema.org/> .
@@ -1867,8 +1871,8 @@ <h1>Advanced Concepts</h1>
18671871
] .
18681872
18691873
[
1870-
dc:title "The Empire State Building";
1871-
dc:description "The Empire State Building is a 102-story landmark in New York City.";
1874+
dcterms:title "The Empire State Building";
1875+
dcterms:description "The Empire State Building is a 102-story landmark in New York City.";
18721876
schema:geo [
18731877
geo:lat 40.75;
18741878
geo:long 73.98
@@ -1952,8 +1956,8 @@ <h1>Advanced Concepts</h1>
19521956
<tr><td>_:b0</td><td>foaf:name</td><td>Manu Sporny</td><td></td></tr>
19531957
<tr><td>_:b0</td><td>foaf:homepage</td><td>http://manu.sporny.org/</td><td></td></tr>
19541958
<tr><td>_:b0</td><td>foaf:depiction</td><td>http://twitter.com/account/profile_image/manusporny</td><td></td></tr>
1955-
<tr><td>_:b1</td><td>dc:title</td><td>The Empire State Building</td><td></td></tr>
1956-
<tr><td>_:b1</td><td>dc:description</td><td>The Empire State Building is a 102-story landmark in New York City.</td><td></td></tr>
1959+
<tr><td>_:b1</td><td>dcterms:title</td><td>The Empire State Building</td><td></td></tr>
1960+
<tr><td>_:b1</td><td>dcterms:description</td><td>The Empire State Building is a 102-story landmark in New York City.</td><td></td></tr>
19571961
<tr><td>_:b2</td><td>geo:lat</td><td>40.75</td><td>xsd:decimal</td></tr>
19581962
<tr><td>_:b2</td><td>geo:long</td><td>73.98</td><td>xsd:decimal</td></tr>
19591963
<tr><td>_:b1</td><td>schema:geo</td><td>_:b2</td><td></td></tr>
@@ -1965,7 +1969,7 @@ <h1>Advanced Concepts</h1>
19651969
data-transform="updateExample"
19661970
data-to-rdf>
19671971
<!--
1968-
@prefix dc: <http://purl.org/dc/terms/> .
1972+
@prefix dcterms: <http://purl.org/dc/terms/> .
19691973
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
19701974
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
19711975
@prefix schema: <http://schema.org/> .
@@ -1978,8 +1982,8 @@ <h1>Advanced Concepts</h1>
19781982
] .
19791983
19801984
[
1981-
dc:title "The Empire State Building";
1982-
dc:description "The Empire State Building is a 102-story landmark in New York City.";
1985+
dcterms:title "The Empire State Building";
1986+
dcterms:description "The Empire State Building is a 102-story landmark in New York City.";
19831987
schema:geo [
19841988
geo:lat 40.75;
19851989
geo:long 73.98
@@ -3680,7 +3684,7 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
36803684
data-to-rdf>
36813685
<thead><tr><th>Subject</th><th>Property</th><th>Value</th><th>Value Type</th></tr></thead>
36823686
<tbody>
3683-
<tr><td>http://example.com/docs/1</td><td>dc:modified</td><td>2010-05-29T14:17:39+02:00</td><td>xsd:dateTime</td></tr>
3687+
<tr><td>http://example.com/docs/1</td><td>dcterms:modified</td><td>2010-05-29T14:17:39+02:00</td><td>xsd:dateTime</td></tr>
36843688
</tbody>
36853689
</table>
36863690
<pre class="turtle"
@@ -3689,10 +3693,10 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
36893693
data-transform="updateExample"
36903694
data-to-rdf>
36913695
<!--
3692-
@prefix dc: <http://purl.org/dc/terms/> .
3696+
@prefix dcterms: <http://purl.org/dc/terms/> .
36933697
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
36943698
3695-
<http://example.com/docs/1> dc:modified "2010-05-29T14:17:39+02:00"^^xsd:dateTime .
3699+
<http://example.com/docs/1> dcterms:modified "2010-05-29T14:17:39+02:00"^^xsd:dateTime .
36963700
-->
36973701
</pre>
36983702
</aside>
@@ -3749,7 +3753,7 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
37493753
data-to-rdf>
37503754
<thead><tr><th>Subject</th><th>Property</th><th>Value</th><th>Value Type</th></tr></thead>
37513755
<tbody>
3752-
<tr><td>_:b0</td><td>dc:modified</td><td>2010-05-29T14:17:39+02:00</td><td>xsd:dateTime</td></tr>
3756+
<tr><td>_:b0</td><td>dcterms:modified</td><td>2010-05-29T14:17:39+02:00</td><td>xsd:dateTime</td></tr>
37533757
</tbody>
37543758
</table>
37553759
<pre class="turtle"
@@ -3758,10 +3762,10 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
37583762
data-transform="updateExample"
37593763
data-to-rdf>
37603764
<!--
3761-
@prefix dc: <http://purl.org/dc/terms/> .
3765+
@prefix dcterms: <http://purl.org/dc/terms/> .
37623766
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
37633767
3764-
[ dc:modified "2010-05-29T14:17:39+02:00"^^xsd:dateTime ] .
3768+
[ dcterms:modified "2010-05-29T14:17:39+02:00"^^xsd:dateTime ] .
37653769
-->
37663770
</pre>
37673771
</aside>
@@ -3837,7 +3841,7 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
38373841
</tr>
38383842
<tr>
38393843
<td>http://example.org/posts#TripToWestVirginia</td>
3840-
<td>dc:modified</td>
3844+
<td>dcterms:modified</td>
38413845
<td>2010-05-29T14:17:39+02:00</td>
38423846
<td>xsd:dateTime</td>
38433847
</tr>
@@ -3849,12 +3853,12 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
38493853
data-transform="updateExample"
38503854
data-to-rdf>
38513855
<!--
3852-
@prefix dc: <http://purl.org/dc/terms/> .
3856+
@prefix dcterms: <http://purl.org/dc/terms/> .
38533857
@prefix schema: <http://schema.org/> .
38543858
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
38553859
38563860
<http://example.org/posts#TripToWestVirginia> a ****schema:BlogPosting****;
3857-
dc:modified "2010-05-29T14:17:39+02:00"^^****xsd:dateTime**** .
3861+
dcterms:modified "2010-05-29T14:17:39+02:00"^^****xsd:dateTime**** .
38583862
-->
38593863
</pre>
38603864
</aside>
@@ -4098,7 +4102,7 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
40984102
data-transform="updateExample"
40994103
data-to-rdf>
41004104
<!--
4101-
@prefix dc: <http://purl.org/dc/terms/> .
4105+
@prefix dcterms: <http://purl.org/dc/terms/> .
41024106
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
41034107
41044108
<http://example.com/people#john> foaf:name "John Smith";
@@ -4673,9 +4677,9 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
46734677
<pre class="original selected nohighlight" data-transform="updateExample">
46744678
<!--
46754679
{
4676-
"@context": {"dc": "http://purl.org/dc/terms/"},
4680+
"@context": {"dcterms": "http://purl.org/dc/terms/"},
46774681
"@id": "http://example.org/articles/8",
4678-
"dc:title": ****[
4682+
"dcterms:title": ****[
46794683
{
46804684
"@value": "Das Kapital",
46814685
"@language": "de"
@@ -4713,13 +4717,13 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
47134717
<tbody>
47144718
<tr>
47154719
<td>http://example.org/articles/8</td>
4716-
<td>dc:title</td>
4720+
<td>dcterms:title</td>
47174721
<td>Das Kapital</td>
47184722
<td>de</td>
47194723
</tr>
47204724
<tr>
47214725
<td>http://example.org/articles/8</td>
4722-
<td>dc:title</td>
4726+
<td>dcterms:title</td>
47234727
<td>Capital</td>
47244728
<td>en</td>
47254729
</tr>
@@ -4731,9 +4735,9 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
47314735
data-transform="updateExample"
47324736
data-to-rdf>
47334737
<!--
4734-
@prefix dc: <http://purl.org/dc/terms/> .
4738+
@prefix dcterms: <http://purl.org/dc/terms/> .
47354739
4736-
<http://example.org/articles/8> dc:title
4740+
<http://example.org/articles/8> dcterms:title
47374741
****"Das Kapital"@de, "Capital"@en**** .
47384742
-->
47394743
</pre>

0 commit comments

Comments
 (0)