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

Using riot with N-Quads input with named graphs and N-Triples/Turtle output silently drops part of the input #1873

Closed
aucampia opened this issue May 20, 2023 · 3 comments · Fixed by #1876
Labels
Cmd Command line tools enhancement Incrementally add new feature

Comments

@aucampia
Copy link

Version

4.8.0

What happened?

Given this N-Quads input (saved as test/data/variants/diverse_quads.nq) that contains triples with graphs labels [ref] (i.e. contains named graphs[ref]):

<http://example.com/subject> <http://example.com/predicate> "日本語の表記体系"@jpx <example:graph> .
<urn:example:subject> <example:predicate> <example:subject> <example:graph> .
<example:subject> <example:predicate> <example:object> <example:graph> .
<example:subject> <example:predicate> "12"^^<http://www.w3.org/2001/XMLSchema#integer> <example:graph> .
<example:subject> <example:predicate> <example:object> <urn:example:graph> .
<example:subject> <http://example.com/predicate> <http://example.com/object> <urn:example:graph> .
<example:subject> <http://example.com/predicate> "XSD string" <urn:example:graph> .
<example:subject> <example:predicate> <example:object> .
<http://example.com/subject> <http://example.com/predicate> "typeless" .
<urn:example:subject> <urn:example:predicate> <urn:example:object> .

When processing it with riot --syntax=nquads --formatted=ntriples, riot generates output and no error, but the output only contains the triples from the default graph.

$ jbang run --main riotcmd.riot --deps='org.slf4j:slf4j-simple:1.7+' 'org.apache.jena:jena-cmds:4.8.0' --syntax=nquads --formatted=ntriples test/data/variants/diverse_quads.nq; echo status=$?
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
<http://example.com/subject> <http://example.com/predicate> "typeless" .
<example:subject> <example:predicate> <example:object> .
<urn:example:subject> <urn:example:predicate> <urn:example:object> .
status=0

I would expect it to at least exit with an error status code, and also preferably print an error message.

Relevant output and stacktrace

No response

Are you interested in making a pull request?

Maybe

@aucampia aucampia added the bug label May 20, 2023
@aucampia aucampia changed the title Using riot with nquads input with named graphs and ntriples/turtle output silently drops part of the input Using riot with N-Quads input with named graphs and N-Triples/Turtle output silently drops part of the input May 20, 2023
@afs
Copy link
Member

afs commented May 20, 2023

This can be changed as a feature request. To preserve streaming, it would be a once per run log message.

Jena treats quads in a triples context as triples from the default graph.

Some people expect the union-merge but named graphs might be being used for intentional separation.
The application has to indicates that the named graphs can be considered part of a union-all graph.
An option to riot to do the quads to triples conversion, controlled by a new argument, is possible.

@afs
Copy link
Member

afs commented May 21, 2023

Please review #1876

@afs afs added enhancement Incrementally add new feature Cmd Command line tools and removed bug labels May 21, 2023
afs added a commit to afs/jena that referenced this issue May 21, 2023
afs added a commit to afs/jena that referenced this issue May 22, 2023
@afs
Copy link
Member

afs commented May 22, 2023

Also - added --merge

This is all about the command line tool and how it configures the operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cmd Command line tools enhancement Incrementally add new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants