diff --git a/CHANGELOG.md b/CHANGELOG.md index 738d27057f95c520419f2c05450ccba2a58b97d2..8240dd195599e4be774a53c06fb15295a5c9cf3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,11 +14,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed `ckanext.odsh.home` configuration variable. - The `tag_name_validator` function, responsible for validating tag names, has been removed. Tag names are no longer restricted by any validation checks, allowing for unrestricted input (according [DCAT-AP](https://www.dcat-ap.de/def/dcatde/2.0/spec/#datensatz-schlagwort)). - Removed `ckanext.odsh.upload_formats` configuration variable. Upload formats are now populated by EU-approved file formats. +- Removed subject mappings and other subject related code used in Transparenzportal SH (TPSH). ### Changed -- Reorganized default mapping and resource files for improved organization and maintenance. Mapping and config files (e.g., file formats, licenses subject mappings, etc.) are now located in `ckanext/odsh/resources/`. +- Reorganized default mapping and resource files for improved organization and maintenance. Mapping and config files (e.g., file formats) are now located in `ckanext/odsh/resources/`. - Refactor distribution/resource editing form to replace free-text format field with select field populated by EU-approved file formats. +- Reorganized tests and helper TPSH specific code +- Migrated TPSH helpers to `helpers.py`. +- Moved TPSH tests to `tests/` and legacy tests to `tests_wip`. ## [2.0.0] - 2023-06-08 diff --git a/README.md b/README.md index c3a94e5e6438ea15bde708d4f1495bf04cf38b4f..f02bba0fd0bd64e504ec89b0ccfdc622e0c17276 100644 --- a/README.md +++ b/README.md @@ -92,12 +92,10 @@ Parameter | Type | Default | Description `ckanext.odsh.public_url` | `string` | - | The public URL, e.g., `https://opendata.schleswig-holstein.de`. `ckanext.odsh.showtestbanner` | `boolean` | `True` | Switches on the banner "test system". Must be `false` for production server. `ckanext.odsh.language_mapping` | `string` | `/usr/lib/ckan/default/src/ckanext-odsh/ckanext/odsh/resources/language_mapping.json` | Absolute path to language mapping file. -`ckanext.odsh.subject_mapping` | `string` | `/usr/lib/ckan/default/src/ckanext-odsh/ckanext/odsh/resources/subject_mapping.json` | Absolute path to subject mapping file. `ckanext.odsh.spatial.mapping` | `string` | `/usr/lib/ckan/default/src/ckanext-odsh/ckanext/odsh/resources/schleswig-holstein_geojson.csv` | Absolute path to spatial mapping file. The mapping file is expected to be a tab-separated file with three columns: URI, spatial text, and JSON geometry. `ckanext.odsh.resource_formats_fallback_filepath` | `string` | `/usr/lib/ckan/default/src/ckanext-odsh/ckanext/odsh/resources/fileformats.rdf` | Absolute path to resource formats fallback file. `ckanext.odsh.require_at_least_one_category` | `boolean` | `False` | Indicates whether the presence of at least one category is required during validation. `ckanext.odsh.require_spatial_uri` | `boolean` | `False` | Indicates whether a spatial URI is required for the dataset. -`ckanext.odsh.require_subject` | `boolean` | `True` | Indicates whether a subject is required for a dataset. `ckanext.odsh.is_optional_temporal_start` | `boolean` | `False` | Indicate whether the `temporal_start` property is considered optional or not during validation. `ckanext.odsh.download_proxy` | `string` | `None` | Use proxy server to access the web, e.g., `http://1.2.3.4:4123`. `copy_remote_resources` | `boolean` | `False` | Indicates whether remote resources should be copied when creating a resource. @@ -120,13 +118,10 @@ test suite is provided. You can follow the instructions below to run the tests: ```sh pytest ckanext/odsh/tests/ - pytest ckanext/odsh/tests_tpsh/ ``` Running these commands will initiate the test suite, which will automatically execute -various test cases and verify the expected behavior of the extension. The tests are -organized into two directories: `tests` and `tests_tpsh`, each containing different -sets of tests. +various test cases and verify the expected behavior of the extension. ### Internationalization diff --git a/ckanext/odsh/fanstatic/odsh.css b/ckanext/odsh/fanstatic/odsh.css index 5a21b2a6ff9c9e636e7e5ebf4bd4405be51a49ca..41139e9fa5c6878a2500f9e4846549c1876f111e 100644 --- a/ckanext/odsh/fanstatic/odsh.css +++ b/ckanext/odsh/fanstatic/odsh.css @@ -3075,7 +3075,7 @@ body.filters-modal div.row>aside.secondary.span3 { } } -.tpsh-collection-list { +.odsh-collection-list { list-style-type: none; } diff --git a/ckanext/odsh/fanstatic/tpsh_toggle_menu.js b/ckanext/odsh/fanstatic/odsh_toggle_menu.js similarity index 91% rename from ckanext/odsh/fanstatic/tpsh_toggle_menu.js rename to ckanext/odsh/fanstatic/odsh_toggle_menu.js index 1a8a8c82d0f4849ca49b8bf525247cca7cdbf755..876b3f8740ae4f021a8969a01562259722339619 100644 --- a/ckanext/odsh/fanstatic/tpsh_toggle_menu.js +++ b/ckanext/odsh/fanstatic/odsh_toggle_menu.js @@ -1,6 +1,6 @@ "use strict"; -ckan.module('tpsh_toggle_menu', function ($) { +ckan.module('odsh_toggle_menu', function ($) { return { initialize: function () { $.proxyAll(this, /_on/); diff --git a/ckanext/odsh/fanstatic/tpsh_validate_password.js b/ckanext/odsh/fanstatic/odsh_validate_password.js similarity index 97% rename from ckanext/odsh/fanstatic/tpsh_validate_password.js rename to ckanext/odsh/fanstatic/odsh_validate_password.js index f0f8f71b55e4f6a2cd9e52c6a39b09ab302d2dab..9ad4a91b7299d67251997cf190699f2dbcb664eb 100644 --- a/ckanext/odsh/fanstatic/tpsh_validate_password.js +++ b/ckanext/odsh/fanstatic/odsh_validate_password.js @@ -53,7 +53,7 @@ function setSubmitButtonState(isPasswordValid) { } -ckan.module('tpsh_validate_password', function ($) { +ckan.module('odsh_validate_password', function ($) { return { initialize: function () { $.proxyAll(this, /_on/); diff --git a/ckanext/odsh/fanstatic/webassets.yml b/ckanext/odsh/fanstatic/webassets.yml index 6ddebcd3183c4695db12f95ed4772a05e74325fc..37bb956c0f2bbb607951648982a36d607ad6bef7 100644 --- a/ckanext/odsh/fanstatic/webassets.yml +++ b/ckanext/odsh/fanstatic/webassets.yml @@ -52,20 +52,20 @@ odsh_popover_script: contents: - odsh_popover.js -tpsh_toggle_menu: +odsh_toggle_menu: filters: rjsmin # preprocessor - output: ckanext-odsh/tpsh_toggle_menu.js + output: ckanext-odsh/odsh_toggle_menu.js extra: preload: - base/main contents: - - tpsh_toggle_menu.js + - odsh_toggle_menu.js -tpsh_validate_password: +odsh_validate_password: filters: rjsmin # preprocessor - output: ckanext-odsh/tpsh_validate_password.js + output: ckanext-odsh/odsh_validate_password.js contents: - - tpsh_validate_password.js + - odsh_validate_password.js odsh_dataset_map_script: filters: rjsmin # preprocessor @@ -135,8 +135,8 @@ odsh_spatial_query_style: # - odsh_popover.js # - odsh_populate_tags.js # - odsh_spatial_query.js -# - tpsh_toggle_menu.js -# - tpsh_validate_password.js +# - odsh_toggle_menu.js +# - odsh_validate_password.js # - vendor/jquery-ui-autocomplete/jquery-ui.js # - vendor/leaflet.draw.js # - vendor/leaflet.js diff --git a/ckanext/odsh/helper_pkg_dict.py b/ckanext/odsh/helper_pkg_dict.py index 26f7917c6ef77f4368c9f8581fc411fee48e0e57..514e3551360ac26151653f12f77739a000b6dca7 100644 --- a/ckanext/odsh/helper_pkg_dict.py +++ b/ckanext/odsh/helper_pkg_dict.py @@ -3,7 +3,6 @@ import re import ckanext.odsh.helpers as helpers_odsh import datetime -import ckanext.odsh.helpers_tpsh as helpers_tpsh import ckanext.odsh.collection.helpers as helpers_collection import ckanext.odsh.uri_store as uri_store @@ -48,7 +47,7 @@ class HelperPgkDict(object): uris_collection_members = self.get_uris_collection_members() ckan_ids_collection_members = [self.get_id_from_store(uri) for uri in uris_collection_members] for id_pkg in ckan_ids_collection_members: - helpers_tpsh.add_pkg_to_collection(id_pkg, id_collection) + helpers_odsh.add_pkg_to_collection(id_pkg, id_collection) log.info('Added package with id {} to collection with id {}'.format(id_pkg, id_collection)) def get_uris_collection_members(self): @@ -80,7 +79,7 @@ class HelperPgkDict(object): id_pkg = self.pkg_dict.get('id') uri_collection = self.get_collection_uri() id_collection = uri_store.get_id_from_uri(uri_collection) - helpers_tpsh.add_pkg_to_collection(id_pkg, id_collection) + helpers_odsh.add_pkg_to_collection(id_pkg, id_collection) log.info('Added package with id {} to collection with id {}'.format(id_pkg, id_collection)) diff --git a/ckanext/odsh/helpers.py b/ckanext/odsh/helpers.py index fa1d51b808eaa582e8843a30888f970ab77d72e5..d4f79562cda126cbb9714a7f66f4630a6b05fabb 100644 --- a/ckanext/odsh/helpers.py +++ b/ckanext/odsh/helpers.py @@ -26,6 +26,10 @@ import ckan.lib.helpers as helpers import os.path from collections import OrderedDict import pkg_resources +import ckan.logic.action.create as create + + +CKAN_TYPES = {'http://dcat-ap.de/def/datasetTypes/collection': 'collection'} get_action = logic.get_action log = logging.getLogger(__name__) @@ -371,7 +375,7 @@ def is_within_last_month(date, date_ref=None): return True return False -def tpsh_get_all_datasets_belonging_to_collection(context, collection_name): +def get_all_datasets_belonging_to_collection(context, collection_name): rel_collection_dict = dict({"id": collection_name}) name_list = list() try: @@ -384,14 +388,14 @@ def tpsh_get_all_datasets_belonging_to_collection(context, collection_name): name_list.append(item_object) return name_list -def tpsh_get_all_datasets_belonging_to_collection_by_dataset(context, dataset_name): - collection_name = tpsh_get_collection_name_by_dataset(context, dataset_name) +def get_all_datasets_belonging_to_collection_by_dataset(context, dataset_name): + collection_name = get_collection_name_by_dataset(context, dataset_name) if collection_name: - name_list = tpsh_get_all_datasets_belonging_to_collection(context, collection_name) + name_list = get_all_datasets_belonging_to_collection(context, collection_name) return name_list return list() -def tpsh_get_collection_name_by_dataset(context, dataset_name): +def get_collection_name_by_dataset(context, dataset_name): rel_dataset_dict = dict({"id" : dataset_name}) list_rel_dataset = toolkit.get_action('package_relationships_list')(context, rel_dataset_dict) if not len(list_rel_dataset): @@ -399,7 +403,7 @@ def tpsh_get_collection_name_by_dataset(context, dataset_name): collection_name = list_rel_dataset[0]['object'] return collection_name -def tpsh_get_successor_and_predecessor_dataset(context, pkg_dict): +def get_successor_and_predecessor_dataset(context, pkg_dict): dataset_name = pkg_dict.get('name') siblings_dicts_with_access = _get_siblings_dicts_with_access(context, pkg_dict) if siblings_dicts_with_access: @@ -421,7 +425,7 @@ def tpsh_get_successor_and_predecessor_dataset(context, pkg_dict): def _get_siblings_dicts_with_access(context, pkg_dict): dataset_name = pkg_dict.get('name') - list_of_siblings = tpsh_get_all_datasets_belonging_to_collection_by_dataset(context, dataset_name) + list_of_siblings = get_all_datasets_belonging_to_collection_by_dataset(context, dataset_name) n_siblings = len(list_of_siblings) if n_siblings>0: siblings_dicts = [get_package_dict(name) for name in list_of_siblings] @@ -445,8 +449,8 @@ def _sort_siblings_by_name_and_date(siblings_dicts): def get_package_dict(name): return model.Package.get(name).as_dict() -def tpsh_get_successor_and_predecessor_urls(context, pkg_dict): - successor_name, predecessor_name = tpsh_get_successor_and_predecessor_dataset(context, pkg_dict) +def get_successor_and_predecessor_urls(context, pkg_dict): + successor_name, predecessor_name = get_successor_and_predecessor_dataset(context, pkg_dict) successor_url, predecessor_url = ( helpers.url_for('dataset.read', id=name) if name is not None @@ -535,3 +539,185 @@ def odsh_load_raw_mdk_sample_dataset(): ) raise return result + + +def map_dct_type_to_ckan_type(dct_type): + ''' + matches the field dct:type from a harvested rdf file + to the corresponding ckan package type + ''' + ckan_type = CKAN_TYPES.get(dct_type) + return ckan_type + +def map_ckan_type_to_dct_type(ckan_type): + DCT_TYPES = _revert_dict(CKAN_TYPES) + dct_type = DCT_TYPES.get(ckan_type) + return dct_type + +def _revert_dict(d): + d_inverse = {v: k for k, v in d.items()} + return d_inverse + +def add_pkg_to_collection(id_pkg, id_collection): + if id_pkg and id_collection: + relationship_dict = { + 'subject': id_pkg, + 'object': id_collection, + 'type': 'child_of', + } + toolkit.get_action('package_relationship_create')(None, relationship_dict) + +def correct_missing_relationship(pkg_dict, pkg_relationships_from_model): + ''' + This function corrects missing relationship in show package. + Note this fix is only good with one or non relationship. + This error is well known but was not fixed. https://github.com/ckan/ckan/issues/3114 + The error causes the deletation of relationships, because package_show is + used in resource_create to get the package. + ''' + if pkg_relationships_from_model: + relationship_from_model = pkg_relationships_from_model[0] + relationship_list_from_dict = pkg_dict.get('relationships_as_subject') + type_pkg = pkg_dict.get('type') + needs_update = type_pkg == 'dataset' and not relationship_list_from_dict + if needs_update: + relationship_for_package = { + '__extras': { + 'object_package_id': relationship_from_model.object_package_id, + 'subject_package_id': relationship_from_model.subject_package_id, + }, + 'comment': relationship_from_model.subject_package_id, + 'id': relationship_from_model.id, + 'type': relationship_from_model.type, + } + pkg_dict['relationships_as_subject'].append(relationship_for_package) + return pkg_dict + +def get_pkg_relationships_from_model(pkg_dict): + pkg_id = pkg_dict.get('id') + return model.Package.get(pkg_id).get_relationships() + +def load_language_mapping(): + extension_path = pkg_resources.resource_filename('ckanext.odsh', '') + file_path = config.get('ckanext.odsh.language_mapping', extension_path + '/resources/language_mapping.json') + with open(file_path) as language_mapping_json: + LANGUAGE_MAPPING = json.loads(language_mapping_json.read()) + return LANGUAGE_MAPPING + +def load_json_to_ordered_dict(json_str): + return json.loads(json_str, object_pairs_hook=OrderedDict) + +def get_language_of_package(pkg_dict): + LANGUAGE_MAPPING = load_language_mapping() + language_id = _get_language_id(pkg_dict) + if not language_id: + return None + language = LANGUAGE_MAPPING.get(language_id) + return language + +def get_language_icon(pkg_dict): + ICONS = { + "http://publications.europa.eu/resource/authority/language/DAN": '/base/images/icon_lang_danish.png', + "http://publications.europa.eu/resource/authority/language/ENG": '/base/images/icon_lang_english.png', + } + language_id = _get_language_id(pkg_dict) + if not language_id: + return None + return ICONS.get(language_id) + +def _get_language_id(pkg_dict): + language_id = odsh_extract_value_from_extras(pkg_dict.get('extras'), 'language') + language_id = pkg_dict.get('language') + if not language_id: + language_id = odsh_extract_value_from_extras( + pkg_dict.get('extras'), 'language' + ) + if not language_id: + return None + language_id_cleaned = re.sub('[\[\]\"]', '', language_id) + return language_id_cleaned + +def get_spatial_for_selection(): + extension_path = pkg_resources.resource_filename('ckanext.odsh', '') + file_path = config.get('ckanext.odsh.spatial.mapping', extension_path + '/resources/schleswig-holstein_geojson.csv') + with open(file_path, newline='') as mapping_file: + cr = csv.reader(mapping_file, delimiter="\t") + spatial_mapping = list(cr) + + unique_mapping = [] + seen_values = set() + for key, value, _ in spatial_mapping: + if value in seen_values: + continue # Skip if the value has already been seen + + if "municipalityKey" in key: + unique_mapping.append({'key': key, 'value': value}) + else: + # Check if there is a municipality key entry for the value + municipality_entry = next( + (entry for entry in spatial_mapping if entry[1] == value and "municipalityKey" in entry[0]), + None + ) + + if municipality_entry: + # If a municipality key entry exists, use it instead of the current key + unique_mapping.append({'key': municipality_entry[0], 'value': value}) + else: + # Otherwise, use the current key + unique_mapping.append({'key': key, 'value': value}) + + seen_values.add(value) + + unique_mapping.append({'key': '', 'value': ''}) + return unique_mapping + + +def get_language_for_selection(): + LANGUAGE_MAPPING = load_language_mapping() + dict_for_select_box = [{'key': key, 'value': LANGUAGE_MAPPING[key]} for key in LANGUAGE_MAPPING] + return dict_for_select_box + +def get_package_dict(name): + ''' + raises ckan.logic.NotFound if not found + ''' + package_dict = toolkit.get_action('package_show')(None, {'id': name}) + return package_dict + +def size_of_fmt(num, suffix='B'): + for unit in ['',' k',' M',' G',' T',' P',' E',' Z']: + if abs(num) < 1000.0: + return "%3.1f%s%s" % (num, unit, suffix) + num /= 1000.0 + return "%.1f%s%s" % (num, 'Y', suffix) + +def get_resource_size(resource): + resource_size = resource.get('size') + if resource_size: + return size_of_fmt(resource_size) + + +def get_address_org(organization): + list_extras = organization.get('extras') + address = dict() + if not list_extras: + return address + for extra in list_extras: + address.update({extra.get('key'):extra.get('value')}) + web = address.get('web') + if web and not web.startswith('http'): + web = 'http://' + web + address.update({'web':web}) + return address + + +def get_body_mail(organization, package): + package_name = package.get('name') + url = helpers.url_for('dataset.read', id=package_name, qualified = True) + title = package.get('title') + anrede = "Sehr geehrte Damen und Herren," + "%0D%0A" + "%0D%0A" + "zu folgendem Eintrag habe ich eine Anmerkung/Frage:" + "%0D%0A" + "%0D%0A" + mail_titel = "Titel: " + title + "%0D%0A" + mail_document = "Dokument-ID: " + package_name + "%0D%0A" + mail_url = "URL: " + url + "%0D%0A" + "%0D%0A" + message = mail_titel + mail_document + mail_url + "Mein Kommentar:" + "%0D%0A" + "%0D%0A" + "%0D%0A" + "%0D%0A" + return anrede + message diff --git a/ckanext/odsh/helpers_tpsh.py b/ckanext/odsh/helpers_tpsh.py deleted file mode 100644 index c853e310777f507d025604abfa16b2aa3043c1a9..0000000000000000000000000000000000000000 --- a/ckanext/odsh/helpers_tpsh.py +++ /dev/null @@ -1,221 +0,0 @@ -# encoding: utf-8 - -import csv -import datetime -import logging -import json -import re -import urllib.request, urllib.error, urllib.parse -from collections import OrderedDict -import subprocess -import os -import pkg_resources - -from ckan.common import config -import ckan.lib.helpers as helpers -import ckan.logic.action.create as create -import ckan.model as model -import ckan.plugins.toolkit as toolkit - - -import ckanext.odsh.helpers as odsh_helpers - -log = logging.getLogger(__name__) - -CKAN_TYPES = {'http://dcat-ap.de/def/datasetTypes/collection': 'collection'} - - -def map_dct_type_to_ckan_type(dct_type): - ''' - matches the field dct:type from a harvested rdf file - to the corresponding ckan package type - ''' - ckan_type = CKAN_TYPES.get(dct_type) - return ckan_type - -def map_ckan_type_to_dct_type(ckan_type): - DCT_TYPES = _revert_dict(CKAN_TYPES) - dct_type = DCT_TYPES.get(ckan_type) - return dct_type - -def _revert_dict(d): - d_inverse = {v: k for k, v in d.items()} - return d_inverse - -def add_pkg_to_collection(id_pkg, id_collection): - if id_pkg and id_collection: - relationship_dict = { - 'subject': id_pkg, - 'object': id_collection, - 'type': 'child_of', - } - toolkit.get_action('package_relationship_create')(None, relationship_dict) - -def correct_missing_relationship(pkg_dict, pkg_relationships_from_model): - ''' - This function corrects missing relationship in show package. - Note this fix is only good with one or non relationship. - This error is well known but was not fixed. https://github.com/ckan/ckan/issues/3114 - The error causes the deletation of relationships, because package_show is - used in resource_create to get the package. - ''' - if pkg_relationships_from_model: - relationship_from_model = pkg_relationships_from_model[0] - relationship_list_from_dict = pkg_dict.get('relationships_as_subject') - type_pkg = pkg_dict.get('type') - needs_update = type_pkg == 'dataset' and not relationship_list_from_dict - if needs_update: - relationship_for_package = { - '__extras': { - 'object_package_id': relationship_from_model.object_package_id, - 'subject_package_id': relationship_from_model.subject_package_id, - }, - 'comment': relationship_from_model.subject_package_id, - 'id': relationship_from_model.id, - 'type': relationship_from_model.type, - } - pkg_dict['relationships_as_subject'].append(relationship_for_package) - return pkg_dict - -def get_pkg_relationships_from_model(pkg_dict): - pkg_id = pkg_dict.get('id') - return model.Package.get(pkg_id).get_relationships() - -def load_language_mapping(): - extension_path = pkg_resources.resource_filename('ckanext.odsh', '') - file_path = config.get('ckanext.odsh.language_mapping', extension_path + '/resources/language_mapping.json') - with open(file_path) as language_mapping_json: - LANGUAGE_MAPPING = json.loads(language_mapping_json.read()) - return LANGUAGE_MAPPING - -def load_json_to_ordered_dict(json_str): - return json.loads(json_str, object_pairs_hook=OrderedDict) - -def load_subject_mapping(): - extension_path = pkg_resources.resource_filename('ckanext.odsh', '') - file_path = config.get('ckanext.odsh.subject_mapping', extension_path + '/resources/subject_mapping.json') - with open(file_path) as subject_mapping_json: - SUBJECT_MAPPING = load_json_to_ordered_dict(subject_mapping_json.read()) - return SUBJECT_MAPPING - -def get_language_of_package(pkg_dict): - LANGUAGE_MAPPING = load_language_mapping() - language_id = _get_language_id(pkg_dict) - if not language_id: - return None - language = LANGUAGE_MAPPING.get(language_id) - return language - -def get_language_icon(pkg_dict): - ICONS = { - "http://publications.europa.eu/resource/authority/language/DAN": '/base/images/icon_lang_danish.png', - "http://publications.europa.eu/resource/authority/language/ENG": '/base/images/icon_lang_english.png', - } - language_id = _get_language_id(pkg_dict) - if not language_id: - return None - return ICONS.get(language_id) - -def _get_language_id(pkg_dict): - language_id = odsh_helpers.odsh_extract_value_from_extras(pkg_dict.get('extras'), 'language') - language_id = pkg_dict.get('language') - if not language_id: - language_id = odsh_helpers.odsh_extract_value_from_extras( - pkg_dict.get('extras'), 'language' - ) - if not language_id: - return None - language_id_cleaned = re.sub('[\[\]\"]', '', language_id) - return language_id_cleaned - -def get_spatial_for_selection(): - extension_path = pkg_resources.resource_filename('ckanext.odsh', '') - file_path = config.get('ckanext.odsh.spatial.mapping', extension_path + '/resources/schleswig-holstein_geojson.csv') - with open(file_path, newline='') as mapping_file: - cr = csv.reader(mapping_file, delimiter="\t") - spatial_mapping = list(cr) - - unique_mapping = [] - seen_values = set() - for key, value, _ in spatial_mapping: - if value in seen_values: - continue # Skip if the value has already been seen - - if "municipalityKey" in key: - unique_mapping.append({'key': key, 'value': value}) - else: - # Check if there is a municipality key entry for the value - municipality_entry = next( - (entry for entry in spatial_mapping if entry[1] == value and "municipalityKey" in entry[0]), - None - ) - - if municipality_entry: - # If a municipality key entry exists, use it instead of the current key - unique_mapping.append({'key': municipality_entry[0], 'value': value}) - else: - # Otherwise, use the current key - unique_mapping.append({'key': key, 'value': value}) - - seen_values.add(value) - - unique_mapping.append({'key': '', 'value': ''}) - return unique_mapping - -def get_subject_for_selection(): - SUBJECT_MAPPING = load_subject_mapping() - dict_for_select_box = [{'key': 'empty', 'value':' '}, ] - dict_for_select_box.extend( - [{'key': key, 'value': SUBJECT_MAPPING[key]} for key in SUBJECT_MAPPING] - ) - return dict_for_select_box - -def get_language_for_selection(): - LANGUAGE_MAPPING = load_language_mapping() - dict_for_select_box = [{'key': key, 'value': LANGUAGE_MAPPING[key]} for key in LANGUAGE_MAPPING] - return dict_for_select_box - -def get_package_dict(name): - ''' - raises ckan.logic.NotFound if not found - ''' - package_dict = toolkit.get_action('package_show')(None, {'id': name}) - return package_dict - -def size_of_fmt(num, suffix='B'): - for unit in ['',' k',' M',' G',' T',' P',' E',' Z']: - if abs(num) < 1000.0: - return "%3.1f%s%s" % (num, unit, suffix) - num /= 1000.0 - return "%.1f%s%s" % (num, 'Y', suffix) - -def get_resource_size(resource): - resource_size = resource.get('size') - if resource_size: - return size_of_fmt(resource_size) - - -def get_address_org(organization): - list_extras = organization.get('extras') - address = dict() - if not list_extras: - return address - for extra in list_extras: - address.update({extra.get('key'):extra.get('value')}) - web = address.get('web') - if web and not web.startswith('http'): - web = 'http://' + web - address.update({'web':web}) - return address - - -def get_body_mail(organization, package): - package_name = package.get('name') - url = helpers.url_for('dataset.read', id=package_name, qualified = True) - title = package.get('title') - anrede = "Sehr geehrte Damen und Herren," + "%0D%0A" + "%0D%0A" + "zu folgendem Eintrag habe ich eine Anmerkung/Frage:" + "%0D%0A" + "%0D%0A" - mail_titel = "Titel: " + title + "%0D%0A" - mail_document = "Dokument-ID: " + package_name + "%0D%0A" - mail_url = "URL: " + url + "%0D%0A" + "%0D%0A" - message = mail_titel + mail_document + mail_url + "Mein Kommentar:" + "%0D%0A" + "%0D%0A" + "%0D%0A" + "%0D%0A" - return anrede + message diff --git a/ckanext/odsh/logic/action.py b/ckanext/odsh/logic/action.py index 2985fb2fc0ef264b990699a50cb4196702a23da1..36d6b9782d7ad496fef3eeea5d53fedfeabbf00e 100644 --- a/ckanext/odsh/logic/action.py +++ b/ckanext/odsh/logic/action.py @@ -17,7 +17,7 @@ log = logging.getLogger(__name__) from ckanext.odsh.setup_proxy import setup_proxy, clear_proxy from ckanext.odsh.collection.helpers import get_collection_id, get_package_dict -from ckanext.odsh.helpers_tpsh import add_pkg_to_collection +from ckanext.odsh.helpers import add_pkg_to_collection from ckanext.odsh.helpers import odsh_extract_value_from_extras @@ -117,7 +117,7 @@ def odsh_user_create(context, data_dict): raise logic.ValidationError(PASSWORD_ERROR_MESSAGE) -def tpsh_user_update(context, data_dict): +def odsh_user_update(context, data_dict): password = data_dict.get('password') if not password: password = data_dict.get('password1') diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index a1f94235947df9e285ae47cb1f3406412c0dcc0f..c6d2cce365c1e0f42426c10b6dee0fce5455d043 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -11,8 +11,7 @@ import ckan.plugins as plugins import ckan.plugins.toolkit as toolkit # imports from this extension -import ckanext.odsh.helpers as odsh_helpers -import ckanext.odsh.helpers_tpsh as helpers_tpsh +import ckanext.odsh.helpers as helpers_odsh import ckanext.odsh.helper_pkg_dict as helper_pkg_dict from .helper_pkg_dict import HelperPgkDict import ckanext.odsh.logic.action as action @@ -60,7 +59,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm # DCAT # if toolkit.asbool(toolkit.config.get('ckanext.dcat.enable_rdf_endpoints', True)): - # odsh_helpers.odsh_remove_route(map, 'dcat_catalog') + # helpers_odsh.odsh_remove_route(map, 'dcat_catalog') # bp_default.add_url_rule('/catalog.<any("xml", "rdf", "n3", "ttl", "jsonld"):_format>', view_func=dcat_view.read_catalog, defaults={'_format': 'xml'}, methods=['GET']) # Package @@ -106,7 +105,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm def get_actions(self): return {'package_create': action.odsh_package_create, - 'user_update': action.tpsh_user_update, + 'user_update': action.odsh_user_update, 'user_create': action.odsh_user_create, 'resource_create': action.odsh_resource_create, } @@ -132,18 +131,18 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm def create_package_schema(self): schema = super(OdshPlugin, self).create_package_schema() self._update_schema(schema) - self._tpsh_update_create_or_update_package_schema(schema) + self._update_create_or_update_package_schema(schema) return schema def update_package_schema(self): schema = super(OdshPlugin, self).update_package_schema() self._update_schema(schema) - self._tpsh_update_create_or_update_package_schema(schema) + self._update_create_or_update_package_schema(schema) return schema def show_package_schema(self): schema = super(OdshPlugin, self).show_package_schema() - self._tpsh_update_show_package_schema(schema) + self._update_show_package_schema(schema) return schema def _update_schema(self, schema): @@ -175,7 +174,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm schema.update( {'__extras': [toolkit.get_converter('odsh_validate_extras')]}) - def _tpsh_update_create_or_update_package_schema(self, schema): + def _update_create_or_update_package_schema(self, schema): schema.update({ 'language': [ toolkit.get_validator('ignore_missing'), @@ -186,7 +185,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm toolkit.get_converter('convert_to_extras') ], 'relatedPackage': [ - toolkit.get_validator('tpsh_validate_relatedPackage'), + toolkit.get_validator('validate_relatedPackage'), toolkit.get_converter('convert_to_extras') ], 'accessibility': [ @@ -196,7 +195,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm }) return schema - def _tpsh_update_show_package_schema(self, schema): + def _update_show_package_schema(self, schema): schema.update({ 'language': [ toolkit.get_converter('convert_from_extras'), @@ -248,9 +247,9 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm adds the following key-value-pairs to pkg_dict: # key: 'is_new', value: True if the dataset has been created within the last month ''' - pkg_dict = helpers_tpsh.correct_missing_relationship( + pkg_dict = helpers_odsh.correct_missing_relationship( pkg_dict, - helpers_tpsh.get_pkg_relationships_from_model(pkg_dict) + helpers_odsh.get_pkg_relationships_from_model(pkg_dict) ) self._update_is_new_in_pkg_dict(pkg_dict) @@ -298,40 +297,39 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm # extension they belong to, to avoid clashing with functions from # other extensions. return { - 'odsh_main_groups': odsh_helpers.odsh_main_groups, - 'odsh_now': odsh_helpers.odsh_now, - 'odsh_group_id_selected': odsh_helpers.odsh_group_id_selected, - 'odsh_get_facet_items_dict': odsh_helpers.odsh_get_facet_items_dict, - 'odsh_openness_score_dataset_html': odsh_helpers.odsh_openness_score_dataset_html, - 'odsh_get_resource_details': odsh_helpers.odsh_get_resource_details, - 'odsh_get_resource_views': odsh_helpers.odsh_get_resource_views, - 'odsh_get_bounding_box': odsh_helpers.odsh_get_bounding_box, - 'odsh_get_spatial_text': odsh_helpers.odsh_get_spatial_text, - 'odsh_render_datetime': odsh_helpers.odsh_render_datetime, - 'odsh_resource_formats': odsh_helpers.odsh_resource_formats, - 'odsh_encodeurl': odsh_helpers.odsh_encodeurl, - 'odsh_extract_error': odsh_helpers.odsh_extract_error, - 'odsh_extract_error_new': odsh_helpers.odsh_extract_error_new, - 'odsh_extract_value_from_extras': odsh_helpers.odsh_extract_value_from_extras, - 'odsh_create_checksum': odsh_helpers.odsh_create_checksum, - 'presorted_license_options': odsh_helpers.presorted_license_options, - 'odsh_has_more_facets': odsh_helpers.odsh_has_more_facets, - 'odsh_public_url': odsh_helpers.odsh_public_url, - 'odsh_spatial_extends_available': odsh_helpers.spatial_extends_available, - 'odsh_public_resource_url': odsh_helpers.odsh_public_resource_url, - 'odsh_show_testbanner': odsh_helpers.odsh_show_testbanner, - 'tpsh_get_daterange_prettified': helper_pkg_dict.get_daterange_prettified, - 'tpsh_get_language_of_package': helpers_tpsh.get_language_of_package, - 'get_language_icon': helpers_tpsh.get_language_icon, - 'short_name_for_category': odsh_helpers.short_name_for_category, - 'get_spatial_for_selection': helpers_tpsh.get_spatial_for_selection, - 'get_subject_for_selection': helpers_tpsh.get_subject_for_selection, - 'get_language_for_selection': helpers_tpsh.get_language_for_selection, - 'tpsh_get_resource_size': helpers_tpsh.get_resource_size, - 'tpsh_get_address_org':helpers_tpsh.get_address_org, - 'tpsh_get_body_mail':helpers_tpsh.get_body_mail, - 'odsh_load_mdk_sample_dataset': odsh_helpers.odsh_load_mdk_sample_dataset, - 'odsh_load_raw_mdk_sample_dataset': odsh_helpers.odsh_load_raw_mdk_sample_dataset, + 'odsh_main_groups': helpers_odsh.odsh_main_groups, + 'odsh_now': helpers_odsh.odsh_now, + 'odsh_group_id_selected': helpers_odsh.odsh_group_id_selected, + 'odsh_get_facet_items_dict': helpers_odsh.odsh_get_facet_items_dict, + 'odsh_openness_score_dataset_html': helpers_odsh.odsh_openness_score_dataset_html, + 'odsh_get_resource_details': helpers_odsh.odsh_get_resource_details, + 'odsh_get_resource_views': helpers_odsh.odsh_get_resource_views, + 'odsh_get_bounding_box': helpers_odsh.odsh_get_bounding_box, + 'odsh_get_spatial_text': helpers_odsh.odsh_get_spatial_text, + 'odsh_render_datetime': helpers_odsh.odsh_render_datetime, + 'odsh_resource_formats': helpers_odsh.odsh_resource_formats, + 'odsh_encodeurl': helpers_odsh.odsh_encodeurl, + 'odsh_extract_error': helpers_odsh.odsh_extract_error, + 'odsh_extract_error_new': helpers_odsh.odsh_extract_error_new, + 'odsh_extract_value_from_extras': helpers_odsh.odsh_extract_value_from_extras, + 'odsh_create_checksum': helpers_odsh.odsh_create_checksum, + 'presorted_license_options': helpers_odsh.presorted_license_options, + 'odsh_has_more_facets': helpers_odsh.odsh_has_more_facets, + 'odsh_public_url': helpers_odsh.odsh_public_url, + 'odsh_spatial_extends_available': helpers_odsh.spatial_extends_available, + 'odsh_public_resource_url': helpers_odsh.odsh_public_resource_url, + 'odsh_show_testbanner': helpers_odsh.odsh_show_testbanner, + 'get_daterange_prettified': helper_pkg_dict.get_daterange_prettified, + 'get_language_of_package': helpers_odsh.get_language_of_package, + 'get_language_icon': helpers_odsh.get_language_icon, + 'short_name_for_category': helpers_odsh.short_name_for_category, + 'get_spatial_for_selection': helpers_odsh.get_spatial_for_selection, + 'get_language_for_selection': helpers_odsh.get_language_for_selection, + 'get_resource_size': helpers_odsh.get_resource_size, + 'get_address_org':helpers_odsh.get_address_org, + 'get_body_mail':helpers_odsh.get_body_mail, + 'odsh_load_mdk_sample_dataset': helpers_odsh.odsh_load_mdk_sample_dataset, + 'odsh_load_raw_mdk_sample_dataset': helpers_odsh.odsh_load_raw_mdk_sample_dataset, } diff --git a/ckanext/odsh/profiles/odsh_dcat_de_profile.py b/ckanext/odsh/profiles/odsh_dcat_de_profile.py index e5986f812b941a13dca6a1dd3dd0603ef945cac6..7e2026c69a5becb95103e1b4da5d35382f4d26e4 100644 --- a/ckanext/odsh/profiles/odsh_dcat_de_profile.py +++ b/ckanext/odsh/profiles/odsh_dcat_de_profile.py @@ -8,8 +8,7 @@ from ckanext.dcat.utils import resource_uri import ckanext.dcatde.dataset_utils as ds_utils from ckanext.dcatde.profiles import DCATdeProfile, DCATDE, DCAT, DCATDE_1_0, DCATDE_1_0_1 -import ckanext.odsh.helpers as odsh_helpers -import ckanext.odsh.helpers_tpsh as helpers_tpsh +import ckanext.odsh.helpers as helpers_odsh import ckanext.odsh.collection.helpers as helpers_collection @@ -49,7 +48,7 @@ class ODSHDCATdeProfile(DCATdeProfile): def _parse_type(self, dataset_dict, dataset_ref): dct_type = self._object(dataset_ref, DCT.type) if dct_type: - ckan_type = helpers_tpsh.map_dct_type_to_ckan_type(str(dct_type)) + ckan_type = helpers_odsh.map_dct_type_to_ckan_type(str(dct_type)) dataset_dict.update({'type': ckan_type}) def _parse_references(self, dataset_dict, dataset_ref): @@ -114,7 +113,7 @@ class ODSHDCATdeProfile(DCATdeProfile): Adds reference (Musterdatenkatalog/Musterdatensatz) extra field to dcat:references. ''' - sample_dataset_uri = odsh_helpers.odsh_extract_value_from_extras(dataset_dict.get('extras'), 'reference') + sample_dataset_uri = helpers_odsh.odsh_extract_value_from_extras(dataset_dict.get('extras'), 'reference') if sample_dataset_uri: self.g.set( (dataset_ref, DCT.references, @@ -150,7 +149,7 @@ class ODSHDCATdeProfile(DCATdeProfile): dct:type ''' ckan_type = self._get_ckan_type(dataset_dict) - dct_type = helpers_tpsh.map_ckan_type_to_dct_type(ckan_type) + dct_type = helpers_odsh.map_ckan_type_to_dct_type(ckan_type) if dct_type: self.g.set( (dataset_ref, DCT.type, diff --git a/ckanext/odsh/templates/header.html b/ckanext/odsh/templates/header.html index 708d0a572b31f637fe6276466cdb759b2c8d3dc1..85f97274022d38dc50fbf15d15e2f7b325883e4c 100644 --- a/ckanext/odsh/templates/header.html +++ b/ckanext/odsh/templates/header.html @@ -1,5 +1,5 @@ {% block scripts %} -{% asset 'ckanext-odsh/tpsh_toggle_menu' %} +{% asset 'ckanext-odsh/odsh_toggle_menu' %} {% endblock scripts %} {% block header_wrapper %} @@ -24,7 +24,7 @@ </div> <h1 class='site-title'> {{ g.site_title }} </h1> </div> - <div id="menu-button-and-title" data-module="tpsh_toggle_menu"> + <div id="menu-button-and-title" data-module="odsh_toggle_menu"> <span class="fa fa-bars"></span> <h1 class='site-title-mobile'> {{ g.site_title }} </h1> </div> @@ -34,7 +34,7 @@ <div class='row navigation-row'> <nav class="section navigation"> <ul class="nav nav-pills"> - <li class="header-menu-mobile" data-module="tpsh_toggle_menu"> + <li class="header-menu-mobile" data-module="odsh_toggle_menu"> <a>{{ _('Menu') }}</a> <img src="/base/images/icon_close_white.svg" alt="Menü schließen" aria-label="Menü schließen" /> </li> diff --git a/ckanext/odsh/templates/macros/form.html b/ckanext/odsh/templates/macros/form.html index 5cd97c690c3a28e0af88db0757287fa341f49b30..57a5c2a15e205d18abfc7442b36b63a8047a692c 100644 --- a/ckanext/odsh/templates/macros/form.html +++ b/ckanext/odsh/templates/macros/form.html @@ -134,7 +134,7 @@ Examples: selected=2011, error=errors.year) }} #} -{% macro tpsh_select(name, id='', label='', options='', selected='', error='', classes=[], attrs={}, +{% macro odsh_select(name, id='', label='', options='', selected='', error='', classes=[], attrs={}, is_required=false) %} {% set classes = (classes|list) %} {% do classes.append('control-select') %} diff --git a/ckanext/odsh/templates/organization/snippets/organization_form.html b/ckanext/odsh/templates/organization/snippets/organization_form.html index 1f8f80a564586a5d99e1442667873f3f2915ccb7..c0bf3069cf2826c1873480c3692c12954b297d82 100644 --- a/ckanext/odsh/templates/organization/snippets/organization_form.html +++ b/ckanext/odsh/templates/organization/snippets/organization_form.html @@ -29,7 +29,7 @@ - {% set extras = h.tpsh_get_address_org(data) %} + {% set extras = h.get_address_org(data) %} {{ form.input_address('person','Ansprechpartner', value= extras.person , index=0, placeholder='', type='text', attrs={}) }} diff --git a/ckanext/odsh/templates/package/snippets/info.html b/ckanext/odsh/templates/package/snippets/info.html index e32c0634afa161c13fd16c7d4d3115359f794869..927f32942a7faa67e1154f94ccaaacbb1107d5b7 100644 --- a/ckanext/odsh/templates/package/snippets/info.html +++ b/ckanext/odsh/templates/package/snippets/info.html @@ -9,7 +9,7 @@ Example: #} -{% set daterange = h.tpsh_get_daterange_prettified(pkg) %} +{% set daterange = h.get_daterange_prettified(pkg) %} {% set license_attribution_by_text = h.odsh_extract_value_from_extras(pkg.extras, 'licenseAttributionByText') %} {% block package_info %} diff --git a/ckanext/odsh/templates/package/snippets/package_basic_fields.html b/ckanext/odsh/templates/package/snippets/package_basic_fields.html index 505186a55ee714b97a487f99ec191b3c469b8d26..f497f0bb4ce1774c60ab8e27444a1d18c985167c 100644 --- a/ckanext/odsh/templates/package/snippets/package_basic_fields.html +++ b/ckanext/odsh/templates/package/snippets/package_basic_fields.html @@ -230,7 +230,7 @@ dataset_is_draft)) %} {# field language #} {% set before_selected = data.get('language') or h.odsh_extract_value_from_extras(data.extras, 'language') or 'http://publications.europa.eu/resource/authority/language/DEU' %} -{{ form.tpsh_select('language', label=_('language'), options=h.get_language_for_selection(), selected=before_selected , error=errors.language, is_required=False, classes=['control-full']) }} +{{ form.odsh_select('language', label=_('language'), options=h.get_language_for_selection(), selected=before_selected , error=errors.language, is_required=False, classes=['control-full']) }} {# field spatial_uri #} diff --git a/ckanext/odsh/templates/package/snippets/resource_form.html b/ckanext/odsh/templates/package/snippets/resource_form.html index 678d05a0c0aa1c4e1366699fef7a4ed1c6a63a25..fb3f99da26600dad2dde9bea8327f385ae176a6c 100644 --- a/ckanext/odsh/templates/package/snippets/resource_form.html +++ b/ckanext/odsh/templates/package/snippets/resource_form.html @@ -65,7 +65,7 @@ {% set error_string = _('odsh_resource_format_error_label') if errors.format %} {% set format_attrs = {'data-module': 'odsh_guessformat', 'data-module-formats':h.odsh_resource_formats(true)} %} - {{ form.tpsh_select('format', id='field-format', label=_('Format'), selected=data.format, options=h.odsh_resource_formats(), is_required=True, error=error_string, attrs=format_attrs, classes=['control-full'])}} + {{ form.odsh_select('format', id='field-format', label=_('Format'), selected=data.format, options=h.odsh_resource_formats(), is_required=True, error=error_string, attrs=format_attrs, classes=['control-full'])}} {% endblock %} {% endblock %} diff --git a/ckanext/odsh/templates/package/snippets/resource_item.html b/ckanext/odsh/templates/package/snippets/resource_item.html index b08e58bdbaaf4a5afc1f9ca6191556ddf58a0f40..b6f438c0499de0ff52cbaed5d1eb8671582f166a 100644 --- a/ckanext/odsh/templates/package/snippets/resource_item.html +++ b/ckanext/odsh/templates/package/snippets/resource_item.html @@ -5,7 +5,7 @@ {% set download = h.odsh_public_resource_url(res) or url %} {% set rtitle=h.resource_display_name(res) if res.name else ' '%} -{% set resource_size = h.tpsh_get_resource_size(res) %} +{% set resource_size = h.get_resource_size(res) %} {% set res_format = res.format.replace('_SRVC','') %} <li class="resource-item" data-id="{{ res.id }}"> diff --git a/ckanext/odsh/templates/snippets/organization.html b/ckanext/odsh/templates/snippets/organization.html index 3465d5cd16a241ea896ad76ae02db4a96479c4af..86e9203407ce2d9c79d58d40c9040059232172ce 100644 --- a/ckanext/odsh/templates/snippets/organization.html +++ b/ckanext/odsh/templates/snippets/organization.html @@ -34,7 +34,7 @@ Example: </div> <div class="information-organisation"> - {% set address = h.tpsh_get_address_org(organization) %} + {% set address = h.get_address_org(organization) %} {% set street = address.get('street') %} {% set location = address.get('location') %} {% set mail = address.get('mail') %} @@ -56,7 +56,7 @@ Example: {% if package %} {% set package_name = package.get('name') %} {% set betreff = "Open-Data-Portal Datensatz: "+ package_name%} - {% set body_mail = h.tpsh_get_body_mail(organization, package) %} + {% set body_mail = h.get_body_mail(organization, package) %} {% else %} {% set betreff = "Transparenzportal" %} {% endif %} {# package #} diff --git a/ckanext/odsh/templates/snippets/package_item.html b/ckanext/odsh/templates/snippets/package_item.html index 7130ddce2dbb567275c5259d1d1c2858a5aa451d..a96aa71c6f9c0db1b96acfdda72649fd9d4747e7 100644 --- a/ckanext/odsh/templates/snippets/package_item.html +++ b/ckanext/odsh/templates/snippets/package_item.html @@ -26,8 +26,8 @@ Example: {% set access_count=(package.tracking_summary.total if package.tracking_summary) or '-' %} {% set issued_extra = h.odsh_extract_value_from_extras(package.extras,'issued') %} {% set issued = h.odsh_render_datetime(issued_extra) if issued_extra else h.odsh_render_datetime(package.metadata_created)%} -{% set daterange = h.tpsh_get_daterange_prettified(package) %} -{% set language_of_package = h.tpsh_get_language_of_package(package) %} +{% set daterange = h.get_daterange_prettified(package) %} +{% set language_of_package = h.get_language_of_package(package) %} {% set language_icon = h.get_language_icon(package) %} {% set thumbnail = package.get('thumbnail') %} diff --git a/ckanext/odsh/templates/user/edit_user_form.html b/ckanext/odsh/templates/user/edit_user_form.html index 057a29155668ff269d187f13631828f1dc7cafca..3ed5777bdcc949c347d79c70391f12a5b9560b32 100644 --- a/ckanext/odsh/templates/user/edit_user_form.html +++ b/ckanext/odsh/templates/user/edit_user_form.html @@ -35,7 +35,7 @@ ) }} {{ form.input( - 'password1', type='password', label=_('Password'), id='field-password', value=data.password1, error=errors.password1, classes=['control-medium'], attrs={'autocomplete': 'off', 'data-module': 'tpsh_validate_password'} ) }} + 'password1', type='password', label=_('Password'), id='field-password', value=data.password1, error=errors.password1, classes=['control-medium'], attrs={'autocomplete': 'off', 'data-module': 'odsh_validate_password'} ) }} {{ form.input('password2', type='password', label=_('Confirm Password'), id='field-password-confirm', value=data.password2, error=errors.password2, classes=['control-medium'], attrs={'autocomplete': 'off'}) }} </fieldset> @@ -57,5 +57,5 @@ </form> {% block scripts %} - {% asset 'ckanext-odsh/tpsh_validate_password' %} + {% asset 'ckanext-odsh/odsh_validate_password' %} {% endblock scripts %} \ No newline at end of file diff --git a/ckanext/odsh/tests_tpsh/__init__.py b/ckanext/odsh/tests/resources/__init__.py similarity index 100% rename from ckanext/odsh/tests_tpsh/__init__.py rename to ckanext/odsh/tests/resources/__init__.py diff --git a/ckanext/odsh/tests_tpsh/resources/collection1.rdf b/ckanext/odsh/tests/resources/collection1.rdf similarity index 100% rename from ckanext/odsh/tests_tpsh/resources/collection1.rdf rename to ckanext/odsh/tests/resources/collection1.rdf diff --git a/ckanext/odsh/tests_tpsh/resources/org_dicts.py b/ckanext/odsh/tests/resources/org_dicts.py similarity index 100% rename from ckanext/odsh/tests_tpsh/resources/org_dicts.py rename to ckanext/odsh/tests/resources/org_dicts.py diff --git a/ckanext/odsh/tests_tpsh/resources/test.pdf b/ckanext/odsh/tests/resources/test.pdf similarity index 100% rename from ckanext/odsh/tests_tpsh/resources/test.pdf rename to ckanext/odsh/tests/resources/test.pdf diff --git a/ckanext/odsh/tests_tpsh/test_checksum.py b/ckanext/odsh/tests/test_checksum.py similarity index 100% rename from ckanext/odsh/tests_tpsh/test_checksum.py rename to ckanext/odsh/tests/test_checksum.py diff --git a/ckanext/odsh/tests_tpsh/test_date_range.py b/ckanext/odsh/tests/test_date_range.py similarity index 100% rename from ckanext/odsh/tests_tpsh/test_date_range.py rename to ckanext/odsh/tests/test_date_range.py diff --git a/ckanext/odsh/tests_tpsh/test_date_range_formatter.py b/ckanext/odsh/tests/test_date_range_formatter.py similarity index 100% rename from ckanext/odsh/tests_tpsh/test_date_range_formatter.py rename to ckanext/odsh/tests/test_date_range_formatter.py diff --git a/ckanext/odsh/tests_tpsh/test_helper_pkg_dict.py b/ckanext/odsh/tests/test_helper_pkg_dict.py similarity index 96% rename from ckanext/odsh/tests_tpsh/test_helper_pkg_dict.py rename to ckanext/odsh/tests/test_helper_pkg_dict.py index 504966e83d62d42f8caa05914bdf3fe6cd4d660e..6e5b3267ee2947bae45c3df51589244869cffa08 100644 --- a/ckanext/odsh/tests_tpsh/test_helper_pkg_dict.py +++ b/ckanext/odsh/tests/test_helper_pkg_dict.py @@ -3,7 +3,7 @@ from mock import patch, call import unittest from ckanext.odsh.helper_pkg_dict import HelperPgkDict -import ckanext.odsh.helpers_tpsh as helpers_tpsh +import ckanext.odsh.helpers as helpers_odsh import ckanext.odsh.uri_store as uri_store class TestHelperPkgDict(unittest.TestCase): @@ -46,7 +46,7 @@ class TestHelperPkgDict(unittest.TestCase): assert not (shall_be_part_of_collection) def test_update_relations_to_collection_members_leads_to_correct_call_of_add_to_collection(self): - with patch.object(helpers_tpsh, 'add_pkg_to_collection') as patch_add_package_to_collection: + with patch.object(helpers_odsh, 'add_pkg_to_collection') as patch_add_package_to_collection: # arange # taken from debugging _update_relations_to_collection_members: dataset_dict_collection = { @@ -72,7 +72,7 @@ class TestHelperPkgDict(unittest.TestCase): uri_store._set_uri_to_id({}) def test_update_relation_to_collection_leads_to_correct_call_of_add_to_collection(self): - with patch.object(helpers_tpsh, 'add_pkg_to_collection') as patch_add_package_to_collection: + with patch.object(helpers_odsh, 'add_pkg_to_collection') as patch_add_package_to_collection: # arange # taken from debugging _update_relations_to_collection_members: dataset_dict_collection_member = { @@ -141,7 +141,6 @@ class Test_get_date_start_and_end_from_pkg_dict(unittest.TestCase): {'key': 'groups', 'value': ''}, {'key': 'issued', 'value': '2019-07-06T00:00:00'}, {'key': 'licenseAttributionByText', 'value': ''}, - {'key': 'subject_text', 'value': ''}, {'key': 'temporal_end', 'value': '2019-08-31T00:00:00'}, {'key': 'temporal_start', 'value': '2019-08-01T00:00:00'} ], @@ -151,7 +150,6 @@ class Test_get_date_start_and_end_from_pkg_dict(unittest.TestCase): {'key': 'groups', 'value': ''}, {'key': 'issued', 'value': '2019-07-06T00:00:00'}, {'key': 'licenseAttributionByText', 'value': ''}, - {'key': 'subject_text', 'value': ''}, {'key': 'temporal_end', 'value': '2019-08-31T00:00:00'}, {'key': 'temporal_start', 'value': ''} ], @@ -161,7 +159,6 @@ class Test_get_date_start_and_end_from_pkg_dict(unittest.TestCase): {'key': 'groups', 'value': ''}, {'key': 'issued', 'value': '2019-07-06T00:00:00'}, {'key': 'licenseAttributionByText', 'value': ''}, - {'key': 'subject_text', 'value': ''}, {'key': 'temporal_end', 'value': ''}, {'key': 'temporal_start', 'value': '2019-08-01T00:00:00'} ], diff --git a/ckanext/odsh/tests_tpsh/test_helpers_tpsh.py b/ckanext/odsh/tests/test_helpers_tpsh.py similarity index 79% rename from ckanext/odsh/tests_tpsh/test_helpers_tpsh.py rename to ckanext/odsh/tests/test_helpers_tpsh.py index e566caaa30d08dc160a4f1c83b48ea6ff7f39e24..3c3f4ca3c30322bcbeffd2b9940d51b84046c3fa 100644 --- a/ckanext/odsh/tests_tpsh/test_helpers_tpsh.py +++ b/ckanext/odsh/tests/test_helpers_tpsh.py @@ -1,25 +1,19 @@ # encoding: utf-8 -import os from collections import namedtuple, OrderedDict -import datetime from mock import patch from ckan.common import config -import ckan.logic.action.create as create -from ckanext.odsh.tests_tpsh.resources import org_dicts +from ckanext.odsh.tests.resources import org_dicts import unittest -from ckanext.odsh.helpers_tpsh import ( +from ckanext.odsh.helpers import ( map_dct_type_to_ckan_type, map_ckan_type_to_dct_type, - add_pkg_to_collection, correct_missing_relationship, get_language_of_package, get_address_org, load_json_to_ordered_dict, - load_subject_mapping, - get_subject_for_selection ) @@ -202,11 +196,6 @@ class Test_get_address_org(unittest.TestCase): assert len(address) == 0 -def _add_subject_mapping_file_to_config(): - path_current_file = os.path.dirname(os.path.abspath(__file__)) - path_to_subject_mapping_file = path_current_file + '/resources/subject_mapping_for_tests.json' - config.update({'ckanext.odsh.subject_mapping': path_to_subject_mapping_file}) - class Test_load_json_to_ordered_dict(unittest.TestCase): def setUp(self): json_str = '{"A": 1, "B": 2, "D": 3, "C":4, "E": 0}' @@ -225,40 +214,3 @@ class Test_load_json_to_ordered_dict(unittest.TestCase): def test_it_preserves_order_of_values(self): values = list(self.result.values()) assert values == [1, 2, 3, 4, 0] - -class Test_load_subject_mapping(unittest.TestCase): - def setUp(self): - _add_subject_mapping_file_to_config() - self.SUBJECT_MAPPING = load_subject_mapping() - - def tearDown(self): - config.clear() - - def test_it_returns_an_ordered_dictionary(self): - assert type(self.SUBJECT_MAPPING) is OrderedDict - - def test_it_preserves_order_of_json_file(self): - keys = list(self.SUBJECT_MAPPING.keys()) - assert keys[0] == 'http://transparenz.schleswig-holstein.de/informationsgegenstand#Verwaltungsvorschrift' - assert keys[1] == 'http://transparenz.schleswig-holstein.de/informationsgegenstand#Organisationsplan' - assert keys[2] == 'http://transparenz.schleswig-holstein.de/informationsgegenstand#Geschaeftsverteilungsplan' - assert keys[3] == 'http://transparenz.schleswig-holstein.de/informationsgegenstand#Aktenplan' - -class Test_get_subject_for_selection(unittest.TestCase): - def setUp(self): - _add_subject_mapping_file_to_config() - self.result = get_subject_for_selection() - - def tearDown(self): - config.clear() - - def test_it_returns_a_list(self): - assert type(self.result) is list - - def test_first_element_is_empty(self): - assert self.result[0] == {'key': 'empty', 'value': ' '} - - def test_it_contains_more_than_one_element(self): - assert len(self.result) > 1 - - diff --git a/ckanext/odsh/tests_tpsh/test_odsh_helpers.py b/ckanext/odsh/tests/test_odsh_helpers.py similarity index 100% rename from ckanext/odsh/tests_tpsh/test_odsh_helpers.py rename to ckanext/odsh/tests/test_odsh_helpers.py diff --git a/ckanext/odsh/tests_tpsh/test_password_validation.py b/ckanext/odsh/tests/test_password_validation.py similarity index 100% rename from ckanext/odsh/tests_tpsh/test_password_validation.py rename to ckanext/odsh/tests/test_password_validation.py diff --git a/ckanext/odsh/tests/test_plugin.py b/ckanext/odsh/tests/test_plugin.py index af2f6e90324119090a8d6ca0c324b900e4cb1690..140bd8ae92afc4a21e9235038898f13a3da489b8 100644 --- a/ckanext/odsh/tests/test_plugin.py +++ b/ckanext/odsh/tests/test_plugin.py @@ -1,30 +1,53 @@ -import paste.fixture -import pylons.test -import ckan.plugins -import ckan.model as model -import ckan.tests.factories as factories -import ckan.tests.legacy as tests -from ckan.common import config +import datetime +import ckanext.odsh.plugin as plugin +import unittest -# class TestOdshPlugin(object): +class TestMethodBeforeView(unittest.TestCase): + date_time_format = '%Y-%m-%dT%H:%M:%S' -# @classmethod -# def setup_class(cls): -# cls.app = paste.fixture.TestApp(pylons.test.pylonsapp) -# ckan.plugins.load('odsh') + def test_before_view_adds_false_for_old_dataset(self): + plugin_object = plugin.OdshPlugin() + today = datetime.date.today() + hundred_days_ago = today - datetime.timedelta(days=100) + hundred_days_ago_as_ckan_str = self._date_as_ckan_str(hundred_days_ago) + dict_for_template = plugin_object.before_view( + { + 'extras': [ + {'key': 'issued', 'value': hundred_days_ago_as_ckan_str} + ] + } + ) + assert dict_for_template['is_new']==False -# def teardown(self): -# model.repo.rebuild_db() + def _date_as_ckan_str(self, date): + return date.strftime(self.date_time_format) -# @classmethod -# def teardown_class(cls): -# ckan.plugins.unload('odsh') - -# def test_plugin(self): -# pass - -# def test_user_cannot_access_dashboard(self): -# user = factories.User() -# tests.call_action_api(self.app, 'group_create', name='test-group', -# apikey=user['apikey']) + def test_before_view_adds_true_for_new_dataset(self): + plugin_object = plugin.OdshPlugin() + today = datetime.date.today() + ten_days_ago = today - datetime.timedelta(days=10) + ten_days_ago_as_ckan_str = self._date_as_ckan_str(ten_days_ago) + dict_for_template = plugin_object.before_view( + { + 'extras': [ + {'key': 'issued', 'value': ten_days_ago_as_ckan_str} + ] + } + ) + assert dict_for_template['is_new']==True + + def test_before_view_does_not_modify_unconcerned_dict_values(self): + plugin_object = plugin.OdshPlugin() + today = datetime.date.today() + ten_days_ago = today - datetime.timedelta(days=10) + ten_days_ago_as_ckan_str = self._date_as_ckan_str(ten_days_ago) + dict_for_template = plugin_object.before_view( + { + 'extras': [ + {'key': 'issued', 'value': ten_days_ago_as_ckan_str} + ], + 'some_other_key': 'some_other_value', + } + ) + assert dict_for_template['some_other_key']=='some_other_value' diff --git a/ckanext/odsh/tests_tpsh/test_profiles.py b/ckanext/odsh/tests/test_profiles.py similarity index 79% rename from ckanext/odsh/tests_tpsh/test_profiles.py rename to ckanext/odsh/tests/test_profiles.py index d0c00dea5e244f5b0355eb9a1b4ea4c874396fe8..acf97611b0f92d80d570be3b955ca0661843cfb2 100644 --- a/ckanext/odsh/tests_tpsh/test_profiles.py +++ b/ckanext/odsh/tests/test_profiles.py @@ -18,7 +18,7 @@ class TestODSHDCATdeProfileParseDatasetWithCollection(unittest.TestCase): ''' def setUp(self): rdf_graph = Graph() - rdf_graph.parse('ckanext/odsh/tests_tpsh/resources/collection1.rdf') + rdf_graph.parse('ckanext/odsh/tests/resources/collection1.rdf') self.profile = profiles.ODSHDCATdeProfile(rdf_graph) self.dataset_ref_with_collection = URIRefOrLiteral( 'http://opendata.schleswig-holstein.de/dataset/LAsDSH_SER_Statistik_anerkannte_Versorgungsberechtigte' @@ -59,30 +59,6 @@ class TestODSHDCATdeProfileParseDatasetWithCollection(unittest.TestCase): belongs_to_collection = self.profile._belongs_to_collection( dataset_dict, self.dataset_ref_with_member_not_in_collection) assert not belongs_to_collection - - -class TestODSHDCATdeProfileParseDatasetWithSubject(unittest.TestCase): - ''' - Tests for ODSHDCATdeProfile.parse_dataset with an rdf file - containing datasets with subjects - ''' - def setUp(self): - rdf_graph = Graph() - rdf_graph.parse('ckanext/odsh/tests_tpsh/resources/transparenz.rdf') - self.profile = profiles.ODSHDCATdeProfile(rdf_graph) - self.dataset_ref_with_subject = URIRefOrLiteral( - 'http://transparenz.schleswig-holstein.de/ae2a3cffda84388365bc87711ed4af47' - ) - - def test_parse_subject_returns_subject(self): - dataset_dict = {} - self.profile._parse_subject(dataset_dict, self.dataset_ref_with_subject) - assert 'http://d-nb.info/gnd/4128022-2' == dataset_dict['subject'] - - def test_parse_dataset_returns_subject(self): - dataset_dict = {} - self.profile.parse_dataset(dataset_dict, self.dataset_ref_with_subject) - assert 'http://d-nb.info/gnd/4128022-2' == dataset_dict['subject'] class TestODSHDCATdeProfileGraphFromDataset(unittest.TestCase): @@ -114,17 +90,6 @@ class TestODSHDCATdeProfileGraphFromDataset(unittest.TestCase): ) - @patch_no_collection_member - def test_it_adds_dct_subject(self, __): - dataset_dict = { - 'subject': 'http://some_subject', - 'type': 'dataset', - 'groups': [], - } - expected_node = '<dct:subject rdf:resource="http://some_subject"/>' - self.get_graph_and_assert_in(dataset_dict, self.dummy_dataset_ref, expected_node) - - @patch_no_collection_member def test_it_adds_dct_type_collection(self, __): dataset_dict = { diff --git a/ckanext/odsh/tests/test_search.py b/ckanext/odsh/tests/test_search.py index 854a7917a5f7a0c3a8e27ccafe1cae33f153f185..0988d909ce2f5e86cc9af2822abd03169653a5ec 100644 --- a/ckanext/odsh/tests/test_search.py +++ b/ckanext/odsh/tests/test_search.py @@ -1,253 +1,133 @@ -# encoding: utf-8 - -import ckan.tests.factories as factories -import ckan.tests.helpers as helpers -from bs4 import BeautifulSoup -from ckan import model -from ckan.lib.mailer import create_reset_key -from routes import url_for -import ckan.plugins -from .test_helpers import odsh_test -import pdb - - - -class TestSearch(helpers.FunctionalTestBase): - - _load_plugins = ['odsh', 'spatial_metadata', 'spatial_query'] - - def teardown(self): - model.repo.rebuild_db() - - @odsh_test() - def test_dataset_is_in_search_result(self): - # arrange - dataset = self._create_dataset() - - # act - response = self._perform_search() - - # assert - assert dataset['name'] in response - - @odsh_test() - def test_query_with_no_match_finds_no_dataset(self): - # arrange - dataset = self._create_dataset() - - # act - response = self._perform_search("foobar") - - # assert - self._assert_no_results(response) - - @odsh_test() - def test_query_with_no_dates_finds_dataset(self): - # arrange - dataset = self._create_dataset() - +import ckanext.odsh.search as search +import unittest + +class Test_before_search(unittest.TestCase): + def setUp(self): + self.search_params_before_test = { + 'extras': {}, + 'facet.field': ['organization', 'groups'], + 'fq': 'organization:"test-organisation" groups:"gove" +dataset_type:dataset', + 'include_private': True, + 'q': '', + 'rows': 20, + 'sort': 'score desc, metadata_modified desc', + 'start': 0 + } + self.search_params_with_facet_mincount = self.search_params_before_test.copy() + self.search_params_with_facet_mincount.update({'facet.mincount': 0}) + + def test_it_solely_adds_facet_mincount_to_dict_if_no_extras(self): + # arange + search_params = self.search_params_before_test.copy() # act - response = self._perform_date_search(None, None) - + search.before_search(search_params) # assert - assert dataset['name'] in response - - @odsh_test() - def test_query_with_very_old_dataset(self): - # arrange - dataseta = self._create_dataset('do_not_find_me', '2011-01-01', '2013-12-31') - datasetb = self._create_dataset('old_dataset', '1111-01-01', '1860-12-31') - - # act - response = self._perform_date_search('1110-12-30', '1960-02-01') - - # assert - assert 'wrong_start_date_for_search' not in response - self._assert_datasets_in_response([datasetb], response) - self._assert_datasets_not_in_response([dataseta], response) - - @odsh_test() - def test_query_with_end_before_start_finds_no_dataset(self): - # arrange - datasetA = self._create_dataset('dataseta', '1960-01-01', '1960-12-31') - - # act - response = self._perform_date_search('1960-12-30', '1960-02-01') - - # assert - self._assert_no_results(response) - - @odsh_test() - def test_query_with_wrong_dates_shows_error(self): - # arrange - dataset = self._create_dataset() - + search_params_expected = self.search_params_with_facet_mincount.copy() + assert search_params == search_params_expected + + def test_it_adds_fq_if_empty_range(self): + # arange + search_params = self.search_params_before_test.copy() + extras = {'ext_enddate': '2019-08-01', 'ext_startdate': '2019-08-02'} + search_params.update({'extras': extras}) + search_params_expected = self.search_params_with_facet_mincount.copy() + search_params_expected.update({'extras': extras}) + search_params_expected.update({ + 'fq': ( + 'organization:"test-organisation" groups:"gove" ' + '+dataset_type:dataset (+extras_temporal_start:[2019-08-02T00:00:00Z TO 2019-08-01T00:00:00Z] ' + 'OR +extras_temporal_end:[2019-08-02T00:00:00Z TO 2019-08-01T00:00:00Z] OR ' + '((*:* NOT extras_temporal_end:[* TO *]) AND extras_temporal_start:[* TO 2019-08-01T00:00:00Z]))' + ) + }) # act - response1 = self._perform_date_search('foo', None) - response2 = self._perform_date_search(None, 'foo') - response3 = self._perform_date_search('11-11-11', None) - + search.before_search(search_params) # assert - assert 'wrong_start_date_for_search' in response1 - self._assert_datasets_in_response([dataset], response1) - assert 'daterange: to' not in response1 - assert 'daterange: from' not in response1 - assert 'wrong_end_date_for_search' in response2 - self._assert_datasets_in_response([dataset], response2) - assert 'daterange: to' not in response2 - assert 'daterange: from' not in response2 - assert 'wrong_start_date_for_search' in response3 - assert 'daterange: to' not in response3 - assert 'daterange: from' not in response3 - self._assert_datasets_in_response([dataset], response3) - - @odsh_test() - def test_query_with_start_date_finds_one_dataset(self): - # arrange - datasetA = self._create_dataset('dataseta', '1960-01-01', '1960-12-31') - datasetB = self._create_dataset('datasetb', '1980-01-01', '1990-06-30') - datasetC = self._create_dataset('datasetc', '2001-03-01', '2001-04-30') - + assert search_params == search_params_expected + + def test_it_solely_adds_facet_mincount_to_dict_if_wrong_date_format_in_extras(self): + # arange + search_params = self.search_params_before_test.copy() + extras = {'ext_enddate': 'some_date', 'ext_startdate': 'some_date'} + search_params.update({'extras': extras}) + search_params_expected = self.search_params_with_facet_mincount.copy() + search_params_expected.update({'extras': extras}) # act - response1 = self._perform_date_search(None, '1990-01-01') - response2 = self._perform_date_search(None, '2010-12-31') - response3 = self._perform_date_search('2010-12-31', None) - response4 = self._perform_date_search('1985-04-01', '1985-04-20') - response5 = self._perform_date_search('2001-04-01', None) - + search.before_search(search_params) # assert - self._assert_datasets_in_response([datasetA, datasetB], response1) - self._assert_datasets_not_in_response([datasetC], response1) - assert 'daterange: to' in response1 - - self._assert_datasets_in_response( - [datasetA, datasetB, datasetC], response2) - assert 'daterange: to' in response2 - - self._assert_no_results(response3) - assert 'daterange: from' in response3 - - self._assert_datasets_in_response([datasetB], response4) - self._assert_datasets_not_in_response([datasetA, datasetC], response4) - assert 'daterange: to' in response4 - assert 'daterange: from' in response4 - - self._assert_datasets_in_response([datasetC], response5) - self._assert_datasets_not_in_response([datasetA, datasetB], response5) - - @odsh_test() - def test_dataset_combime_date_range_search_and_text_search_same_title(self): - # arrange - datasetA = self._create_dataset('dataseta', '1960-01-01', '1960-12-31','mytitle') - datasetB = self._create_dataset('datasetb', '1980-01-01', '1990-06-30', 'mytitle') - + assert search_params == search_params_expected + + def test_it_adds_fq_if_enclosing_range(self): + # arange + search_params = self.search_params_before_test.copy() + extras = {'ext_enddate': '2019-08-02', 'ext_startdate': '2019-08-01'} + search_params.update({'extras': extras}) + search_params_expected = self.search_params_with_facet_mincount.copy() + search_params_expected.update({'extras': extras}) + search_params_expected.update({ + 'fq': ( + 'organization:"test-organisation" groups:"gove" ' + '+dataset_type:dataset ' + '(+extras_temporal_start:[2019-08-01T00:00:00Z TO 2019-08-02T00:00:00Z] ' + 'OR +extras_temporal_end:[2019-08-01T00:00:00Z TO 2019-08-02T00:00:00Z] ' + 'OR (extras_temporal_start:[* TO 2019-08-01T00:00:00Z] AND ' + 'extras_temporal_end:[2019-08-02T00:00:00Z TO *]) OR ' + '((*:* NOT extras_temporal_end:[* TO *]) AND ' + 'extras_temporal_start:[* TO 2019-08-02T00:00:00Z]))' + ) + }) # act - response = self._perform_text_and_date_search('mytitle', None, '1970-01-01') - + search.before_search(search_params) # assert - self._assert_datasets_in_response([datasetA], response) - self._assert_datasets_not_in_response([datasetB], response) - - @odsh_test() - def test_dataset_combime_date_range_search_and_text_search_same_dates(self): - # arrange - datasetA = self._create_dataset('dataseta', '1960-01-01', '1960-12-31','mytitle') - datasetB = self._create_dataset('datasetb', '1960-01-01', '1960-12-31','othertitle') - datasetC = self._create_dataset('datasetc', '1980-01-01', '1990-06-30', 'mytitle') - + assert search_params == search_params_expected + + def test_it_adds_fq_if_start_only(self): + # arange + search_params = self.search_params_before_test.copy() + extras = {'ext_startdate': '2019-08-01'} + search_params.update({'extras': extras}) + search_params_expected = self.search_params_with_facet_mincount.copy() + search_params_expected.update({'extras': extras}) + search_params_expected.update({ + 'fq': ( + 'organization:"test-organisation" groups:"gove" ' + '+dataset_type:dataset ' + '(+extras_temporal_start:[2019-08-01T00:00:00Z TO *] ' + 'OR +extras_temporal_end:[2019-08-01T00:00:00Z TO *] ' + 'OR (*:* NOT extras_temporal_end:[* TO *]))' + ) + }) # act - response = self._perform_text_and_date_search('mytitle', None, '1970-01-01') - + search.before_search(search_params) # assert - self._assert_datasets_in_response([datasetA], response) - self._assert_datasets_not_in_response([datasetB, datasetC], response) - - @odsh_test() - def test_dataset_without_end(self): - # arrange - datasetA = self._create_dataset('dataseta', '1960-01-01', None,'mytitle') - + assert search_params == search_params_expected + + def test_it_adds_fq_if_end_only(self): + # arange + search_params = self.search_params_before_test.copy() + extras = {'ext_enddate': '2019-08-02'} + search_params.update({'extras': extras}) + search_params_expected = self.search_params_with_facet_mincount.copy() + search_params_expected.update({'extras': extras}) + search_params_expected.update({ + 'fq': ( + 'organization:"test-organisation" groups:"gove" ' + '+dataset_type:dataset ' + '(+extras_temporal_start:[* TO 2019-08-02T00:00:00Z] OR ' + '+extras_temporal_end:[* TO 2019-08-02T00:00:00Z] ' + 'OR ((*:* NOT extras_temporal_end:[* TO *]) ' + 'AND extras_temporal_start:[* TO 2019-08-02T00:00:00Z]))' + ) + }) # act - response1 = self._perform_text_and_date_search('mytitle', '1950-01-01', '1950-02-01') - response2 = self._perform_text_and_date_search('mytitle', '1950-01-01', '1960-02-01') - response3 = self._perform_text_and_date_search('mytitle', '1950-01-01', None) - response4 = self._perform_text_and_date_search('mytitle', None, '1970-01-01') - response5 = self._perform_text_and_date_search('mytitle', '1970-01-01', '1980-02-01') - response6 = self._perform_text_and_date_search('mytitle', None, '1950-01-01') - + search.before_search(search_params) # assert - self._assert_datasets_not_in_response([datasetA], response1) - self._assert_datasets_in_response([datasetA], response2) - self._assert_datasets_in_response([datasetA], response3) - self._assert_datasets_in_response([datasetA], response4) - self._assert_datasets_in_response([datasetA], response5) - self._assert_datasets_not_in_response([datasetA], response6) - - @odsh_test() - def test_dataset_new_has_label(self): - # arrange - datasetA = self._create_dataset('dataseta', '1960-01-01', None,'mytitle') - + assert search_params == search_params_expected + + def test_it_returns_search_params(self): + # arange + search_params = self.search_params_before_test.copy() # act - response = self._perform_text_and_date_search('mytitle', None, None) - + return_value = search.before_search(search_params) # assert - response.mustcontain('new-dataset-label') - - def _assert_datasets_in_response(self, datasets, response): - for dataset in datasets: - assert dataset['name'] in response - - def _assert_datasets_not_in_response(self, datasets, response): - for dataset in datasets: - assert dataset['name'] not in response - - def _assert_no_results(self, response): - assert "No datasets found" in response - - def _create_dataset(self, name='my-own-dataset', temporal_start='2000-01-27', temporal_end='2000-01-27',title='title'): - user = factories.User() - extras = [ - {'key': 'temporal_start', 'value': temporal_start}, - {'key': 'temporal_end', 'value': temporal_end}, - {'key': 'issued', 'value': '2000-01-27'}, - {'key': 'groups', 'value': 'soci'}, - {'key': 'licenseAttributionByText', 'value': 'text'}, - {'key': 'spatial_uri', 'value': 'http://dcat-ap.de/def/politicalGeocoding/districtKey/01001'} - ] - return factories.Dataset(user=user, - name=name, - title=title, - issued='27-01-2000', - extras=extras, - license_id='http://dcat-ap.de/def/licenses/dl-by-de/2.0') - - def _perform_search(self, query=None): - search_form = self._perform_search_for_form('dataset-search-box-form') - if query is not None: - search_form['q'] = query - return helpers.webtest_submit(search_form) - - def _perform_date_search(self, search_from, search_to): - search_form = self._perform_search_for_form('dataset-search-box-form') - if search_form is not None: - search_form['ext_startdate'] = search_from - if search_to is not None: - search_form['ext_enddate'] = search_to - return helpers.webtest_submit(search_form) - - def _perform_text_and_date_search(self, query, search_from, search_to): - search_form = self._perform_search_for_form('dataset-search-box-form') - search_form['q'] = query - if search_form is not None: - search_form['ext_startdate'] = search_from - if search_to is not None: - search_form['ext_enddate'] = search_to - return helpers.webtest_submit(search_form) - - def _perform_search_for_form(self, form): - search_url = url_for(named_route='dataset.search') - search_response = self._get_test_app().get(search_url) - - search_form = search_response.forms[form] - return search_form + assert search_params == return_value diff --git a/ckanext/odsh/tests_tpsh/test_uri_store.py b/ckanext/odsh/tests/test_uri_store.py similarity index 100% rename from ckanext/odsh/tests_tpsh/test_uri_store.py rename to ckanext/odsh/tests/test_uri_store.py diff --git a/ckanext/odsh/tests_tpsh/resources/subject_mapping_for_tests.json b/ckanext/odsh/tests_tpsh/resources/subject_mapping_for_tests.json deleted file mode 100644 index 2e8bd946d9237ed177f8d3759defc4732d2f8ddf..0000000000000000000000000000000000000000 --- a/ckanext/odsh/tests_tpsh/resources/subject_mapping_for_tests.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Verwaltungsvorschrift" : "Verwaltungsvorschrift", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Organisationsplan" : "Organisationsplan", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Geschaeftsverteilungsplan" : "Geschäftsverteilungsplan", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Aktenplan" : "Aktenplan", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Richtlinie" : "Richtlinie und Runderlass", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Statistik" : "amtliche Statistik", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Taetigkeitsbericht" : "Tätigkeitsbericht", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Broschuere" : "Broschüre", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Gutachten" : "Gutachten", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Studie" : "Studie", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Haushaltsplan" : "Haushaltsplan", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Stellenplan" : "Stellenplan", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Wirtschaftsplan" : "Wirtschaftsplan", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#ZuwendungAnPerson" : "Übersicht über Zuwendungen an juristische Personen des Privatrechts", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#ZuwendungAnLand" : "Übersicht über Zuwendungen an das Land Schleswig-Holstein", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#IZGAntwort" : "IZG/GvgV-Auskunft", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Gerichtsurteil" : "Gerichtsurteil", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#GesetzvorlageLandtag" : "Gesetzesvorlage an den Landtag", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#MitteilungLandtag" : "Mitteilung an den Landtag", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Unternehmensdaten" : "wesentliche Unternehmensdaten von Beteiligungen des Landes", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#VergütungsOG" : "jährliche Vergütungen nach dem VergütungsOG", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#Vertrag" : "Vertrag", - "http://transparenz.schleswig-holstein.de/informationsgegenstand#sonstiges" : "sonstiges" -} - \ No newline at end of file diff --git a/ckanext/odsh/tests_tpsh/resources/transparenz.rdf b/ckanext/odsh/tests_tpsh/resources/transparenz.rdf deleted file mode 100644 index ea4fb5e3c229d3e01feb3e4bb562f644cb8017da..0000000000000000000000000000000000000000 --- a/ckanext/odsh/tests_tpsh/resources/transparenz.rdf +++ /dev/null @@ -1,1145 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<rdf:RDF xmlns:dcatde="http://dcat-ap.de/def/dcatde/1_0/" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:dct="http://purl.org/dc/terms/" -xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:schema="http://schema.org/"> - <dcat:Catalog rdf:about="https://transparenz.schleswig-holstein.de/catalog"> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/9f9ae60bb0d8985e10e9ab8aa6a7ca34"> - <dct:title>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt (Jahr 2017)</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5768d5cdbc58abd45c8620e44e017f01" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/UXO/Berichte/PDF/Berichte/af_blano_fortschritt2017.pdf?__blob=publicationFile&v=5"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/UXO/Berichte/PDF/Berichte/af_blano_fortschritt2017.pdf?__blob=publicationFile&v=5" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt (Jahr 2017)</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-05-02</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-05-02</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/ff612d0f165d46f3091f58e1ef56a2ec"> - <dct:title>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt (Jahr 2016)</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5768d5cdbc58abd45c8620e44e017f01" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/UXO/Berichte/PDF/Berichte/ae_blano_fortschritt2016.pdf?__blob=publicationFile&v=6"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/UXO/Berichte/PDF/Berichte/ae_blano_fortschritt2016.pdf?__blob=publicationFile&v=6" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt (Jahr 2016)</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2017-04-10</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2017-04-10</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/3a0d0674120fbf06b5cb8737124e3fd0"> - <dct:title>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt (Jahr 2015)</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5768d5cdbc58abd45c8620e44e017f01" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/UXO/Berichte/PDF/Berichte/ad_blano_fortschritt2015.pdf?__blob=publicationFile&v=8"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/UXO/Berichte/PDF/Berichte/ad_blano_fortschritt2015.pdf?__blob=publicationFile&v=8" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt (Jahr 2015)</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2016-07-10</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2016-07-10</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/b5cd3f303f594ecde96e1017e953b688"> - <dct:title>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt (Jahr 2014)</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5768d5cdbc58abd45c8620e44e017f01" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/UXO/Berichte/PDF/Berichte/ad_blano_fortschritt2014.pdf?__blob=publicationFile&v=4"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/UXO/Berichte/PDF/Berichte/ad_blano_fortschritt2014.pdf?__blob=publicationFile&v=4" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt (Jahr 2014)</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-07-17</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-07-17</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/cd606b042789723a2b6d61cb31c46c39"> - <dct:title>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt (Jahr 2013)</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5768d5cdbc58abd45c8620e44e017f01" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/UXO/Berichte/PDF/Berichte/ac_blano_fortschritt2013.pdf?__blob=publicationFile&v=1"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/UXO/Berichte/PDF/Berichte/ac_blano_fortschritt2013.pdf?__blob=publicationFile&v=1" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt (Jahr 2013)</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2014-07-26</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2014-07-26</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/04640ac19a21450984d2af7c402d6aa0"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2006 - Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2006.pdf?__blob=publicationFile&v=6"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2006.pdf?__blob=publicationFile&v=6" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2006 - Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-29</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-29</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/86fe10eb6578e940d7df8e3d6da6520d"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2007 - Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2007.pdf?__blob=publicationFile&v=6"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2007.pdf?__blob=publicationFile&v=6" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2007 - Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-29</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-29</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/b0024265f96b9de5a590541f5e0aec91"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2008 - Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2008.pdf?__blob=publicationFile&v=6"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2008.pdf?__blob=publicationFile&v=6" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2008 - Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-29</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-29</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/ccb65ee5047e3c9cc67384b513400246"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2009 - Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2009.pdf?__blob=publicationFile&v=6"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2009.pdf?__blob=publicationFile&v=6" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2009 - Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-29</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-29</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/ae2a3cffda84388365bc87711ed4af47"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2010 - Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2010.pdf?__blob=publicationFile&v=6"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2010.pdf?__blob=publicationFile&v=6" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2010 - Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-29</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-29</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/91a479991245f208dd6f8ba82411a570"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2011 - Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2011.pdf?__blob=publicationFile&v=6"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2011.pdf?__blob=publicationFile&v=6" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2011 - Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-28</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-28</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/1ee93d311ae6078dc11655c2ca8865b5"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2012 - Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2012.pdf?__blob=publicationFile&v=6"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2012.pdf?__blob=publicationFile&v=6" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2012 - Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-28</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-28</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/f5123967a8d0d80ff135342ce41a09bb"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2013 - Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2013.pdf?__blob=publicationFile&v=5"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2013.pdf?__blob=publicationFile&v=5" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2013 - Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-28</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-28</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/05199f38b6234e794f79ad3726957a3e"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2014/15 - Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2015.pdf?__blob=publicationFile&v=3"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2015.pdf?__blob=publicationFile&v=3" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2014/15 - Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2016-07-14</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2016-07-14</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/ffef477b7ebb1447d869b33c79cac8e2"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2016/17 - Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2017.pdf?__blob=publicationFile&v=3"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2017.pdf?__blob=publicationFile&v=3" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2016/17 - Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-08-01</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-08-01</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/a1fea922aa7d9f7a924784615301da83"> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein 2015/16 – Bericht</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2016.pdf?__blob=publicationFile&v=2"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/VIII/Service/Broschueren/Broschueren_VIII/Gesundheit/schuleinguntber2016.pdf?__blob=publicationFile&v=2" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein 2015/16 – Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2017-11-27</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2017-11-27</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/423e1ea7e98b492aebc0ca5108c7b36d"> - <dct:title>Jahresbericht 2017 zur biologischen Vielfalt - Jagd und Artenschutz</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/7ee94f73beb43faf4099208b4e55734b" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/V/Service/Broschueren/Broschueren_V/Umwelt/pdf/Jahresbericht_Zur_biologischen_Vielfalt_2017.pdf?__blob=publicationFile&v=3"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/V/Service/Broschueren/Broschueren_V/Umwelt/pdf/Jahresbericht_Zur_biologischen_Vielfalt_2017.pdf?__blob=publicationFile&v=3" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Jahresbericht 2017 zur biologischen Vielfalt - Jagd und Artenschutz</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-01-16</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-01-16</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/6ea87d1f4a92efb288ed53e2bf901880"> - <dct:title>Jahresbericht 2018 zur biologischen Vielfalt - Jagd und Artenschutz</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/7ee94f73beb43faf4099208b4e55734b" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/V/Service/Broschueren/Broschueren_V/Umwelt/pdf/Jahresbericht_zur_biologischen_Vielfalt_2018.pdf?__blob=publicationFile&v=2"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/V/Service/Broschueren/Broschueren_V/Umwelt/pdf/Jahresbericht_zur_biologischen_Vielfalt_2018.pdf?__blob=publicationFile&v=2" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Jahresbericht 2018 zur biologischen Vielfalt - Jagd und Artenschutz</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-12-16</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-12-16</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/7f6ef434153bdbfff9ed42c8d9ee1381"> - <dct:title>Jahresbericht 2016 zur biologischen Vielfalt – Jagd- und Artenschutz</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/7ee94f73beb43faf4099208b4e55734b" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Landesregierung/V/Service/Broschueren/Broschueren_V/Umwelt/pdf/biodiversitaetsbericht2016.pdf?__blob=publicationFile&v=3"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Landesregierung/V/Service/Broschueren/Broschueren_V/Umwelt/pdf/biodiversitaetsbericht2016.pdf?__blob=publicationFile&v=3" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Jahresbericht 2016 zur biologischen Vielfalt – Jagd- und Artenschutz</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2016-12-21</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2016-12-21</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/f681f52201dcf1b1ea467aeed683c8a2"> - <dct:title>Waldzustandsbericht 2018</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2018.pdf?__blob=publicationFile&v=2"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2018.pdf?__blob=publicationFile&v=2" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2018</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-11-29</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-11-29</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/225ebaffe8e7a30483ac43935e91e1f4"> - <dct:title>Waldzustandsbericht 2017</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht_2017.pdf?__blob=publicationFile&v=1"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht_2017.pdf?__blob=publicationFile&v=1" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2017</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2017-12-27</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2017-12-27</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/9f48b6c643a139a0b4e7eac2ab4cfbb0"> - <dct:title>Waldzustandsbericht 2016</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2016.pdf?__blob=publicationFile&v=3"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2016.pdf?__blob=publicationFile&v=3" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2016</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2016-12-15</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2016-12-15</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/904ef47daad01d2979ab20dda18b2ae7"> - <dct:title>Waldzustandsbericht 2015</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2015.pdf?__blob=publicationFile&v=3"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2015.pdf?__blob=publicationFile&v=3" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2015</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-31</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-12-31</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/2147dcaa148ff19a89fa99c989dd648e"> - <dct:title>Waldzustandsbericht 2014</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2014.pdf?__blob=publicationFile&v=2"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2014.pdf?__blob=publicationFile&v=2" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2014</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2014-12-31</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2014-12-31</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/f201ecaf859f8e713cd030615bd3f5cb"> - <dct:title>Waldzustandsbericht 2013</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2013.pdf?__blob=publicationFile&v=2"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2013.pdf?__blob=publicationFile&v=2" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2013</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2013-12-31</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2013-12-31</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/9bbeaf7b503dbd2c667786db08c4512d"> - <dct:title>Waldzustandsbericht 2012</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2012.pdf?__blob=publicationFile&v=2"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2012.pdf?__blob=publicationFile&v=2" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2012</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2012-12-31</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2012-12-31</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/f6de9c145fe28effe99fc163b92d657e"> - <dct:title>Waldzustandsbericht 2011</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2011.pdf?__blob=publicationFile&v=1"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2011.pdf?__blob=publicationFile&v=1" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2011</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2011-12-31</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2011-12-31</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/5d794a0f4064ba53b5047dbe36eef3ef"> - <dct:title>Waldzustandsbericht 2010</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2010.pdf?__blob=publicationFile&v=1"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2010.pdf?__blob=publicationFile&v=1" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2010</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-12-31</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-12-31</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/0ac0c2ceb265a7c0ca18385c95ec6e3a"> - <dct:title>Waldzustandsbericht 2009</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2009.pdf?__blob=publicationFile&v=1"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2009.pdf?__blob=publicationFile&v=1" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2009</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2009-12-31</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2009-12-31</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/2f21507e1dc4e9106e348a65bb9e5cfa"> - <dct:title>Waldzustandsbericht 2008</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2008.pdf?__blob=publicationFile&v=1"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2008.pdf?__blob=publicationFile&v=1" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2008</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2009-01-06</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2009-01-06</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/1e4b51fbab78072693617fcc2458824e"> - <dct:title>Waldzustandsbericht 2006/2007</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2006_2007.pdf?__blob=publicationFile&v=1"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2006_2007.pdf?__blob=publicationFile&v=1" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldzustandsbericht 2006/2007</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2008-02-18</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2008-02-18</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/ac543132dfecddfdaa9ef8385034323f"> - <dct:title>Waldschadensbericht 2005</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2005.pdf?__blob=publicationFile&v=1"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2005.pdf?__blob=publicationFile&v=1" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldschadensbericht 2005</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2006-03-22</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2006-03-22</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - <dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/f9727d9cfb4ad6f923a800e0f116b6e3"> - <dct:title>Waldschadensbericht 2004</dct:title> - - <dct:isVersionOf rdf:resource="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63" /> - <dcat:distribution> - <dcat:Distribution rdf:about="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2004.pdf?__blob=publicationFile&v=1"> - <dct:title></dct:title> - <dcat:accessURL rdf:resource="https://www.schleswig-holstein.de/DE/Fachinhalte/W/wald/Downloads/Waldzustandsbericht2004.pdf?__blob=publicationFile&v=1" /> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:format rdf:resource="http://publications.europa.eu/resource/authority/file-type/PDF" /> - <dcat:mediaType>application/pdf</dcat:mediaType> - </dcat:Distribution> - </dcat:distribution> - <dct:subject rdf:resource="http://d-nb.info/gnd/4128022-2"/> - <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/GOVE" /> - <dct:description>Waldschadensbericht 2004</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU"/> - <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2004-11-30</dct:issued> - <dct:license rdf:resource="http://dcat-ap.de/def/licenses/cc-zero" /> - <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-07-15T14:55:00.00000</dct:modified> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - <dct:temporal> - <dct:PeriodOfTime> - <schema:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2004-11-30</schema:startDate> - </dct:PeriodOfTime> - </dct:temporal> - </dcat:Dataset> - </dcat:dataset> - -<dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/5768d5cdbc58abd45c8620e44e017f01"> - <dct:type rdf:resource="http://dcat-ap.de/def/datasetTypes/collection" /> - <dct:title>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt</dct:title> - <dct:description>Munitionsbelastung der deutschen Meeresgewässer – Entwicklungen und Fortschritt</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU" /> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/b5cd3f303f594ecde96e1017e953b688" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/9f9ae60bb0d8985e10e9ab8aa6a7ca34" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/ff612d0f165d46f3091f58e1ef56a2ec" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/3a0d0674120fbf06b5cb8737124e3fd0" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/cd606b042789723a2b6d61cb31c46c39" /> - - </dcat:Dataset> - </dcat:dataset> -<dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/f1f2513c3899ecf6f15691e0e4412822"> - <dct:type rdf:resource="http://dcat-ap.de/def/datasetTypes/collection" /> - <dct:title>Schuleingangsuntersuchungen in Schleswig-Holstein – Bericht</dct:title> - <dct:description>Schuleingangsuntersuchungen in Schleswig-Holstein – Bericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU" /> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/ae2a3cffda84388365bc87711ed4af47" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/1ee93d311ae6078dc11655c2ca8865b5" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/91a479991245f208dd6f8ba82411a570" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/b0024265f96b9de5a590541f5e0aec91" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/04640ac19a21450984d2af7c402d6aa0" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/ffef477b7ebb1447d869b33c79cac8e2" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/a1fea922aa7d9f7a924784615301da83" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/86fe10eb6578e940d7df8e3d6da6520d" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/ccb65ee5047e3c9cc67384b513400246" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/f5123967a8d0d80ff135342ce41a09bb" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/05199f38b6234e794f79ad3726957a3e" /> - - </dcat:Dataset> - </dcat:dataset> -<dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/5ffd27c528f7ab6936318da90d5cdd63"> - <dct:type rdf:resource="http://dcat-ap.de/def/datasetTypes/collection" /> - <dct:title>Waldzustandsbericht</dct:title> - <dct:description>Waldzustandsbericht</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU" /> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/1e4b51fbab78072693617fcc2458824e" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/0ac0c2ceb265a7c0ca18385c95ec6e3a" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/f9727d9cfb4ad6f923a800e0f116b6e3" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/904ef47daad01d2979ab20dda18b2ae7" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/5d794a0f4064ba53b5047dbe36eef3ef" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/2147dcaa148ff19a89fa99c989dd648e" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/f201ecaf859f8e713cd030615bd3f5cb" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/9bbeaf7b503dbd2c667786db08c4512d" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/ac543132dfecddfdaa9ef8385034323f" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/f6de9c145fe28effe99fc163b92d657e" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/f681f52201dcf1b1ea467aeed683c8a2" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/9f48b6c643a139a0b4e7eac2ab4cfbb0" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/225ebaffe8e7a30483ac43935e91e1f4" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/2f21507e1dc4e9106e348a65bb9e5cfa" /> - - </dcat:Dataset> - </dcat:dataset> -<dcat:dataset> - <dcat:Dataset rdf:about="http://transparenz.schleswig-holstein.de/7ee94f73beb43faf4099208b4e55734b"> - <dct:type rdf:resource="http://dcat-ap.de/def/datasetTypes/collection" /> - <dct:title>Jahresbericht zur biologischen Vielfalt</dct:title> - <dct:description>Jahresbericht zur biologischen Vielfalt</dct:description> - <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DEU" /> - <dct:spatial> - <dct:Location rdf:about="http://dcat-ap.de/def/politicalGeocoding/stateKey/01" /> - </dct:spatial> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/423e1ea7e98b492aebc0ca5108c7b36d" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/6ea87d1f4a92efb288ed53e2bf901880" /> - - <dct:hasVersion rdf:resource="http://transparenz.schleswig-holstein.de/7f6ef434153bdbfff9ed42c8d9ee1381" /> - - </dcat:Dataset> - </dcat:dataset> -</dcat:Catalog> -</rdf:RDF> - diff --git a/ckanext/odsh/tests_tpsh/test_plugin.py b/ckanext/odsh/tests_tpsh/test_plugin.py deleted file mode 100644 index 140bd8ae92afc4a21e9235038898f13a3da489b8..0000000000000000000000000000000000000000 --- a/ckanext/odsh/tests_tpsh/test_plugin.py +++ /dev/null @@ -1,53 +0,0 @@ -import datetime - -import ckanext.odsh.plugin as plugin -import unittest - -class TestMethodBeforeView(unittest.TestCase): - date_time_format = '%Y-%m-%dT%H:%M:%S' - - def test_before_view_adds_false_for_old_dataset(self): - plugin_object = plugin.OdshPlugin() - today = datetime.date.today() - hundred_days_ago = today - datetime.timedelta(days=100) - hundred_days_ago_as_ckan_str = self._date_as_ckan_str(hundred_days_ago) - dict_for_template = plugin_object.before_view( - { - 'extras': [ - {'key': 'issued', 'value': hundred_days_ago_as_ckan_str} - ] - } - ) - assert dict_for_template['is_new']==False - - def _date_as_ckan_str(self, date): - return date.strftime(self.date_time_format) - - def test_before_view_adds_true_for_new_dataset(self): - plugin_object = plugin.OdshPlugin() - today = datetime.date.today() - ten_days_ago = today - datetime.timedelta(days=10) - ten_days_ago_as_ckan_str = self._date_as_ckan_str(ten_days_ago) - dict_for_template = plugin_object.before_view( - { - 'extras': [ - {'key': 'issued', 'value': ten_days_ago_as_ckan_str} - ] - } - ) - assert dict_for_template['is_new']==True - - def test_before_view_does_not_modify_unconcerned_dict_values(self): - plugin_object = plugin.OdshPlugin() - today = datetime.date.today() - ten_days_ago = today - datetime.timedelta(days=10) - ten_days_ago_as_ckan_str = self._date_as_ckan_str(ten_days_ago) - dict_for_template = plugin_object.before_view( - { - 'extras': [ - {'key': 'issued', 'value': ten_days_ago_as_ckan_str} - ], - 'some_other_key': 'some_other_value', - } - ) - assert dict_for_template['some_other_key']=='some_other_value' diff --git a/ckanext/odsh/tests_tpsh/test_search.py b/ckanext/odsh/tests_tpsh/test_search.py deleted file mode 100644 index a8f216163cd612d72c24319cca7e32ad9e3362e4..0000000000000000000000000000000000000000 --- a/ckanext/odsh/tests_tpsh/test_search.py +++ /dev/null @@ -1,133 +0,0 @@ -import ckanext.odsh.search as search -import unittest - -class Test_before_search(unittest.TestCase): - def setUp(self): - self.search_params_before_test = { - 'extras': {}, - 'facet.field': ['organization', 'subject_text', 'groups'], - 'fq': 'organization:"test-organisation" groups:"gove" subject_text:"T\xe4tigkeitsbericht" +dataset_type:dataset', - 'include_private': True, - 'q': '', - 'rows': 20, - 'sort': 'score desc, metadata_modified desc', - 'start': 0 - } - self.search_params_with_facet_mincount = self.search_params_before_test.copy() - self.search_params_with_facet_mincount.update({'facet.mincount': 0}) - - def test_it_solely_adds_facet_mincount_to_dict_if_no_extras(self): - # arange - search_params = self.search_params_before_test.copy() - # act - search.before_search(search_params) - # assert - search_params_expected = self.search_params_with_facet_mincount.copy() - assert search_params == search_params_expected - - def test_it_adds_fq_if_empty_range(self): - # arange - search_params = self.search_params_before_test.copy() - extras = {'ext_enddate': '2019-08-01', 'ext_startdate': '2019-08-02'} - search_params.update({'extras': extras}) - search_params_expected = self.search_params_with_facet_mincount.copy() - search_params_expected.update({'extras': extras}) - search_params_expected.update({ - 'fq': ( - 'organization:"test-organisation" groups:"gove" subject_text:"T\xe4tigkeitsbericht" ' - '+dataset_type:dataset (+extras_temporal_start:[2019-08-02T00:00:00Z TO 2019-08-01T00:00:00Z] ' - 'OR +extras_temporal_end:[2019-08-02T00:00:00Z TO 2019-08-01T00:00:00Z] OR ' - '((*:* NOT extras_temporal_end:[* TO *]) AND extras_temporal_start:[* TO 2019-08-01T00:00:00Z]))' - ) - }) - # act - search.before_search(search_params) - # assert - assert search_params == search_params_expected - - def test_it_solely_adds_facet_mincount_to_dict_if_wrong_date_format_in_extras(self): - # arange - search_params = self.search_params_before_test.copy() - extras = {'ext_enddate': 'some_date', 'ext_startdate': 'some_date'} - search_params.update({'extras': extras}) - search_params_expected = self.search_params_with_facet_mincount.copy() - search_params_expected.update({'extras': extras}) - # act - search.before_search(search_params) - # assert - assert search_params == search_params_expected - - def test_it_adds_fq_if_enclosing_range(self): - # arange - search_params = self.search_params_before_test.copy() - extras = {'ext_enddate': '2019-08-02', 'ext_startdate': '2019-08-01'} - search_params.update({'extras': extras}) - search_params_expected = self.search_params_with_facet_mincount.copy() - search_params_expected.update({'extras': extras}) - search_params_expected.update({ - 'fq': ( - 'organization:"test-organisation" groups:"gove" ' - 'subject_text:"T\xe4tigkeitsbericht" +dataset_type:dataset ' - '(+extras_temporal_start:[2019-08-01T00:00:00Z TO 2019-08-02T00:00:00Z] ' - 'OR +extras_temporal_end:[2019-08-01T00:00:00Z TO 2019-08-02T00:00:00Z] ' - 'OR (extras_temporal_start:[* TO 2019-08-01T00:00:00Z] AND ' - 'extras_temporal_end:[2019-08-02T00:00:00Z TO *]) OR ' - '((*:* NOT extras_temporal_end:[* TO *]) AND ' - 'extras_temporal_start:[* TO 2019-08-02T00:00:00Z]))' - ) - }) - # act - search.before_search(search_params) - # assert - assert search_params == search_params_expected - - def test_it_adds_fq_if_start_only(self): - # arange - search_params = self.search_params_before_test.copy() - extras = {'ext_startdate': '2019-08-01'} - search_params.update({'extras': extras}) - search_params_expected = self.search_params_with_facet_mincount.copy() - search_params_expected.update({'extras': extras}) - search_params_expected.update({ - 'fq': ( - 'organization:"test-organisation" groups:"gove" ' - 'subject_text:"T\xe4tigkeitsbericht" +dataset_type:dataset ' - '(+extras_temporal_start:[2019-08-01T00:00:00Z TO *] ' - 'OR +extras_temporal_end:[2019-08-01T00:00:00Z TO *] ' - 'OR (*:* NOT extras_temporal_end:[* TO *]))' - ) - }) - # act - search.before_search(search_params) - # assert - assert search_params == search_params_expected - - def test_it_adds_fq_if_end_only(self): - # arange - search_params = self.search_params_before_test.copy() - extras = {'ext_enddate': '2019-08-02'} - search_params.update({'extras': extras}) - search_params_expected = self.search_params_with_facet_mincount.copy() - search_params_expected.update({'extras': extras}) - search_params_expected.update({ - 'fq': ( - 'organization:"test-organisation" groups:"gove" ' - 'subject_text:"T\xe4tigkeitsbericht" +dataset_type:dataset ' - '(+extras_temporal_start:[* TO 2019-08-02T00:00:00Z] OR ' - '+extras_temporal_end:[* TO 2019-08-02T00:00:00Z] ' - 'OR ((*:* NOT extras_temporal_end:[* TO *]) ' - 'AND extras_temporal_start:[* TO 2019-08-02T00:00:00Z]))' - ) - }) - # act - search.before_search(search_params) - # assert - assert search_params == search_params_expected - - def test_it_returns_search_params(self): - # arange - search_params = self.search_params_before_test.copy() - # act - return_value = search.before_search(search_params) - # assert - assert search_params == return_value diff --git a/ckanext/odsh/tests_tpsh/resources/__init__.py b/ckanext/odsh/tests_wip/__init__.py similarity index 100% rename from ckanext/odsh/tests_tpsh/resources/__init__.py rename to ckanext/odsh/tests_wip/__init__.py diff --git a/ckanext/odsh/tests/ckan_selenium.py b/ckanext/odsh/tests_wip/ckan_selenium.py similarity index 100% rename from ckanext/odsh/tests/ckan_selenium.py rename to ckanext/odsh/tests_wip/ckan_selenium.py diff --git a/ckanext/odsh/tests/harvest_sever_mock.py b/ckanext/odsh/tests_wip/harvest_sever_mock.py similarity index 100% rename from ckanext/odsh/tests/harvest_sever_mock.py rename to ckanext/odsh/tests_wip/harvest_sever_mock.py diff --git a/ckanext/odsh/tests/icap_sever_mock.py b/ckanext/odsh/tests_wip/icap_sever_mock.py similarity index 100% rename from ckanext/odsh/tests/icap_sever_mock.py rename to ckanext/odsh/tests_wip/icap_sever_mock.py diff --git a/ckanext/odsh/tests/rdf_catalog.xml b/ckanext/odsh/tests_wip/rdf_catalog.xml similarity index 100% rename from ckanext/odsh/tests/rdf_catalog.xml rename to ckanext/odsh/tests_wip/rdf_catalog.xml diff --git a/ckanext/odsh/tests/rdf_catalog_empty.xml b/ckanext/odsh/tests_wip/rdf_catalog_empty.xml similarity index 100% rename from ckanext/odsh/tests/rdf_catalog_empty.xml rename to ckanext/odsh/tests_wip/rdf_catalog_empty.xml diff --git a/ckanext/odsh/tests/result_data.json b/ckanext/odsh/tests_wip/result_data.json similarity index 100% rename from ckanext/odsh/tests/result_data.json rename to ckanext/odsh/tests_wip/result_data.json diff --git a/ckanext/odsh/tests/spatial_mapping.csv b/ckanext/odsh/tests_wip/spatial_mapping.csv similarity index 100% rename from ckanext/odsh/tests/spatial_mapping.csv rename to ckanext/odsh/tests_wip/spatial_mapping.csv diff --git a/ckanext/odsh/tests/test_data.json b/ckanext/odsh/tests_wip/test_data.json similarity index 100% rename from ckanext/odsh/tests/test_data.json rename to ckanext/odsh/tests_wip/test_data.json diff --git a/ckanext/odsh/tests/test_datarequest.py b/ckanext/odsh/tests_wip/test_datarequest.py similarity index 100% rename from ckanext/odsh/tests/test_datarequest.py rename to ckanext/odsh/tests_wip/test_datarequest.py diff --git a/ckanext/odsh/tests/test_env.py b/ckanext/odsh/tests_wip/test_env.py similarity index 100% rename from ckanext/odsh/tests/test_env.py rename to ckanext/odsh/tests_wip/test_env.py diff --git a/ckanext/odsh/tests/test_harvest.py b/ckanext/odsh/tests_wip/test_harvest.py similarity index 100% rename from ckanext/odsh/tests/test_harvest.py rename to ckanext/odsh/tests_wip/test_harvest.py diff --git a/ckanext/odsh/tests/test_helpers.py b/ckanext/odsh/tests_wip/test_helpers.py similarity index 100% rename from ckanext/odsh/tests/test_helpers.py rename to ckanext/odsh/tests_wip/test_helpers.py diff --git a/ckanext/odsh/tests_wip/test_plugin.py b/ckanext/odsh/tests_wip/test_plugin.py new file mode 100644 index 0000000000000000000000000000000000000000..af2f6e90324119090a8d6ca0c324b900e4cb1690 --- /dev/null +++ b/ckanext/odsh/tests_wip/test_plugin.py @@ -0,0 +1,30 @@ +import paste.fixture +import pylons.test +import ckan.plugins +import ckan.model as model +import ckan.tests.factories as factories +import ckan.tests.legacy as tests +from ckan.common import config + + +# class TestOdshPlugin(object): + +# @classmethod +# def setup_class(cls): +# cls.app = paste.fixture.TestApp(pylons.test.pylonsapp) +# ckan.plugins.load('odsh') + +# def teardown(self): +# model.repo.rebuild_db() + +# @classmethod +# def teardown_class(cls): +# ckan.plugins.unload('odsh') + +# def test_plugin(self): +# pass + +# def test_user_cannot_access_dashboard(self): +# user = factories.User() +# tests.call_action_api(self.app, 'group_create', name='test-group', +# apikey=user['apikey']) diff --git a/ckanext/odsh/tests/test_rdfexport.py b/ckanext/odsh/tests_wip/test_rdfexport.py similarity index 100% rename from ckanext/odsh/tests/test_rdfexport.py rename to ckanext/odsh/tests_wip/test_rdfexport.py diff --git a/ckanext/odsh/tests/test_routes.py b/ckanext/odsh/tests_wip/test_routes.py similarity index 100% rename from ckanext/odsh/tests/test_routes.py rename to ckanext/odsh/tests_wip/test_routes.py diff --git a/ckanext/odsh/tests_wip/test_search.py b/ckanext/odsh/tests_wip/test_search.py new file mode 100644 index 0000000000000000000000000000000000000000..854a7917a5f7a0c3a8e27ccafe1cae33f153f185 --- /dev/null +++ b/ckanext/odsh/tests_wip/test_search.py @@ -0,0 +1,253 @@ +# encoding: utf-8 + +import ckan.tests.factories as factories +import ckan.tests.helpers as helpers +from bs4 import BeautifulSoup +from ckan import model +from ckan.lib.mailer import create_reset_key +from routes import url_for +import ckan.plugins +from .test_helpers import odsh_test +import pdb + + + +class TestSearch(helpers.FunctionalTestBase): + + _load_plugins = ['odsh', 'spatial_metadata', 'spatial_query'] + + def teardown(self): + model.repo.rebuild_db() + + @odsh_test() + def test_dataset_is_in_search_result(self): + # arrange + dataset = self._create_dataset() + + # act + response = self._perform_search() + + # assert + assert dataset['name'] in response + + @odsh_test() + def test_query_with_no_match_finds_no_dataset(self): + # arrange + dataset = self._create_dataset() + + # act + response = self._perform_search("foobar") + + # assert + self._assert_no_results(response) + + @odsh_test() + def test_query_with_no_dates_finds_dataset(self): + # arrange + dataset = self._create_dataset() + + # act + response = self._perform_date_search(None, None) + + # assert + assert dataset['name'] in response + + @odsh_test() + def test_query_with_very_old_dataset(self): + # arrange + dataseta = self._create_dataset('do_not_find_me', '2011-01-01', '2013-12-31') + datasetb = self._create_dataset('old_dataset', '1111-01-01', '1860-12-31') + + # act + response = self._perform_date_search('1110-12-30', '1960-02-01') + + # assert + assert 'wrong_start_date_for_search' not in response + self._assert_datasets_in_response([datasetb], response) + self._assert_datasets_not_in_response([dataseta], response) + + @odsh_test() + def test_query_with_end_before_start_finds_no_dataset(self): + # arrange + datasetA = self._create_dataset('dataseta', '1960-01-01', '1960-12-31') + + # act + response = self._perform_date_search('1960-12-30', '1960-02-01') + + # assert + self._assert_no_results(response) + + @odsh_test() + def test_query_with_wrong_dates_shows_error(self): + # arrange + dataset = self._create_dataset() + + # act + response1 = self._perform_date_search('foo', None) + response2 = self._perform_date_search(None, 'foo') + response3 = self._perform_date_search('11-11-11', None) + + # assert + assert 'wrong_start_date_for_search' in response1 + self._assert_datasets_in_response([dataset], response1) + assert 'daterange: to' not in response1 + assert 'daterange: from' not in response1 + assert 'wrong_end_date_for_search' in response2 + self._assert_datasets_in_response([dataset], response2) + assert 'daterange: to' not in response2 + assert 'daterange: from' not in response2 + assert 'wrong_start_date_for_search' in response3 + assert 'daterange: to' not in response3 + assert 'daterange: from' not in response3 + self._assert_datasets_in_response([dataset], response3) + + @odsh_test() + def test_query_with_start_date_finds_one_dataset(self): + # arrange + datasetA = self._create_dataset('dataseta', '1960-01-01', '1960-12-31') + datasetB = self._create_dataset('datasetb', '1980-01-01', '1990-06-30') + datasetC = self._create_dataset('datasetc', '2001-03-01', '2001-04-30') + + # act + response1 = self._perform_date_search(None, '1990-01-01') + response2 = self._perform_date_search(None, '2010-12-31') + response3 = self._perform_date_search('2010-12-31', None) + response4 = self._perform_date_search('1985-04-01', '1985-04-20') + response5 = self._perform_date_search('2001-04-01', None) + + # assert + self._assert_datasets_in_response([datasetA, datasetB], response1) + self._assert_datasets_not_in_response([datasetC], response1) + assert 'daterange: to' in response1 + + self._assert_datasets_in_response( + [datasetA, datasetB, datasetC], response2) + assert 'daterange: to' in response2 + + self._assert_no_results(response3) + assert 'daterange: from' in response3 + + self._assert_datasets_in_response([datasetB], response4) + self._assert_datasets_not_in_response([datasetA, datasetC], response4) + assert 'daterange: to' in response4 + assert 'daterange: from' in response4 + + self._assert_datasets_in_response([datasetC], response5) + self._assert_datasets_not_in_response([datasetA, datasetB], response5) + + @odsh_test() + def test_dataset_combime_date_range_search_and_text_search_same_title(self): + # arrange + datasetA = self._create_dataset('dataseta', '1960-01-01', '1960-12-31','mytitle') + datasetB = self._create_dataset('datasetb', '1980-01-01', '1990-06-30', 'mytitle') + + # act + response = self._perform_text_and_date_search('mytitle', None, '1970-01-01') + + # assert + self._assert_datasets_in_response([datasetA], response) + self._assert_datasets_not_in_response([datasetB], response) + + @odsh_test() + def test_dataset_combime_date_range_search_and_text_search_same_dates(self): + # arrange + datasetA = self._create_dataset('dataseta', '1960-01-01', '1960-12-31','mytitle') + datasetB = self._create_dataset('datasetb', '1960-01-01', '1960-12-31','othertitle') + datasetC = self._create_dataset('datasetc', '1980-01-01', '1990-06-30', 'mytitle') + + # act + response = self._perform_text_and_date_search('mytitle', None, '1970-01-01') + + # assert + self._assert_datasets_in_response([datasetA], response) + self._assert_datasets_not_in_response([datasetB, datasetC], response) + + @odsh_test() + def test_dataset_without_end(self): + # arrange + datasetA = self._create_dataset('dataseta', '1960-01-01', None,'mytitle') + + # act + response1 = self._perform_text_and_date_search('mytitle', '1950-01-01', '1950-02-01') + response2 = self._perform_text_and_date_search('mytitle', '1950-01-01', '1960-02-01') + response3 = self._perform_text_and_date_search('mytitle', '1950-01-01', None) + response4 = self._perform_text_and_date_search('mytitle', None, '1970-01-01') + response5 = self._perform_text_and_date_search('mytitle', '1970-01-01', '1980-02-01') + response6 = self._perform_text_and_date_search('mytitle', None, '1950-01-01') + + # assert + self._assert_datasets_not_in_response([datasetA], response1) + self._assert_datasets_in_response([datasetA], response2) + self._assert_datasets_in_response([datasetA], response3) + self._assert_datasets_in_response([datasetA], response4) + self._assert_datasets_in_response([datasetA], response5) + self._assert_datasets_not_in_response([datasetA], response6) + + @odsh_test() + def test_dataset_new_has_label(self): + # arrange + datasetA = self._create_dataset('dataseta', '1960-01-01', None,'mytitle') + + # act + response = self._perform_text_and_date_search('mytitle', None, None) + + # assert + response.mustcontain('new-dataset-label') + + def _assert_datasets_in_response(self, datasets, response): + for dataset in datasets: + assert dataset['name'] in response + + def _assert_datasets_not_in_response(self, datasets, response): + for dataset in datasets: + assert dataset['name'] not in response + + def _assert_no_results(self, response): + assert "No datasets found" in response + + def _create_dataset(self, name='my-own-dataset', temporal_start='2000-01-27', temporal_end='2000-01-27',title='title'): + user = factories.User() + extras = [ + {'key': 'temporal_start', 'value': temporal_start}, + {'key': 'temporal_end', 'value': temporal_end}, + {'key': 'issued', 'value': '2000-01-27'}, + {'key': 'groups', 'value': 'soci'}, + {'key': 'licenseAttributionByText', 'value': 'text'}, + {'key': 'spatial_uri', 'value': 'http://dcat-ap.de/def/politicalGeocoding/districtKey/01001'} + ] + return factories.Dataset(user=user, + name=name, + title=title, + issued='27-01-2000', + extras=extras, + license_id='http://dcat-ap.de/def/licenses/dl-by-de/2.0') + + def _perform_search(self, query=None): + search_form = self._perform_search_for_form('dataset-search-box-form') + if query is not None: + search_form['q'] = query + return helpers.webtest_submit(search_form) + + def _perform_date_search(self, search_from, search_to): + search_form = self._perform_search_for_form('dataset-search-box-form') + if search_form is not None: + search_form['ext_startdate'] = search_from + if search_to is not None: + search_form['ext_enddate'] = search_to + return helpers.webtest_submit(search_form) + + def _perform_text_and_date_search(self, query, search_from, search_to): + search_form = self._perform_search_for_form('dataset-search-box-form') + search_form['q'] = query + if search_form is not None: + search_form['ext_startdate'] = search_from + if search_to is not None: + search_form['ext_enddate'] = search_to + return helpers.webtest_submit(search_form) + + def _perform_search_for_form(self, form): + search_url = url_for(named_route='dataset.search') + search_response = self._get_test_app().get(search_url) + + search_form = search_response.forms[form] + return search_form diff --git a/ckanext/odsh/tests/test_selenium.py b/ckanext/odsh/tests_wip/test_selenium.py similarity index 100% rename from ckanext/odsh/tests/test_selenium.py rename to ckanext/odsh/tests_wip/test_selenium.py diff --git a/ckanext/odsh/tests/test_statistikNordHarvester_old.py b/ckanext/odsh/tests_wip/test_statistikNordHarvester_old.py similarity index 100% rename from ckanext/odsh/tests/test_statistikNordHarvester_old.py rename to ckanext/odsh/tests_wip/test_statistikNordHarvester_old.py diff --git a/ckanext/odsh/tests/test_upload.py b/ckanext/odsh/tests_wip/test_upload.py similarity index 100% rename from ckanext/odsh/tests/test_upload.py rename to ckanext/odsh/tests_wip/test_upload.py diff --git a/ckanext/odsh/tests/test_user.py b/ckanext/odsh/tests_wip/test_user.py similarity index 100% rename from ckanext/odsh/tests/test_user.py rename to ckanext/odsh/tests_wip/test_user.py diff --git a/ckanext/odsh/tests/test_validation.py b/ckanext/odsh/tests_wip/test_validation.py similarity index 81% rename from ckanext/odsh/tests/test_validation.py rename to ckanext/odsh/tests_wip/test_validation.py index ea1912d0d6fcec4bf12519a153f9b4cbd9c6d8fb..21c02780f9a978e06bd9ce486091362b04f71906 100644 --- a/ckanext/odsh/tests/test_validation.py +++ b/ckanext/odsh/tests_wip/test_validation.py @@ -105,25 +105,3 @@ def test_validate_licenseAttributionByText(): ('extras', 0, 'key'): 'licenseAttributionByText', ('extras', 0, 'value'): ''} validate_licenseAttributionByText('key', data, {}, None) - - -def test_convert_subjectID_to_subjectText(): - # arrange - data = {('extras', 0, 'subject'): 'subject', - ('extras', 0, 'subject'): 'Test_id'} - # act - convert_subjectID_to_subjectText('key', data, {}, None) - # assert - assert data[('extras', 1, 'key')] == 'subject_text' - assert data[('extras', 1, 'value')] == 'Test_subject' - - -def test_exception_convert_subjectID_to_subjectText(): - # arrange - data = {('extras', 0, 'subject'): 'subject', - ('extras', 0, 'subject'): 'Nicht_Vorhanden'} - # act - convert_subjectID_to_subjectText('key', data, {}, None) - #assert - assert data[('extras', 1, 'key')] == 'subject_text' - assert data[('extras', 1, 'value')] == '' diff --git a/ckanext/odsh/validation.py b/ckanext/odsh/validation.py index 2bbee66b6b417b62a1c46cbb7f9a551d1da5a696..d91731555d44d7d927071098ef0179b5ba015e8a 100644 --- a/ckanext/odsh/validation.py +++ b/ckanext/odsh/validation.py @@ -13,7 +13,7 @@ import ckan.plugins.toolkit as toolkit import ckan.model as model from ckan.lib.navl.dictization_functions import Missing -from ckanext.odsh.helpers_tpsh import get_package_dict +from ckanext.odsh.helpers import get_package_dict from ckanext.odsh.helpers import odsh_resource_formats import ckan.plugins.toolkit as tk import pkg_resources @@ -295,59 +295,6 @@ def tag_string_convert(key, data, errors, context): toolkit.get_validator('tag_length_validator')(tag, context) -def _convert_subjectID_to_subjectText(subject_id, flattened_data): - - if not subject_id: - return flattened_data - - extension_path = pkg_resources.resource_filename('ckanext.odsh', '') - subject_mapping_file_path = tk.config.get( - 'ckanext.odsh.subject_mapping_file_path', extension_path + '/resources/subject_mapping.json') - - try: - with open(subject_mapping_file_path) as mapping_json: - subject_mapping = json.loads(mapping_json.read()) - except IOError as err: - log.error( - 'Could not load subject mapping file from {}' - .format(subject_mapping_file_path) - ) - raise - except ValueError as err: - log.error( - 'Could not convert subject mapping file from json. \nSubject mapping file: {}' - .format(subject_mapping_file_path) - ) - raise - - try: - subject_text = subject_mapping[subject_id] - except: - log.warning( - 'Subject_id "{}" not found in subject mapping dictionary.\nSubject mapping file: {}' - .format(subject_id, subject_mapping_file_path) - ) - raise toolkit.Invalid(_('Subject must be a known URI.')) - - - new_index = next_extra_index(flattened_data) - flattened_data[('extras', new_index, 'key')] = 'subject_text' - flattened_data[('extras', new_index, 'value')] = subject_text - return flattened_data - - -def validate_subject(key, flattened_data, errors, context): - subject_id = flattened_data[key] - require_subject = toolkit.asbool( - tk.config.get('ckanext.odsh.require_subject', True) - ) - if not require_subject: - flattened_data = _convert_subjectID_to_subjectText(subject_id, flattened_data) - return - if not subject_id: - raise toolkit.Invalid(_('Subject must not be empty.')) - flattened_data = _convert_subjectID_to_subjectText(subject_id, flattened_data) - def validate_relatedPackage(data): if data: try: @@ -355,6 +302,7 @@ def validate_relatedPackage(data): except logic.NotFound: raise toolkit.Invalid("relatedPackage: package '{}' not found".format(data)) + def validate_formats(data, errors): if not data: raise toolkit.Invalid('Missing format.') @@ -364,12 +312,12 @@ def validate_formats(data, errors): return data + def get_validators(): return { 'known_spatial_uri': known_spatial_uri, 'odsh_validate_extras': validate_extras, 'validate_licenseAttributionByText': validate_licenseAttributionByText, - 'tpsh_validate_subject': validate_subject, - 'tpsh_validate_relatedPackage': validate_relatedPackage, + 'validate_relatedPackage': validate_relatedPackage, 'odsh_validate_format': validate_formats, }