Skip to content

fix(dataset-registry-client): type the IRI-valued schema properties as IRIs - #762

Merged
ddeboer merged 1 commit into
mainfrom
fix/registry-schema-iri-typed-properties
Aug 21, 2026
Merged

fix(dataset-registry-client): type the IRI-valued schema properties as IRIs#762
ddeboer merged 1 commit into
mainfrom
fix/registry-schema-iri-typed-properties

Conversation

@ddeboer

@ddeboer ddeboer commented Aug 21, 2026

Copy link
Copy Markdown
Member

Unblocks #734 (ldkit 2.7.1 → 2.7.2), where queries datasets from SPARQL endpoint with criteria returns 0 instead of 3.

DatasetSchema left license, accessURL, mediaType, compressFormat and conformsTo without an @type, so LDkit fell back to xsd:string and encoded a search value as a plain literal:

FILTER (?iri_6_1 IN ("https://www.iana.org/assignments/media-types/text/turtle", …))

The data holds those values as IRIs, so the comparison can never match. Declaring '@type': ldkit.IRI emits <…> instead.

The mismatch was invisible until now because LDkit emitted the search FILTER inside the OPTIONAL block of an optional property, where it only left the value unbound instead of removing the row – the filter did nothing, so every dataset came back and the assertion passed for the wrong reason. ldkit 2.7.2 (karelklima/ldkit#176) hoists the FILTER out of the block and makes it bite, which is what surfaced this.

Behaviour change once ldkit 2.7.2 lands

An effective nested filter also narrows what comes back: query({ distribution: { mediaType: { $in: […] } } }) returns a matching dataset with only its matching distributions, not all of them. The new $id test covers reading back a distribution that declares no media type, which a filtered query no longer reaches.

Verified against both ldkit 2.7.1 (this branch) and 2.7.2 (#734's lockfile).

…s IRIs

- Declare '@type': ldkit.IRI on license, accessURL, mediaType,
  compressFormat and conformsTo, which hold IRIs in DCAT-AP. Without it
  LDkit falls back to xsd:string and encodes a search value as a plain
  literal, so a filter such as mediaType $in [...] compares an IRI to a
  string and can never match.
- The mismatch was invisible because LDkit emitted a search FILTER inside
  the OPTIONAL block of an optional property, where it only unbound the
  value instead of removing the row; ldkit 2.7.2 hoists the FILTER out of
  the block and makes it bite.
- Cover a distribution that declares no media type through an $id query:
  media-type criteria now narrow a dataset's distributions to the
  matching ones, so a filtered query no longer reaches that path.
@ddeboer
ddeboer merged commit 9a8841d into main Aug 21, 2026
4 checks passed
@ddeboer
ddeboer deleted the fix/registry-schema-iri-typed-properties branch August 21, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant