Skip to content

Encode the property URI where a dataset is exported, not only where it is provisioned - #227

Merged
sorenwacker merged 1 commit into
mainfrom
fix-export-property-uri
Aug 4, 2026
Merged

Encode the property URI where a dataset is exported, not only where it is provisioned#227
sorenwacker merged 1 commit into
mainfrom
fix-export-property-uri

Conversation

@sorenwacker

Copy link
Copy Markdown
Owner

Asked whether the SEEK export had actually been tested end to end, the answer was no — only provisioning had. Exporting turned out to be broken:

Exception: "http://schema.org/Source Name" does not look like a valid URI,
I cannot serialize this as N3/Turtle. Perhaps you wanted to urlencode it?

Any dataset on a profile with a space in a field name could not be exported at all.

Why the earlier fix missed it

#224 routed the Sample Type pid and the model TTL's property definitions through property_uri. The data RDF builds its predicates at a second site (fairds.py:256, SCHEMA[key]) that still concatenated the raw field name. So SEEK held the encoded pid while the export that is supposed to match it could not be produced.

Its tests passed because they asserted provisioning and the data RDF agree on the path that had been changed. Two sites, one covered.

Verified against a running SEEK 1.18.1

Provisioned cropxr-metabolomics, then read the attribute back from SEEK:

attribute 'Source Name' pid stored by SEEK: http://schema.org/Source%20Name

and after this change the export emits the identical URI, with no unencoded form anywhere in the graph.

A regression test builds a profile with a spaced field name, exports a dataset and asserts both that the unserializable form is absent and the encoded one present — red against the unfixed code.

2702 tests pass.

…t is provisioned

Exporting any dataset on a profile with a space in a field name raised: rdflib
refuses to serialize http://schema.org/Source Name at all. The earlier fix
reached the model TTL's property definitions and the Sample Type pids, but the
data RDF builds its predicates at a second site that still concatenated the
name -- so SEEK held the encoded pid while the export could not be produced.

The tests missed it because they asserted the two sides agree on the path that
had been changed. Found by exporting a real dataset on cropxr-metabolomics
against a running SEEK, which is what the fix was for.
@sorenwacker
sorenwacker merged commit 377f637 into main Aug 4, 2026
1 check passed
@sorenwacker
sorenwacker deleted the fix-export-property-uri branch August 4, 2026 20:19
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