Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change implements a potential approach for handling relations between datasets as discussed in #331. It explores the "store relations in dataset metadata" approach rather than the "store relations in a separate db"
Right now it comprises mainly two sides:
dataset_relation
preset that extends themultiple_text
one to add a custom validator and eventually custom form/display snippets. The validator checks that the field items are either a valid dataset id or a URI. The form widget would allow to choose existing datasets in the site or paste a URI.has_version
orsource
. When serializing, if the value is an URI is left unchanged but if it's a dataset id, a dataset URI is generated for itThis allows us to go from the current serialization where we just dump whatever there is in e.g. the
has_version
field:To exposing actual URIs to the other datasets in the catalog:
Other things that are missing:
after_dataset_deleted
hook that fires a background job that uses the search to find datasets that use the deleted dataset id an relation and patch them the remove that relation (This would require indexing the relation field values as lists)is_version_of
) although DCAT-AP 3 explicitly says that these are not necessary.