From 64725fd8f4c29d8e31eb3fe95c31fceccb73e6b5 Mon Sep 17 00:00:00 2001 From: Hans-Christian Date: Fri, 27 Sep 2024 13:19:43 +0200 Subject: [PATCH] feat: Upgrade to DCAT AP 3 (#99) - Remove `before index` JSON encoding - Update Solr - Update schema and presets according to DCAT AP 3 Co-authored-by: Hans-Chrstian --- ckanext/gdi_userportal/plugin.py | 37 +- .../scheming/presets/gdi_presets.json | 15 - .../scheming/presets/gdi_presets.json.license | 3 - .../scheming/presets/gdi_presets.yaml | 13 + .../scheming/schemas/gdi_userportal.json | 885 ------------------ .../schemas/gdi_userportal.json.license | 3 - .../scheming/schemas/gdi_userportal.yaml | 105 +++ solr/schema.xml | 33 +- 8 files changed, 139 insertions(+), 955 deletions(-) delete mode 100644 ckanext/gdi_userportal/scheming/presets/gdi_presets.json delete mode 100644 ckanext/gdi_userportal/scheming/presets/gdi_presets.json.license create mode 100644 ckanext/gdi_userportal/scheming/presets/gdi_presets.yaml delete mode 100644 ckanext/gdi_userportal/scheming/schemas/gdi_userportal.json delete mode 100644 ckanext/gdi_userportal/scheming/schemas/gdi_userportal.json.license create mode 100644 ckanext/gdi_userportal/scheming/schemas/gdi_userportal.yaml diff --git a/ckanext/gdi_userportal/plugin.py b/ckanext/gdi_userportal/plugin.py index ffc0e5c..49d20a9 100644 --- a/ckanext/gdi_userportal/plugin.py +++ b/ckanext/gdi_userportal/plugin.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 import json - +import logging import ckan.plugins as plugins import ckan.plugins.toolkit as toolkit from ckanext.gdi_userportal.logic.action.get import ( @@ -105,40 +105,7 @@ def before_dataset_search(self, search_params): def after_dataset_search(self, search_results, search_params): return search_results - def _parse_to_array(self, data_dict, field): - extras_field = f"extras_{field}" - if data_dict.get(extras_field): - try: - data_dict[field] = json.loads(data_dict[extras_field]) - except json.JSONDecodeError: - data_dict[field] = data_dict[extras_field] - del data_dict[extras_field] - return data_dict - - def before_dataset_index(self, data_dict): - for field in self._dcatap_fields_to_normalize: - data_dict = self._parse_to_array(data_dict, field) - - context = {"model": model, "session": model.Session} - dataset_dict = {"type": "dataset"} - schema = toolkit.get_action("scheming_dataset_schema_show")( - context, dataset_dict - ) - - repeating_fields = [ - x.get("field_name") - for x in schema.get("dataset_fields", []) - if "repeating_subfields" in x - ] - for field in repeating_fields: - try: - data_dict[field] = [json.dumps(x) for x in data_dict[field]] - except (json.JSONDecodeError, KeyError): - pass - - if data_dict.get("res_format"): - data_dict["res_format"] = list(dict.fromkeys(data_dict.get("res_format"))) - + def before_dataset_index(self, data_dict): return data_dict def before_dataset_view(self, pkg_dict): diff --git a/ckanext/gdi_userportal/scheming/presets/gdi_presets.json b/ckanext/gdi_userportal/scheming/presets/gdi_presets.json deleted file mode 100644 index e63472b..0000000 --- a/ckanext/gdi_userportal/scheming/presets/gdi_presets.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "scheming_presets_version": 1, - "about": "GDI scheming field presets", - "about_url": "https://github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-gdi-userportal/", - "presets": [ - { - "preset_name": "datetime_flex", - "values": { - "form_snippet": "datetime.html", - "display_snippet": "datetime.html", - "validators": "scheming_isodatetime_flex convert_to_json_if_datetime" - } - } - ] -} \ No newline at end of file diff --git a/ckanext/gdi_userportal/scheming/presets/gdi_presets.json.license b/ckanext/gdi_userportal/scheming/presets/gdi_presets.json.license deleted file mode 100644 index 32ef65c..0000000 --- a/ckanext/gdi_userportal/scheming/presets/gdi_presets.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: 2024 Stichting Health-RI - -SPDX-License-Identifier: Apache-2.0 diff --git a/ckanext/gdi_userportal/scheming/presets/gdi_presets.yaml b/ckanext/gdi_userportal/scheming/presets/gdi_presets.yaml new file mode 100644 index 0000000..a5adb99 --- /dev/null +++ b/ckanext/gdi_userportal/scheming/presets/gdi_presets.yaml @@ -0,0 +1,13 @@ +#SPDX-FileCopyrightText: 2024 Stichting Health-RI +# +#SPDX-License-Identifier: Apache-2.0 + +scheming_version: 2 +about: GDI scheming field presets +about_url: https://github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-gdi-userportal/ +presets: + - preset_name: datetime_flex + values: + form_snippet: datetime.html + display_snippet: datetime.html + validators: scheming_isodatetime_flex convert_to_json_if_datetime diff --git a/ckanext/gdi_userportal/scheming/schemas/gdi_userportal.json b/ckanext/gdi_userportal/scheming/schemas/gdi_userportal.json deleted file mode 100644 index c327b3c..0000000 --- a/ckanext/gdi_userportal/scheming/schemas/gdi_userportal.json +++ /dev/null @@ -1,885 +0,0 @@ -{ - "scheming_version": 1, - "dataset_type": "dataset", - "about": "Dataset Schema Compatible with DCAT 2.1.1 for GDI - User Portal Catalogue", - "about_url": "https://github.com/SEMICeu/DCAT-AP/tree/master/releases/2.1.1", - "dataset_fields": [ - { - "field_name": "title", - "label": { - "en": "Title", - "nl": "Titel" - }, - "preset": "title", - "help_inline": true, - "help_text": { - "en": "[dct:title] This property contains a name given to the Dataset.", - "nl": "[dct:title] Deze eigenschap bevat een naam voor de Dataset." - } - }, - { - "field_name": "name", - "label": "URL", - "preset": "dataset_slug", - "form_placeholder": "" - }, - { - "field_name": "notes", - "form_snippet": "markdown.html", - "label": "Description", - "required": true, - "help_inline": true, - "help_text": { - "en": "[dct:description] This property contains a free-text account of the Dataset.", - "nl": "[dct:description] Deze eigenschap bevat een vrije tekstbeschrijving van de Dataset." - } - }, - { - "field_name": "tag_string", - "label": "Tags", - "preset": "tag_string_autocomplete", - "help_inline": true, - "help_text": { - "en": "[dcat:keyword] This property contains a keyword or tag describing the Dataset.", - "nl": "[dcat:keyword] Deze eigenschap bevat een sleutelwoord of tag die de Dataset beschrijft." - } - }, - { - "field_name": "license_id", - "label": "License", - "form_snippet": "license.html", - "help_inline": true, - "help_text": { - "en": "[dct:license] This property refers to the license under which the Dataset is made available.", - "nl": "[dct:license] Deze eigenschap verwijst naar de licentie waaronder de Dataset beschikbaar is gesteld." - } - }, - { - "field_name": "owner_org", - "preset": "dataset_organization", - "label": "Organization", - "sorted_choices": true - }, - { - "field_name": "url", - "label": "Source", - "form_placeholder": "http://example.com/dataset.json", - "display_snippet": "link.html", - "help_inline": true, - "help_text": { - "en": "[dcat:landingPage] This property refers to a web page that provides access to the Dataset, its Distributions and/or additional information. It is intended to point to a landing page at the original data provider, not to a page on a site of a third party, such as an aggregator.", - "nl": "[dcat:landingPage] Deze eigenschap verwijst naar een webpagina die toegang biedt tot de Dataset, haar Distributies en/of aanvullende informatie. Het is bedoeld om te verwijzen naar een landingspagina bij de oorspronkelijke dataleverancier, niet naar een pagina op een site van derden, zoals een aggregator." - } - }, - { - "field_name": "version", - "label": "Version", - "validators": "ignore_missing unicode_safe package_version_validator", - "form_placeholder": "1.0", - "help_inline": true, - "help_text": { - "en": "[owl:versionInfo] This property contains a version number or other version designation of the Dataset.", - "nl": "[owl:versionInfo] Deze eigenschap bevat een versienummer of andere versieaanduiding van de Dataset." - } - }, - { - "field_name": "author", - "label": "Author", - "form_placeholder": "Joe Bloggs", - "help_inline": true, - "help_text": { - "en": "[CKAN] Fallback value for [vcard:fn]", - "nl": "[CKAN] Fallback-waarde voor [vcard:fn]" - } - }, - { - "field_name": "author_email", - "label": "Author Email", - "form_placeholder": "joe@example.com", - "display_snippet": "email.html", - "display_email_name_field": "author", - "help_inline": true, - "help_text": { - "en": "[CKAN] Fallback value for [vcard:hasEmail]", - "nl": "[CKAN] Fallback-waarde voor [vcard:hasEmail]" - } - }, - { - "field_name": "maintainer", - "label": "Maintainer", - "form_placeholder": "Joe Bloggs", - "help_inline": true, - "help_text": { - "en": "[CKAN] Fallback value for [vcard:fn]", - "nl": "[CKAN] Fallback-waarde voor [vcard:fn]" - } - }, - { - "field_name": "maintainer_email", - "label": "Maintainer Email", - "form_placeholder": "joe@example.com", - "display_snippet": "email.html", - "display_email_name_field": "maintainer", - "help_inline": true, - "help_text": { - "en": "[CKAN] Fallback value for [vcard:hasEmail]", - "nl": "[CKAN] Fallback-waarde voor [vcard:hasEmail]" - } - }, - { - "field_name": "contact_point", - "help_inline": true, - "help_text": { - "en": "[dcat:contactPoint] This property contains contact information that can be used for sending comments about the Dataset.", - "nl": "[dcat:contactPoint] Deze eigenschap bevat contactgegevens die kunnen worden gebruikt voor het verzenden van opmerkingen over de Dataset." - }, - "label": { - "en": "Contact Point", - "nl": "Contactpunt" - }, - "repeating_subfields": [ - { - "field_name": "contact_uri", - "help_inline": true, - "help_text": { - "en": "[dcat:contactPoint] This property contains contact information that can be used for sending comments about the Dataset.", - "nl": "[dcat:contactPoint] Deze eigenschap bevat contactgegevens die kunnen worden gebruikt voor het verzenden van opmerkingen over de Dataset." - }, - "label": { - "en": "Contact URI", - "nl": "Contact URI" - } - }, - { - "field_name": "contact_name", - "label": { - "en": "Contact Name", - "nl": "Contactnaam" - }, - "help_inline": true, - "help_text": { - "en": "[vcard:fn] This property contains contact information that can be used for sending comments about the Dataset.", - "nl": "[vcard:fn] Deze eigenschap bevat contactgegevens die kunnen worden gebruikt voor het verzenden van opmerkingen over de Dataset." - } - }, - { - "field_name": "contact_email", - "help_inline": true, - "help_text": { - "en": "[vcard:hasEmail] This property contains contact information that can be used for sending comments about the Dataset.", - "nl": "[vcard:hasEmail] Deze eigenschap bevat contactgegevens die kunnen worden gebruikt voor het verzenden van opmerkingen over de Dataset." - }, - "label": { - "en": "Contact Email", - "nl": "Contact E-mail" - }, - "display_snippet": "email.html" - } - ] - }, - { - "field_name": "publisher_uri", - "label": { - "en": "Publisher", - "nl": "Publicerende organisatie" - }, - "help_inline": true, - "help_text": { - "en": "[dct:publisher] This property refers to an entity (organisation) responsible for making the Dataset available.", - "nl": "[dct:publisher] Deze eigenschap verwijst naar een entiteit (organisatie) die verantwoordelijk is voor het beschikbaar stellen van de Dataset." - } - }, - { - "field_name": "publisher_name", - "label": { - "en": "Publisher Name", - "nl": "Naam publicerende organisatie" - }, - "help_inline": true, - "help_text": { - "en": "[foaf:name] This property contains a name of the agent.", - "nl": "[foaf:name] Deze eigenschap bevat een naam van de agent." - } - }, - { - "field_name": "publisher_email", - "label": { - "en": "Publisher Email", - "nl": "E-mail publicerende organisatie" - }, - "help_inline": true, - "help_text": { - "en": "[foaf:mbox] This property contains an email of the agent.", - "nl": "[foaf:mbox] Deze eigenschap bevat een e-mailadres van de agent." - } - }, - { - "field_name": "publisher_url", - "label": { - "en": "Publisher URL", - "nl": "URL publicerende organisatie" - }, - "help_inline": true, - "help_text": { - "en": "[foaf:homepage] This property refers to a web page that acts as the main page for the Catalogue.", - "nl": "[foaf:homepage] Deze eigenschap verwijst naar een webpagina die fungeert als de hoofdpagina voor de Catalogus." - } - }, - { - "field_name": "publisher_type", - "label": { - "en": "Publisher Type", - "nl": "Type publicerende organisatie" - }, - "help_inline": true, - "help_text": { - "en": "[dct:type] This property refers to the type of the Dataset. ", - "nl": "[dct:type] Deze eigenschap verwijst naar het type van de Dataset." - } - }, - { - "field_name": "spatial_uri", - "label": { - "en": "Spatial URI", - "nl": "Spatiële URI" - }, - "help_inline": true, - "help_text": { - "en": "[dct:spatial] This property refers to a geographic region that is covered by the Dataset. ", - "nl": "[dct:spatial] Deze eigenschap verwijst naar een geografisch gebied dat door de Dataset wordt gedekt." - } - }, - { - "field_name": "temporal_start", - "help_inline": true, - "help_text": { - "en": "[dct:temporal] This property refers to a temporal period that the Dataset covers.", - "nl": "[dct:temporal] Deze eigenschap verwijst naar een tijdsperiode die door de Dataset wordt gedekt." - }, - "label": { - "en": "Temporal Start Date", - "nl": "Begindatum tijdsperiode" - }, - "preset": "datetime_flex" - }, - { - "field_name": "temporal_end", - "help_inline": true, - "help_text": { - "en": "[dct:temporal] This property refers to a temporal period that the Dataset covers.", - "nl": "[dct:temporal] Deze eigenschap verwijst naar een tijdsperiode die door de Dataset wordt gedekt." - }, - "label": { - "en": "Temporal end date", - "nl": "Einddatum tijdsperiode" - }, - "preset": "datetime_flex" - }, - { - "field_name": "theme", - "label": { - "en": "Theme", - "nl": "Thema" - }, - "preset": "multiple_text", - "help_inline": true, - "help_text": { - "en": "[dcat:theme] This property refers to a category of the Dataset. A Dataset may be associated with multiple themes.", - "nl": "[dcat:theme] Deze eigenschap verwijst naar een categorie van de Dataset. Een Dataset kan zijn gekoppeld aan meerdere thema's." - } - }, - { - "field_name": "version_notes", - "label": { - "en": "Version Notes", - "nl": "Versieopmerkingen" - }, - "help_inline": true, - "help_text": { - "en": "[adms:versionNotes] This property contains a description of the differences between this version and a previous version of the Dataset.", - "nl": "[adms:versionNotes] Deze eigenschap bevat een beschrijving van de verschillen tussen deze versie en een vorige versie van de Dataset." - } - }, - { - "field_name": "landing_page", - "label": { - "en": "Landing Page", - "nl": "Landingspagina" - }, - "help_inline": true, - "help_text": { - "en": "[dcat:landingPage] This property refers to a web page that provides access to the Dataset, its Distributions and/or additional information. It is intended to point to a landing page at the original data provider, not to a page on a site of a third party, such as an aggregator.", - "nl": "[dcat:landingPage] Deze eigenschap verwijst naar een webpagina die toegang biedt tot de Dataset, Distributies en/of aanvullende informatie. Het is bedoeld om te verwijzen naar een landingspagina bij de oorspronkelijke dataleverancier, niet naar een pagina op een site van derden, zoals een aggregator." - } - }, - { - "field_name": "spatial_resolution_in_meters", - "label": { - "en": "Spatial Resolution in Meters", - "nl": "Spatiële Resolutie in meters" - }, - "help_inline": true, - "help_text": { - "en": "[dcat:spatialResolutionInMeters] This property refers to the minimum spatial separation resolvable in a dataset, measured in meters.", - "nl": "[dcat:spatialResolutionInMeters] Deze eigenschap verwijst naar de meest precieze ruimtelijke resolutie in de dataset, gemeten in meters." - } - }, - { - "field_name": "temporal_resolution", - "label": { - "en": "Temporal Resolution", - "nl": "Tijdsresolutie" - }, - "help_inline": true, - "help_text": { - "en": "[dcat:temporalResolution] This property refers to the minimum time period resolvable in the dataset.", - "nl": "[dcat:temporalResolution] Deze eigenschap verwijst naar de meest precieze tijdsspanne in de dataset." - } - }, - { - "field_name": "qualified_relation", - "label": { - "en": "Qualified Relation", - "nl": "Gekwalificeerde Relatie" - }, - "help_inline": true, - "help_text": { - "en": "[dcat:qualifiedRelation] This property provides a link to a description of a relationship with another resource.", - "nl": "[dcat:qualifiedRelation] Deze eigenschap biedt een link naar een beschrijving van een relatie met een andere bron." - } - }, - { - "field_name": "access_rights", - "label": { - "en": "Access rights", - "nl": "Toegangsrechten" - }, - "help_inline": true, - "help_text": { - "en": "[dct:accessRights] This property refers to information that indicates whether the Dataset is open data, has access restrictions or is not public.", - "nl": "[dct:accessRights] Deze eigenschap verwijst naar informatie die aangeeft of de Dataset open data is, toegangsbeperkingen heeft of niet openbaar is." - } - }, - { - "field_name": "frequency", - "label": { - "en": "Frequency", - "nl": "Frequentie" - }, - "help_inline": true, - "help_text": { - "en": "[dct:accrualPeriodicity] This property refers to the frequency at which the Dataset is updated.", - "nl": "[dct:accrualPeriodicity] Deze eigenschap verwijst naar de frequentie waarmee de Dataset wordt bijgewerkt." - } - }, - { - "field_name": "conforms_to", - "label": { - "en": "Conforms to", - "nl": "Voldoet aan" - }, - "preset": "multiple_text", - "help_inline": true, - "help_text": { - "en": "[dct:conformsTo] This property refers to an implementing rule or other specification.", - "nl": "[dct:conformsTo] Deze eigenschap verwijst naar geïmplementeerde regelgeving of een andere specificatie." - } - }, - { - "field_name": "creator", - "help_inline": true, - "help_text": { - "en": "[dct:creator] The entity responsible for producing the resource.", - "nl": "[dct:creator] De entiteit die verantwoordelijk is voor het produceren van de bron." - }, - "label": { - "en": "Creator", - "nl": "Maker" - }, - "repeating_subfields": [ - { - "field_name": "creator_identifier", - "help_inline": true, - "help_text": { - "en": "[dct:identifier] Unique identification of the person/organisation.", - "nl": "[dct:identifier] Unieke identificatie van de persoon/organisatie." - }, - "label": { - "en": "Creator URI", - "nl": "Maker URI" - } - }, - { - "field_name": "creator_name", - "label": { - "en": "Creator Name", - "nl": "Naam maker" - }, - "help_inline": true, - "help_text": { - "en": "[foaf:name] This property contains the name of the creator.", - "nl": "[foaf:name] Deze eigenschap bevat de naam van de maker." - } - } - ] - }, - { - "field_name": "is_referenced_by", - "label": { - "en": "Is referenced by", - "nl": "Wordt gerefereerd door" - }, - "help_inline": true, - "help_text": { - "en": "[dct:isReferencedBy] This property is about a related resource, such as a publication, that references, cites, or otherwise points to the dataset.", - "nl": "[dct:isReferencedBy] Deze eigenschap is over een gerelateerde bron, zoals een publicatie, die verwijst, citeert of op een andere manier verwijst naar de dataset." - } - }, - { - "field_name": "is_version_of", - "label": { - "en": "Is version of", - "nl": "Is versie van" - }, - "help_inline": true, - "help_text": { - "en": "[dct:isVersionOf] This property refers to a related Dataset of which the described Dataset is a version, edition, or adaptation.", - "nl": "[dct:isVersionOf] Deze eigenschap verwijst naar een gerelateerde Dataset waarvan de beschreven Dataset een versie, editie of aanpassing is." - } - }, - { - "field_name": "identifier", - "label": { - "en": "Identifier", - "nl": "Identificatie" - }, - "help_inline": true, - "help_text": { - "en": "[dct:identifier] This property contains the main identifier for the Dataset, e.g. the URI or other unique identifier in the context of the Catalogue.", - "nl": "[dct:identifier] Deze eigenschap bevat de hoofdidentificatie voor de Dataset, bijv. de URI of een andere unieke identificatie in de context van het Catalogus." - } - }, - { - "field_name": "issued", - "label": { - "en": "Issued", - "nl": "Uitgegeven" - }, - "help_inline": true, - "help_text": { - "en": "[dct:issued] This property contains the date of formal issuance (e.g., publication) of the Dataset.", - "nl": "[dct:issued] Deze eigenschap bevat de datum van formele uitgave (bijv. publicatie) van de Dataset." - }, - "preset": "datetime_flex" - }, - { - "field_name": "language", - "label": { - "en": "Language", - "nl": "Taal" - }, - "preset": "multiple_text", - "help_inline": true, - "help_text": { - "en": "[dct:language] This property refers to a language of the Dataset. This property can be repeated if there are multiple languages in the Dataset.", - "nl": "[dct:language] Deze eigenschap verwijst naar een taal van de Dataset. Deze eigenschap kan worden herhaald als er meerdere talen in de Dataset aanwezig zijn." - } - }, - { - "field_name": "modified", - "label": { - "en": "Modification Date", - "nl": "Datum Wijziging" - }, - "preset": "datetime_flex", - "help_inline": true, - "help_text": { - "en": "[dct:modified] This property contains the most recent date on which the Dataset was changed or modified.", - "nl": "[dct:modified] Deze eigenschap bevat de meest recente datum waarop de Dataset is gewijzigd of gewijzigd." - } - }, - { - "field_name": "provenance", - "label": { - "en": "Provenance", - "nl": "Afkomst" - }, - "help_inline": true, - "help_text": { - "en": "[dct:provenance] This property contains a statement about the lineage of a Dataset.", - "nl": "[dct:provenance] Deze eigenschap bevat een verklaring over de afkomst van een Dataset, alle wijzigingen in eigendom en bewaring van een dataset sinds de creatie ervan, die van belang zijn voor de authenticiteit, integriteit en interpretatie ervan.." - } - }, - { - "field_name": "relation", - "label": { - "en": "Relation", - "nl": "Relatie" - }, - "help_inline": true, - "help_text": { - "en": "[dct:relation] This property refers to a related resource.", - "nl": "[dct:relation] Deze eigenschap verwijst naar een gerelateerde bron." - } - }, - { - "field_name": "sample", - "label": { - "en": "Sample", - "nl": "Voorbeeld" - }, - "help_inline": true, - "help_text": { - "en": "[adms:sample] This property refers to a sample distribution of the dataset.", - "nl": "[adms:sample] Deze eigenschap verwijst naar een voorbeeld Distributie van de dataset." - } - }, - { - "field_name": "source", - "label": { - "en": "Source", - "nl": "Bron" - }, - "help_inline": true, - "help_text": { - "en": "[dct:source] This property refers to a related Dataset from which the described Dataset is derived.", - "nl": "[dct:source] Deze eigenschap verwijst naar een gerelateerde Dataset waarvan de beschreven Dataset is afgeleid." - } - }, - { - "field_name": "dcat_type", - "label": { - "en": "Type", - "nl": "Type" - }, - "help_inline": true, - "help_text": { - "en": "[dct:type] This property refers to the type of the Dataset.", - "nl": "[dct:type] Deze eigenschap verwijst naar het type van de Dataset." - } - }, - { - "field_name": "has_version", - "label": { - "en": "Has Version", - "nl": "Bevat Versie" - }, - "preset": "multiple_text", - "help_inline": true, - "help_text": { - "en": "[dct:hasVersion] This property refers to a related Dataset that is a version, edition, or adaptation of the described Dataset.", - "nl": "[dct:hasVersion] Deze eigenschap verwijst naar een gerelateerde Dataset die een versie, editie of aanpassing is van de beschreven Dataset." - } - }, - { - "field_name": "documentation", - "label": { - "en": "Documentation", - "nl": "Documentatie" - }, - "help_inline": true, - "help_text": { - "en": "[foaf:page] This property refers to a page or document about this Dataset.", - "nl": "[foaf:page] Deze eigenschap verwijst naar een pagina of document over deze Dataset." - } - }, - { - "field_name": "qualified_attribution", - "label": { - "en": "Qualified Attribution", - "nl": "Gekwalificeerde Toeschrijving" - }, - "help_inline": true, - "help_text": { - "en": "[prov:qualifiedAttribution ] This property refers to a link to an Agent having some form of responsibility for the resource.", - "nl": "[prov:qualifiedAttribution] Deze eigenschap verwijst naar een link naar een Agent die op een bepaalde wijze verantwoordelijk is voor de bron." - } - }, - { - "field_name": "was_generated_by", - "label": { - "en": "Was Generated By", - "nl": "Was Gegenereerd Door" - }, - "help_inline": true, - "help_text": { - "en": "[prov:wasGeneratedBy] This property refers to an activity that generated, or provides the business context for, the creation of the dataset.", - "nl": "[prov:wasGeneratedBy] Deze eigenschap verwijst naar een activiteit waarbij de dataset is gegenereerd of de zakelijke context biedt voor de creatie van de dataset." - } - }, - { - "field_name": "alternate_identifier", - "label": { - "en": "Alternate identifier", - "nl": "Alternatieve identificatie" - }, - "help_inline": true, - "help_text": { - "en": "[adms:identifier] This property refers to a secondary identifier of the Dataset, such as MAST/ADS , DataCite , DOI , EZID or W3ID .", - "nl": "[adms:identifier] Deze eigenschap verwijst naar een secundaire identificatie van de Dataset, zoals MAST/ADS, DataCite, DOI, EZID of W3ID." - } - } - ], - "resource_fields": [ - { - "field_name": "url", - "label": "URL", - "preset": "resource_url_upload" - }, - { - "field_name": "name", - "label": "Name", - "help_inline": true, - "help_text": { - "en": "[dct:title] This property contains a name given to the Distribution.", - "nl": "[dct:title] Deze eigenschap bevat een naam voor de Distribution." - }, - "form_placeholder": "eg. January 2011 Gold Prices" - }, - { - "field_name": "description", - "label": "Description", - "form_snippet": "markdown.html", - "form_placeholder": "Some useful notes about the data", - "help_inline": true, - "help_text": { - "en": "[dct:description] This property contains a free-text account of the Distribution.", - "nl": "[dct:description] Deze eigenschap bevat een vrije tekstbeschrijving van de Distribution." - } - }, - { - "field_name": "format", - "label": "Format", - "preset": "resource_format_autocomplete", - "help_inline": true, - "help_text": { - "en": "[dct:format] This property refers to the file format of the Distribution.", - "nl": "[dct:format] Deze eigenschap verwijst naar het bestandsformaat van de Distribution." - } - }, - { - "field_name": "access_url", - "label": { - "en": "Access URL", - "nl": "Toegangs-URL" - }, - "help_inline": true, - "help_text": { - "en": "[dcat:accessURL] This property contains a URL that gives access to a Distribution of the Dataset. The resource at the access URL may contain information about how to get the Dataset.", - "nl": "[dcat:accessURL] Deze eigenschap bevat een URL die toegang biedt tot een Distribution van de Dataset. De bron op de toegangs-URL kan informatie bevatten over hoe u toegang kunt krijgen tot de Dataset." - } - }, - { - "field_name": "availability", - "label": { - "en": "Availability", - "nl": "Beschikbaarheid" - }, - "help_inline": true, - "help_text": { - "en": "[dcatap:availability] This property indicates how long it is planned to keep the Distribution of the Dataset available. ", - "nl": "[dcatap:availability] Deze eigenschap geeft aan hoe lang het is gepland om de Distribution van de Dataset beschikbaar te houden." - } - }, - { - "field_name": "status", - "label": { - "en": "Status", - "nl": "Status" - }, - "help_inline": true, - "help_text": { - "en": "[adms:status] The status of the distribution in the context of maturity lifecycle.", - "nl": "[adms:status] De status van de distribution in de context van de maturiteitslevenscyclus." - } - }, - { - "field_name": "access_services", - "label": { - "en": "Access Services", - "nl": "Toegangsservices" - }, - "help_inline": true, - "help_text": { - "en": "[dcat:accessService] This property refers to a data service that gives access to the distribution of the dataset.", - "nl": "[dcat:accessService] Deze eigenschap verwijst naar een dataservice die toegang biedt tot de distribution van de dataset." - } - }, - { - "field_name": "size", - "label": "Size", - "form_snippet": null - }, - { - "field_name": "compress_format", - "label": { - "en": "Compress Format", - "nl": "Compressieformaat" - }, - "help_inline": true, - "help_text": { - "en": "[dcat:compressFormat] This property refers to the format of the file in which the data is contained in a compressed form, e.g. to reduce the size of the downloadable file.", - "nl": "[dcat:compressFormat] Deze eigenschap verwijst naar het bestandsformaat waarin de gegevens in een gecomprimeerde vorm zijn opgenomen, bijv. om de grootte van het downloadbare bestand te verkleinen." - } - }, - { - "field_name": "download_url", - "label": "Download URL", - "display_snippet": "link.html", - "help_inline": true, - "help_text": { - "en": "[dcat:downloadURL] This property contains a URL that is a direct link to a downloadable file in a given format.", - "nl": "[dcat:downloadURL] Deze eigenschap bevat een URL die een directe link is naar een downloadbaar bestand in een bepaald formaat." - } - }, - { - "field_name": "mimetype", - "label": "Mime Type", - "help_inline": true, - "help_text": { - "en": "[dcat:mediaType] This property refers to the media type of the Distribution as defined in the official register of media types managed by IANA.", - "nl": "[dcat:mediaType] Deze eigenschap verwijst naar het mediatype van de Distribution zoals gedefinieerd in het officiële register van mediatypes beheerd door IANA." - } - }, - { - "field_name": "package_format", - "label": { - "en": "Package Format", - "nl": "Pakketformaat" - }, - "help_inline": true, - "help_text": { - "en": "[dcat:packageFormat] This property refers to the format of the file in which one or more data files are grouped together, e.g. to enable a set of related files to be downloaded together.", - "nl": "[dcat:packageFormat] Deze eigenschap verwijst naar het bestandsformaat waarin een of meer gegevensbestanden zijn gegroepeerd, bijv. om een set gerelateerde bestanden samen te kunnen downloaden." - } - }, - { - "field_name": "spatial_resolution_in_meters", - "label": { - "en": "Spatial Resolution in Meters", - "nl": "Spatiële Resolutie in meters" - }, - "help_inline": true, - "help_text": { - "en": "[dcat:spatialResolutionInMeters] This property refers to the minimum spatial separation resolvable in a dataset, measured in meters.", - "nl": "[dcat:spatialResolutionInMeters] Deze eigenschap verwijst naar de meest precieze ruimtelijke resolutie in de dataset, gemeten in meters." - } - }, - { - "field_name": "temporal_resolution", - "label": { - "en": "Temporal Resolution", - "nl": "Tijdsresolutie" - }, - "help_inline": true, - "help_text": { - "en": "[dcat:temporalResolution] This property refers to the minimum time period resolvable in the dataset.", - "nl": "[dcat:temporalResolution] Deze eigenschap verwijst naar de minimale tijdsperiode die in de dataset kan worden opgelost." - } - }, - { - "field_name": "conforms_to", - "label": { - "en": "Conforms to", - "nl": "Voldoet aan" - }, - "help_inline": true, - "help_text": { - "en": "[dct:conformsTo] This property refers to an implementing rule or other specification.", - "nl": "[dct:conformsTo] Deze eigenschap verwijst naar een uitvoerende regel of andere specificatie." - } - }, - { - "field_name": "issued", - "label": { - "en": "Issued", - "nl": "Uitgegeven" - }, - "help_inline": true, - "help_text": { - "en": "[dct:issued] This property contains the date of formal issuance (e.g., publication) of the Dataset.", - "nl": "[dct:issued] Deze eigenschap bevat de datum van formele uitgave (bijv. publicatie) van de Dataset." - }, - "preset": "date" - }, - { - "field_name": "language", - "label": { - "en": "Language", - "nl": "Taal" - }, - "help_inline": true, - "help_text": { - "en": "[dct:language] This property refers to a language of the Dataset. This property can be repeated if there are multiple languages in the Dataset.", - "nl": "[dct:language] Deze eigenschap verwijst naar een taal van de Dataset. Deze eigenschap kan worden herhaald als er meerdere talen in de Dataset aanwezig zijn." - } - }, - { - "field_name": "modified", - "label": { - "en": "Modification Date", - "nl": "Datum Wijziging" - }, - "preset": "date", - "help_inline": true, - "help_text": { - "en": "[dct:modified] This property contains the most recent date on which the Dataset was changed or modified.", - "nl": "[dct:modified] Deze eigenschap bevat de meest recente datum waarop de Dataset is gewijzigd of gewijzigd." - } - }, - { - "field_name": "rights", - "label": { - "en": "Rights", - "nl": "Rechten" - }, - "help_inline": true, - "help_text": { - "en": "[dct:rights] This property refers to a statement that specifies rights associated with the Distribution.", - "nl": "[dct:rights] Deze eigenschap verwijst naar een verklaring die de rechten aangeeft die zijn gekoppeld aan de Distribution." - } - }, - { - "field_name": "documentation", - "label": { - "en": "Documentation", - "nl": "Documentatie" - }, - "help_inline": true, - "help_text": { - "en": "[foaf:page] This property refers to a page or document about this Distribution.", - "nl": "[foaf:page] Deze eigenschap verwijst naar een pagina of document over deze Distribution." - } - }, - { - "field_name": "has_policy", - "label": { - "en": "Has Policy", - "nl": "Heeft Beleid" - }, - "help_inline": true, - "help_text": { - "en": "[odrl:hasPolicy] This property refers to the policy expressing the rights associated with the distribution if using the ODRL vocabulary.", - "nl": "[odrl:hasPolicy] Deze eigenschap verwijst naar het beleid dat de rechten aangeeft die zijn gekoppeld aan de distribution als de ODRL-vocabulaire wordt gebruikt." - } - }, - { - "field_name": "hash", - "label": "Hash", - "help_inline": true, - "help_text": { - "en": "[spdx:checksumValue] This property provides a lower case hexadecimal encoded digest value produced using a specific algorithm.", - "nl": "[spdx:checksumValue] Deze eigenschap biedt een kleine hexadecimale hashwaarde die is gegenereerd met behulp van een specifiek algoritme." - } - }, - { - "field_name": "hash_algorithm", - "label": "Hash Algorithm", - "help_inline": true, - "help_text": { - "en": "[spdx:algorithm] This property identifies the algorithm used to produce the subject Checksum. ", - "nl": "[spdx:algorithm] Deze eigenschap identificeert het algoritme dat is gebruikt om de Checksum te produceren." - } - } - ] -} \ No newline at end of file diff --git a/ckanext/gdi_userportal/scheming/schemas/gdi_userportal.json.license b/ckanext/gdi_userportal/scheming/schemas/gdi_userportal.json.license deleted file mode 100644 index c75c82f..0000000 --- a/ckanext/gdi_userportal/scheming/schemas/gdi_userportal.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: 2024 PNED G.I.E. - -SPDX-License-Identifier: Apache-2.0 diff --git a/ckanext/gdi_userportal/scheming/schemas/gdi_userportal.yaml b/ckanext/gdi_userportal/scheming/schemas/gdi_userportal.yaml new file mode 100644 index 0000000..29bba68 --- /dev/null +++ b/ckanext/gdi_userportal/scheming/schemas/gdi_userportal.yaml @@ -0,0 +1,105 @@ +#SPDX-FileCopyrightText: 2024 PNED G.I.E. +# +#SPDX-License-Identifier: Apache-2.0 + +scheming_version: 2 +dataset_type: dataset +about: DCAT-AP 3 compatible schema +about_url: http://github.com/ckan/ckanext-dcat + +dataset_fields: +- field_name: issued + label: + en: Issued Date + nl: Uitgegeven Datum + preset: datetime_flex + help_text: + en: "[dct:issued] This property contains the date of formal issuance (e.g., publication) of the Dataset." + nl: "[dct:issued] Deze eigenschap bevat de datum van formele uitgave (bijv. publicatie) van de Dataset." + +- field_name: modified + label: + en: Modification Date + nl: Datum Wijziging + preset: datetime_flex + help_text: + en: "[dct:modified] This property contains the most recent date on which the Dataset was changed or modified." + nl: "[dct:modified] Deze eigenschap bevat de meest recente datum waarop de Dataset is gewijzigd of gewijzigd." + +- field_name: has_version + label: + en: Has Version + nl: Bevat Versie + preset: multiple_text + help_inline: true + help_text: + en: "[dct:hasVersion] This property refers to a related Dataset that is a version, edition, or adaptation of the described Dataset." + nl: "[dct:hasVersion] Deze eigenschap verwijst naar een gerelateerde Dataset die een versie, editie of aanpassing is van de beschreven Dataset." + +- field_name: temporal_start + label: + en: Temporal Start Date + nl: Begindatum tijdsperiode + help_inline: true + help_text: + en: "[dct:temporal] This property refers to a temporal period that the Dataset covers." + nl: "[dct:temporal] Deze eigenschap verwijst naar een tijdsperiode die door de Dataset wordt gedekt." + preset: datetime_flex + +- field_name: temporal_end + label: + en: Temporal End Date + nl: Einddatum tijdsperiode + help_inline: true + help_text: + en: "[dct:temporal] This property refers to a temporal period that the Dataset covers." + nl: "[dct:temporal] Deze eigenschap verwijst naar een tijdsperiode die door de Dataset wordt gedekt." + preset: datetime_flex + +- field_name: creator + label: Creator + repeating_subfields: + - field_name: uri + label: Creator URI + + - field_name: name + label: Creator Name + + - field_name: email + label: Creator Email + display_snippet: email.html + + - field_name: url + label: Creator URL + display_snippet: link.html + + - field_name: type + label: Creator Type + + - field_name: identifier + label: Creator Identifier + help_text: + en: Unique identifier for the creator, such as a ROR ID. + nl: Unieke identificatie voor de maker, zoals een ROR-ID. + help_text: + en: Entity responsible for producing the dataset. + nl: Entiteit die verantwoordelijk is voor het produceren van de dataset. + +resource_fields: +- field_name: issued + label: + en: Issued Date + nl: Uitgegeven Datum + preset: datetime_flex + help_text: + en: "[dct:issued] This property contains the date of formal issuance (e.g., publication) of the Resource." + nl: "[dct:issued] Deze eigenschap bevat de datum van formele uitgave (bijv. publicatie) van de Resource." + +- field_name: modified + label: + en: Modification Date + nl: Datum Wijziging + preset: datetime_flex + help_text: + en: "[dct:modified] This property contains the most recent date on which the Resource was changed or modified." + nl: "[dct:modified] Deze eigenschap bevat de meest recente datum waarop de Resource is gewijzigd of gewijzigd." \ No newline at end of file diff --git a/solr/schema.xml b/solr/schema.xml index d2876b0..21ce161 100644 --- a/solr/schema.xml +++ b/solr/schema.xml @@ -159,21 +159,26 @@ attribute with the form `ckan-X.Y` --> - - - - - - - - - - - - - + multiValued="true" /> + + + + + + + + + + + + + + + + + +