Skip to content

Commit

Permalink
Use "dcterms" instead of both "dc" and "dc11".
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Apr 19, 2019
1 parent 23a2bf3 commit 181b7e2
Show file tree
Hide file tree
Showing 60 changed files with 276 additions and 272 deletions.
12 changes: 8 additions & 4 deletions common/extract-examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

PREFIXES = {
dc: "http://purl.org/dc/terms/",
dct: "http://purl.org/dc/terms/",
dcterms:"http://purl.org/dc/terms/",
dc11: "http://purl.org/dc/elements/1.1/",
dce: "http://purl.org/dc/elements/1.1/",
cred: "https://w3id.org/credentials#",
ex: "http://example.org/",
foaf: "http://xmlns.com/foaf/0.1/",
Expand Down Expand Up @@ -90,11 +94,11 @@ def table_to_dataset(table)
else RDF::Vocabulary.expand_pname(cell)
end
when 'Property'
predicate = RDF::Vocabulary.expand_pname(cell)
predicate = RDF::Vocabulary.expand_pname(cell.sub("dcterms:", "dc:"))
when 'Value'
object = case cell
when /^_:/ then RDF::Node.intern(cell[2..-1])
when /^\w+:/ then RDF::Vocabulary.expand_pname(cell)
when /^\w+:/ then RDF::Vocabulary.expand_pname(cell.sub("dcterms:", "dc:"))
else RDF::Literal(cell)
end
when 'Value Type'
Expand All @@ -103,7 +107,7 @@ def table_to_dataset(table)
else
# We might think something was an IRI, but determine that it's not
object = RDF::Literal(object.to_s) unless object.literal?
object.datatype = RDF::Vocabulary.expand_pname(cell)
object.datatype = RDF::Vocabulary.expand_pname(cell.sub("dcterms:", "dc:"))
end
when 'Language'
case cell
Expand Down Expand Up @@ -150,7 +154,7 @@ def dataset_to_table(repo)
row << (statement.graph_name || "&nbsp;").to_s if has_graph
row += statement.to_triple.map do |term|
if term.uri? && RDF::Vocabulary.find_term(term)
RDF::Vocabulary.find_term(term).pname
RDF::Vocabulary.find_term(term).pname.sub("dc:", "dcterms:")
else
term.to_s
end
Expand Down
2 changes: 1 addition & 1 deletion tests/frame/0001-frame.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#"
},
"@type": "ex:Library",
Expand Down
10 changes: 5 additions & 5 deletions tests/frame/0001-in.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#",
"ex:contains": {"@type": "@id"}
},
Expand All @@ -13,15 +13,15 @@
{
"@id": "http://example.org/test#book",
"@type": "ex:Book",
"dc:contributor": "Writer",
"dc:title": "My Book",
"dcterms:contributor": "Writer",
"dcterms:title": "My Book",
"ex:contains": "http://example.org/test#chapter"
},
{
"@id": "http://example.org/test#chapter",
"@type": "ex:Chapter",
"dc:description": "Fun",
"dc:title": "Chapter One"
"dcterms:description": "Fun",
"dcterms:title": "Chapter One"
}
]
}
10 changes: 5 additions & 5 deletions tests/frame/0001-out.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#"
},
"@graph": [{
Expand All @@ -9,13 +9,13 @@
"ex:contains": {
"@id": "http://example.org/test#book",
"@type": "ex:Book",
"dc:contributor": "Writer",
"dc:title": "My Book",
"dcterms:contributor": "Writer",
"dcterms:title": "My Book",
"ex:contains": {
"@id": "http://example.org/test#chapter",
"@type": "ex:Chapter",
"dc:description": "Fun",
"dc:title": "Chapter One"
"dcterms:description": "Fun",
"dcterms:title": "Chapter One"
}
}
}]
Expand Down
2 changes: 1 addition & 1 deletion tests/frame/0002-frame.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#"
},
"@type": "ex:Library",
Expand Down
10 changes: 5 additions & 5 deletions tests/frame/0002-in.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#",
"ex:contains": {"@type": "@id"}
},
Expand All @@ -13,15 +13,15 @@
{
"@id": "http://example.org/test#book",
"@type": "ex:Book",
"dc:contributor": "Writer",
"dc:title": "My Book",
"dcterms:contributor": "Writer",
"dcterms:title": "My Book",
"ex:contains": "http://example.org/test#chapter"
},
{
"@id": "http://example.org/test#chapter",
"@type": "ex:Chapter",
"dc:description": "Fun",
"dc:title": "Chapter One",
"dcterms:description": "Fun",
"dcterms:title": "Chapter One",
"ex:act": "ex:ActOne"
}
]
Expand Down
10 changes: 5 additions & 5 deletions tests/frame/0002-out.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#"
},
"@graph": [{
Expand All @@ -9,13 +9,13 @@
"ex:contains": {
"@id": "http://example.org/test#book",
"@type": "ex:Book",
"dc:contributor": "Writer",
"dc:title": "My Book",
"dcterms:contributor": "Writer",
"dcterms:title": "My Book",
"ex:contains": {
"@id": "http://example.org/test#chapter",
"@type": "ex:Chapter",
"dc:description": "Fun",
"dc:title": "Chapter One",
"dcterms:description": "Fun",
"dcterms:title": "Chapter One",
"ex:act": "ex:ActOne"
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/frame/0003-frame.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#"
},
"@type": "ex:DoesNotExist"
Expand Down
10 changes: 5 additions & 5 deletions tests/frame/0003-in.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#",
"ex:contains": {
"@type": "@id"
Expand All @@ -15,15 +15,15 @@
{
"@id": "http://example.org/test#book",
"@type": "ex:Book",
"dc:contributor": "Writer",
"dc:title": "My Book",
"dcterms:contributor": "Writer",
"dcterms:title": "My Book",
"ex:contains": "http://example.org/test#chapter"
},
{
"@id": "http://example.org/test#chapter",
"@type": "ex:Chapter",
"dc:description": "Fun",
"dc:title": "Chapter One"
"dcterms:description": "Fun",
"dcterms:title": "Chapter One"
}
]
}
2 changes: 1 addition & 1 deletion tests/frame/0003-out.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#"
},
"@graph": []
Expand Down
2 changes: 1 addition & 1 deletion tests/frame/0004-frame.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#",
"ex:contains": {"@type": "@id"}
},
Expand Down
10 changes: 5 additions & 5 deletions tests/frame/0004-in.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#",
"ex:contains": {"@type": "@id"}
},
Expand All @@ -13,15 +13,15 @@
{
"@id": "http://example.org/test#book",
"@type": "ex:Book",
"dc:contributor": "Writer",
"dc:title": "My Book",
"dcterms:contributor": "Writer",
"dcterms:title": "My Book",
"ex:contains": "http://example.org/test#chapter"
},
{
"@id": "http://example.org/test#chapter",
"@type": "ex:Chapter",
"dc:description": "Fun",
"dc:title": "Chapter One"
"dcterms:description": "Fun",
"dcterms:title": "Chapter One"
}
]
}
10 changes: 5 additions & 5 deletions tests/frame/0004-out.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#",
"ex:contains": {"@type": "@id"}
},
Expand All @@ -10,13 +10,13 @@
"ex:contains": {
"@id": "http://example.org/test#book",
"@type": "ex:Book",
"dc:contributor": "Writer",
"dc:title": "My Book",
"dcterms:contributor": "Writer",
"dcterms:title": "My Book",
"ex:contains": {
"@id": "http://example.org/test#chapter",
"@type": "ex:Chapter",
"dc:description": "Fun",
"dc:title": "Chapter One"
"dcterms:description": "Fun",
"dcterms:title": "Chapter One"
}
}
}]
Expand Down
6 changes: 3 additions & 3 deletions tests/frame/0005-frame.jsonld
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#"
},
"@explicit": true,
"@type": "ex:Library",
"ex:contains": {
"@explicit": true,
"@type": "ex:Book",
"dc:title": {},
"dcterms:title": {},
"ex:contains": {
"@explicit": true,
"@type": "ex:Chapter",
"dc:title": {},
"dcterms:title": {},
"ex:null": {}
}
}
Expand Down
10 changes: 5 additions & 5 deletions tests/frame/0005-in.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#",
"ex:contains": {
"@type": "@id"
Expand All @@ -15,15 +15,15 @@
{
"@id": "http://example.org/test#book",
"@type": "ex:Book",
"dc:contributor": "Writer",
"dc:title": "My Book",
"dcterms:contributor": "Writer",
"dcterms:title": "My Book",
"ex:contains": "http://example.org/test#chapter"
},
{
"@id": "http://example.org/test#chapter",
"@type": "ex:Chapter",
"dc:description": "Fun",
"dc:title": "Chapter One"
"dcterms:description": "Fun",
"dcterms:title": "Chapter One"
}
]
}
6 changes: 3 additions & 3 deletions tests/frame/0005-out.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#"
},
"@graph": [{
Expand All @@ -9,11 +9,11 @@
"ex:contains": {
"@id": "http://example.org/test#book",
"@type": "ex:Book",
"dc:title": "My Book",
"dcterms:title": "My Book",
"ex:contains": {
"@id": "http://example.org/test#chapter",
"@type": "ex:Chapter",
"dc:title": "Chapter One",
"dcterms:title": "Chapter One",
"ex:null": null
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/frame/0006-frame.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#"
},
"@type": "ex:Library",
Expand Down
10 changes: 5 additions & 5 deletions tests/frame/0006-in.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"ex": "http://example.org/vocab#",
"ex:contains": {
"@type": "@id"
Expand All @@ -16,15 +16,15 @@
{
"@id": "http://example.org/test#book",
"@type": "ex:Book",
"dc:contributor": "Writer",
"dc:title": "My Book",
"dcterms:contributor": "Writer",
"dcterms:title": "My Book",
"ex:contains": "http://example.org/test#chapter"
},
{
"@id": "http://example.org/test#chapter",
"@type": "ex:Chapter",
"dc:description": "Fun",
"dc:title": "Chapter One"
"dcterms:description": "Fun",
"dcterms:title": "Chapter One"
}
]
}
Loading

0 comments on commit 181b7e2

Please sign in to comment.