Skip to content

Commit

Permalink
[#56] Create a full and a slimmed down schema version
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 10, 2024
1 parent da8de09 commit 602d505
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 5 deletions.
File renamed without changes.
147 changes: 147 additions & 0 deletions ckanext/dcat/schemas/dcat_ap_2.1_recommended.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
scheming_version: 2
dataset_type: dataset
about: A reimplementation of the default CKAN dataset schema
about_url: http://github.com/ckan/ckanext-dcat

dataset_fields:

- field_name: title
label: Title
preset: title
required: true
help_text: A descriptive title for the dataset.

- field_name: name
label: URL
preset: dataset_slug
form_placeholder: eg. my-dataset

- field_name: notes
label: Description
required: true
form_snippet: markdown.html
help_text: A free-text account of the dataset.

- field_name: tag_string
label: Keywords
preset: tag_string_autocomplete
form_placeholder: eg. economy, mental health, government
help_text: Keywords or tags describing the dataset. Use commas to separate multiple values.

- field_name: contact
label: Contact points
repeating_label: Contact point
repeating_subfields:

- field_name: uri
label: URI

- field_name: name
label: Name

- field_name: email
label: Email
display_snippet: email.html
help_text: Contact information for enquiries about the dataset.

- field_name: publisher
label: Publisher
repeating_label: Publisher
repeating_once: true
repeating_subfields:

- field_name: uri
label: URI

- field_name: name
label: Name

- field_name: email
label: Email
display_snippet: email.html

- field_name: url
label: URL
display_snippet: link.html

- field_name: type
label: Type
help_text: Entity responsible for making the dataset available.

- field_name: license_id
label: License
form_snippet: license.html
help_text: License definitions and additional information can be found at http://opendefinition.org/.

- field_name: owner_org
label: Organization
preset: dataset_organization
help_text: The CKAN organization the dataset belongs to.

- field_name: temporal_coverage
label: Temporal coverage
repeating_subfields:

- field_name: start
label: Start
preset: dcat_date

- field_name: end
label: End
preset: dcat_date
help_text: The temporal period or periods the dataset covers.

- field_name: spatial_coverage
label: Spatial coverage
repeating_subfields:

- field_name: uri
label: URI

- field_name: text
label: Label

- field_name: geom
label: Geometry

- field_name: bbox
label: Bounding Box

- field_name: centroid
label: Centroid
help_text: A geographic region that is covered by the dataset.

- field_name: theme
label: Theme
preset: multiple_text
validators: ignore_missing scheming_multiple_text
help_text: A category of the dataset. A Dataset may be associated with multiple themes.

resource_fields:

- field_name: url
label: URL
preset: resource_url_upload

- field_name: name
label: Name
form_placeholder:
help_text: A descriptive title for the resource.

- field_name: description
label: Description
form_snippet: markdown.html
help_text: A free-text account of the resource.

- field_name: format
label: Format
preset: resource_format_autocomplete
help_text: File format. If not provided it will be guessed.

- field_name: availability
label: Availability
help_text: Indicates how long it is planned to keep the resource available.

- field_name: license
label: License
help_text: License in which the resource is made available. If not provided will be inherited from the dataset.
10 changes: 5 additions & 5 deletions ckanext/dcat/tests/test_scheming_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@pytest.mark.usefixtures("with_plugins", "clean_db")
@pytest.mark.ckan_config("ckan.plugins", "dcat scheming_datasets")
@pytest.mark.ckan_config(
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1.yaml"
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1_full.yaml"
)
@pytest.mark.ckan_config(
"scheming.presets",
Expand Down Expand Up @@ -548,7 +548,7 @@ def test_legacy_fields(self):
@pytest.mark.usefixtures("with_plugins", "clean_db")
@pytest.mark.ckan_config("ckan.plugins", "dcat scheming_datasets")
@pytest.mark.ckan_config(
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1.yaml"
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1_full.yaml"
)
@pytest.mark.ckan_config(
"scheming.presets",
Expand Down Expand Up @@ -580,7 +580,7 @@ def test_mimetype_is_guessed(self):
@pytest.mark.usefixtures("with_plugins", "clean_db")
@pytest.mark.ckan_config("ckan.plugins", "dcat scheming_datasets")
@pytest.mark.ckan_config(
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1.yaml"
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1_full.yaml"
)
@pytest.mark.ckan_config(
"scheming.presets",
Expand Down Expand Up @@ -740,7 +740,7 @@ def test_e2e_dcat_to_ckan(self):
@pytest.mark.usefixtures("with_plugins", "clean_db")
@pytest.mark.ckan_config("ckan.plugins", "dcat scheming_datasets")
@pytest.mark.ckan_config(
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1.yaml"
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1_full.yaml"
)
@pytest.mark.ckan_config(
"scheming.presets",
Expand Down Expand Up @@ -818,7 +818,7 @@ def test_spatial_field(self):
@pytest.mark.usefixtures("with_plugins", "clean_db")
@pytest.mark.ckan_config("ckan.plugins", "dcat scheming_datasets")
@pytest.mark.ckan_config(
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1.yaml"
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1_full.yaml"
)
@pytest.mark.ckan_config(
"scheming.presets",
Expand Down

0 comments on commit 602d505

Please sign in to comment.