-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy patheuro_dcat_ap.py
More file actions
53 lines (36 loc) · 1.65 KB
/
Copy patheuro_dcat_ap.py
File metadata and controls
53 lines (36 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from .base import ADMS, URIRefOrLiteral
from .euro_dcat_ap_base import BaseEuropeanDCATAPProfile
class EuropeanDCATAPProfile(BaseEuropeanDCATAPProfile):
"""
An RDF profile based on the DCAT-AP v1 for data portals in Europe
More information and specification:
https://joinup.ec.europa.eu/asset/dcat_application_profile
"""
def parse_dataset(self, dataset_dict, dataset_ref):
# Call base method for common properties
dataset_dict = self._parse_dataset_base(dataset_dict, dataset_ref)
return dataset_dict
def graph_from_dataset(self, dataset_dict, dataset_ref):
# Call base method for common properties
self._graph_from_dataset_base(dataset_dict, dataset_ref)
# DCAT AP v1 specific properties
self._graph_from_dataset_v1_only(dataset_dict, dataset_ref)
def graph_from_catalog(self, catalog_dict, catalog_ref):
self._graph_from_catalog_base(catalog_dict, catalog_ref)
def graph_from_catalog_record(self, dataset_dict, dataset_ref, catalog_record_ref):
self._graph_from_catalog_record_base(dataset_dict, dataset_ref, catalog_record_ref)
def _graph_from_dataset_v1_only(self, dataset_dict, dataset_ref):
"""
CKAN -> DCAT v1 specific properties (not applied to higher versions)
"""
# Other identifiers (these are handled differently in the
# DCAT-AP v3 profile)
self._add_triple_from_dict(
dataset_dict,
dataset_ref,
ADMS.identifier,
"alternate_identifier",
list_value=True,
_type=URIRefOrLiteral,
_class=ADMS.Identifier,
)