Skip to content
Snippets Groups Projects
Commit 5964ff41 authored by Thorge Petersen's avatar Thorge Petersen
Browse files

Removed duplicate code

parent 164be02a
No related branches found
No related tags found
No related merge requests found
......@@ -145,27 +145,6 @@ class ODSHDCATdeProfile(DCATdeProfile):
created, datatype="http://www.w3.org/2001/XMLSchema#dateTime"))
)
def _add_modified_and_issued(self, dataset_dict, dataset_ref):
'''
Adds distributions last_modified and created values to
dcat:modified and dcat:issued.
'''
for distribution in self.g.objects(dataset_ref, DCAT.distribution):
for resource_dict in dataset_dict.get('resources', []):
# Match distribution in graph and distribution in ckan-dict
if str(distribution) == resource_uri(resource_dict):
last_modified = resource_dict.get('last_modified', None)
if last_modified:
self.g.set(
(distribution, DCT.modified, rdflib.Literal(
last_modified, datatype="http://www.w3.org/2001/XMLSchema#dateTime"))
)
created = resource_dict.get('created', None)
if created:
self.g.set(
(distribution, DCT.issued, rdflib.Literal(
created, datatype="http://www.w3.org/2001/XMLSchema#dateTime"))
)
def _add_version(self, dataset_dict, dataset_ref):
'''
Adds CKAN isReplacedBy extra field to dublin core isReplacedBy and sets version information.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment