Skip to content

rdf to-jelly: implement the GRAPHS stream type#104

Merged
Ostrzyciel merged 4 commits intomainfrom
101-rdf-to-jelly-add-physical_stream_type_graphs-support
May 2, 2025
Merged

rdf to-jelly: implement the GRAPHS stream type#104
Ostrzyciel merged 4 commits intomainfrom
101-rdf-to-jelly-add-physical_stream_type_graphs-support

Conversation

@Ostrzyciel
Copy link
Member

Issue: #101

@Ostrzyciel Ostrzyciel linked an issue Apr 30, 2025 that may be closed by this pull request
@Ostrzyciel
Copy link
Member Author

@adanilenka requesting confirmation that it works for your use case

@adanilenka
Copy link

the build: https://github.com/Jelly-RDF/cli/actions/runs/14759611428/artifacts/3039362901

was tested with the following set of sample N-quads input file (coming from pos_005 quads test), featuring a mix of graphs in a variety of forms (but not generalized RDF):

<http://example.org/resource/A> <http://example.org/property/p1> <http://example.org/resource/B> .
_:bn2 <http://example.org/property/p2> "100"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/graph/G>.
<http://example.org/resource/A> <http://example.org/property/p3> _:bn3 _:bn1.
<http://example.org/resource/A> <http://example.org/property/p3> _:bn3 _:bn1.
<http://example.org/resource/A> <http://example.org/property/p3> _:bn3 _:bn1.
<http://example.org/resource/E> <http://example.org/property/p2> "0.01"^^<http://www.w3.org/2001/XMLSchema#float> .
<http://example.org/resource/E> <http://example.org/property/p2> <http://example.org/resource/F> _:bn1 .
<http://example.org/resource/H> <http://example.org/property/p2> "0.1"^^<http://www.w3.org/2001/XMLSchema#float> <http://example.org/graph/G1>.
_:bn2 <http://example.org/property/p1> "200"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/graph/G>.
_:bn2 <http://example.org/property/p1> "200"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/graph/G1>.
_:bn2 <http://example.org/property/p1> "200"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://example.org/resource/A> <http://example.org/property/p> <http://example.org/resource/B> .
<http://example.org/resource/E> <http://example.org/property/p1> <http://example.org/resource/F> .
<http://example.org/resource/A> <http://example.org/property/p> _:bn3 <http://example.org/graph/G> .

the file was serialized in the following modes:

  • single frame with and without prefix table
  • multi-frame (15 rows per frame)

and validated compared to the input file with --compare-ordered=true

So far, no critical issues have been detected. The only tiny thing is that the logical type is set to undefined, which is okay from the specification POV but can be "perfected" later.

@Ostrzyciel
Copy link
Member Author

Ah, the logical stream type should be set to something by default, good catch. I'll add it in a sec.

override def triple(triple: Triple): Unit =
handleGraph(Quad.defaultGraphIRI)
encoder.addTripleStatement(triple)
if opt.delimited && buffer.size >= opt.frameSize then flushBuffer()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this logic could be moved to a separate method (to make sure both conditions are always correctly checked in the if)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, that's how it is in the Jena original. Let's keep it as-is.

@Ostrzyciel Ostrzyciel merged commit 76f87d5 into main May 2, 2025
7 checks passed
@Ostrzyciel Ostrzyciel deleted the 101-rdf-to-jelly-add-physical_stream_type_graphs-support branch May 2, 2025 10:37
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.

rdf to-jelly: add PHYSICAL_STREAM_TYPE_GRAPHS support

3 participants