Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefixes are lost when piping data #1189

Open
jeswr opened this issue Apr 2, 2023 · 2 comments
Open

Prefixes are lost when piping data #1189

jeswr opened this issue Apr 2, 2023 · 2 comments

Comments

@jeswr
Copy link
Member

jeswr commented Apr 2, 2023

Issue type:

  • 🐛 Bug

Description:

// Prefer piping if possible, to maintain backpressure
action.quadStream.on('error', error => writer.emit('error', error));
data = (<any> action.quadStream).pipe(writer);

The above code to have the following between line 41 and 42 otherwise results are never serialized with prefixes when the pipe method is available on the quadStream.

action.quadStream.on('prefix', (prefix, iri) => writer._writer.addPrefix(prefix, iri));

Not opening a PR immediately as tests should be added at the same time.

A similar addition is probably also required for the jsonld serializer.


Environment:

Crash log:

@github-actions
Copy link

github-actions bot commented Apr 2, 2023

Thanks for reporting!

@rubensworks rubensworks added this to Triage in Maintenance Apr 2, 2023
@rubensworks
Copy link
Member

The 'prefix' event is not part of the RDF/JS streams spec, it's a N3-specific thing.

I'm definitely ok with adding the line you suggest, but we can not rely on it as a standard, since other parsers and serializers might not handle it, or use a different approach.
For example, the JSON-LD parser does not emit a prefix event, but a context event.

@rubensworks rubensworks added this to Triage in Development Apr 3, 2023
@rubensworks rubensworks removed this from Triage in Maintenance Apr 19, 2024
@rubensworks rubensworks moved this from Triage to To do (prio:low) in Development Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development
  
To do (prio:low)
Development

No branches or pull requests

2 participants