Skip to content

Commit

Permalink
[#56] Docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 11, 2024
1 parent c11f3c2 commit 030cd3d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ckanext/dcat/profiles/euro_dcat_ap_scheming.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ class EuropeanDCATAPSchemingProfile(RDFProfile):
`euro_dcat_ap` and `euro_dcat_ap_2` profiles.
It does not add or remove any properties from these profiles, it just transforms the
resulting dataset_dict so it is compatible with a ckanext-scheming schema
TODO: summarize changes and link to docs
"""

def parse_dataset(self, dataset_dict, dataset_ref):
"""
Modify the dataset_dict generated by the euro_dcat_ap andeuro_dcat_ap_2 profiles
to make it compatible with the scheming file definitions:
* Move extras to root level fields
* Parse lists (multiple text preset)
* Turn namespaced extras into repeating subfields
"""

if not self._dataset_schema:
# Not using scheming
Expand Down Expand Up @@ -110,6 +116,9 @@ def _parse_list_value(data_dict, field_name):
return dataset_dict

def graph_from_dataset(self, dataset_dict, dataset_ref):
"""
Add triples to the graph from new repeating subfields
"""

contact = dataset_dict.get("contact")
if isinstance(contact, list) and len(contact):
Expand Down

0 comments on commit 030cd3d

Please sign in to comment.