Summary
I have a text/turtle example and a python transform that reads it using the prov library:
from prov.model import ProvDocument
document = ProvDocument.deserialize(content=input_data, format="rdf", rdf_format="turtle")
When I run this exact code myself directly on my source example file, it works fine.
When the postprocessor runs the same transform on the same example, it fails with:
prov.model.records.ProvExceptionInvalidQualifiedName: Invalid Qualified Name: "doi:_10.5281_zenodo.14210717" %% xsd:QName
What I found
Comparing my source example file to the copy the postprocessor writes under
build-local/tests/<register>/<block>/example_N_N.ttl (the file actually fed to the transform), one RDF value is encoded differently between the two:
- My source file (works):
prov:specificEntity doi:_10.5281_zenodo.14210717 .
- The postprocessor's copy (fails):
prov:specificEntity "doi:_10.5281_zenodo.14210717"^^xsd:QName ;
Both are valid Turtle, but the second form (an xsd:QName-typed literal) is not accepted by prov's deserializer, so my transform fails only when run through the postprocessor.
This suggests the postprocessor re-serializes/normalizes RDF examples at some point before running transforms against them, and that step changes this value's encoding. I haven't been able to find exactly where in the codebase this happens.
Question
- Does the postprocessor re-serialize or canonicalize
text/turtle examples before passing them to transforms (e.g. for validation)?
- If so, could that be why the RDF encoding of a value changes between my source file and the copy used for the transform?
The source data for this example comes from https://github.com/opengeospatial/ogcapi-processes/blob/master/extensions/provenance/standard/examples/job_prov.json (Provenance extension), re-serialized to Turtle via prov. The exact transform script and example that reproduce this are in ogcincubator/bblocks-prov-jsonld-alt#4 (draft PR, block w3c-prov-jsonld, transform w3c-prov-rdf-to-w3c-prov-jsonld, example w3c-prov-rdf/examples/example-ogcapi-processes-job.ttl).
Summary
I have a
text/turtleexample and apythontransform that reads it using theprovlibrary:When I run this exact code myself directly on my source example file, it works fine.
When the postprocessor runs the same transform on the same example, it fails with:
What I found
Comparing my source example file to the copy the postprocessor writes under
build-local/tests/<register>/<block>/example_N_N.ttl(the file actually fed to the transform), one RDF value is encoded differently between the two:prov:specificEntity "doi:_10.5281_zenodo.14210717"^^xsd:QName ;Both are valid Turtle, but the second form (an
xsd:QName-typed literal) is not accepted byprov's deserializer, so my transform fails only when run through the postprocessor.This suggests the postprocessor re-serializes/normalizes RDF examples at some point before running transforms against them, and that step changes this value's encoding. I haven't been able to find exactly where in the codebase this happens.
Question
text/turtleexamples before passing them to transforms (e.g. for validation)?The source data for this example comes from https://github.com/opengeospatial/ogcapi-processes/blob/master/extensions/provenance/standard/examples/job_prov.json (Provenance extension), re-serialized to Turtle via
prov. The exact transform script and example that reproduce this are in ogcincubator/bblocks-prov-jsonld-alt#4 (draft PR, blockw3c-prov-jsonld, transformw3c-prov-rdf-to-w3c-prov-jsonld, examplew3c-prov-rdf/examples/example-ogcapi-processes-job.ttl).