Skip to content

Commit

Permalink
feat: Add support for DCAT creator field in dataset metadata
Browse files Browse the repository at this point in the history
- Added fields to store creator details (name, email, URL, and identifier) in the DCAT profile.
- Implemented functionality to serialize and deserialize creator information similar to the publisher.
- Updated RDF generation logic to include creator fields in the output graph.
- Enhanced unit tests to verify proper handling and serialization of creator metadata.
  • Loading branch information
Hans-Chrstian committed Sep 12, 2024
1 parent d5b8e92 commit f7da907
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ckanext/dcat/tests/profiles/base/test_base_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def test_publisher_foaf(self):

p = RDFProfile(g)

publisher = p._publisher(URIRef('http://example.org'), DCT.publisher)
publisher = p._agent_details(URIRef('http://example.org'), DCT.publisher)

assert publisher['uri'] == 'http://orgs.vocab.org/some-org'
assert publisher['name'] == 'Publishing Organization for dataset 1'
Expand Down Expand Up @@ -688,7 +688,7 @@ def test_publisher_ref(self):

p = RDFProfile(g)

publisher = p._publisher(URIRef('http://example.org'), DCT.publisher)
publisher = p._agent_details(URIRef('http://example.org'), DCT.publisher)

assert publisher['uri'] == 'http://orgs.vocab.org/some-org'

Expand Down
2 changes: 2 additions & 0 deletions examples/ckan/ckan_dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
{"key": "guid", "value": "9df8df51-63db-37a8-e044-0003ba9b0d98"},
{"key": "dcat_publisher_name", "value": "Geological Society"},
{"key": "dcat_publisher_email", "value": "info@gs.org"},
{"key": "dcat_creator_name", "value": "John Doe"},
{"key": "dcat_creator_email", "value": "johndoe@example.com"},
{"key": "language", "value": "en,es,ca"}
],
"resources": [{"id": "b1e0b666-b7f4-44c1-9b16-56c78e86b66a",
Expand Down
16 changes: 11 additions & 5 deletions examples/ckan/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@
"name": "Geological Society",
"mbox": "info@gs.org"
},
"distribution": [{"accessURL": "http://www.bgs.ac.uk/gbase/geochemcd/home.html",
"byteSize": null,
"description": "Resource locator",
"format": "text/html",
"title": ""}]
"creator": {
"name": "John Doe",
"mbox": "johndoe@example.com"
},
"distribution": [{
"accessURL": "http://www.bgs.ac.uk/gbase/geochemcd/home.html",
"byteSize": null,
"description": "Resource locator",
"format": "text/html",
"title": ""
}]
}
4 changes: 2 additions & 2 deletions examples/ckan/full_ckan_dataset.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"author": null,
"author_email": null,
"author": "John Doe",
"author_email": "johndoe@example.com",
"extras": [
{
"__extras": {
Expand Down
Empty file added examples/ckan/temp
Empty file.

0 comments on commit f7da907

Please sign in to comment.