opengeospatial / opengeospatial/bblocks-postprocess

RDF example encoding differs between source file and build-local/tests copy fed to transforms

Open
#80 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1
Forks
6
Avg merge
5d 10h
Merged PRs (30d)
3

Description

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 https://github.com/ogcincubator/bblocks-prov-jsonld-alt/pull/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).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the linked PR's w3c-prov-rdf-to-w3c-prov-jsonld transform and compare the source Turtle with build-local/tests///example_N_N.ttl. Trace the postprocessor step that writes the build-local copy and determine whether it re-serializes the RDF before transforms run. Done means the encoding discrepancy is explained and the transform receives RDF it can deserialize successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.