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

Introduce RDFParser and RDFWriter implementation for Newline Delimited JSON-LD format #2840

Closed
desislava-hristova-ontotext opened this issue Feb 17, 2021 · 1 comment · Fixed by #2845
Assignees
Labels
📶 enhancement issue is a new feature or improvement 📦 rio affects the Rio RDF Parser/Writer toolkit
Milestone

Comments

@desislava-hristova-ontotext
Copy link
Contributor

A "Newline Delimited JSON" exists, see NDJSON website and specification. Similar to it, a multiline JSON-LD is used in the community, i.e in Springer Nature SciGraph dataset.

Implement an RDFParser and RDFWriter that reads/writes such a format and thereby formalize the format:

  • Each line is a JSON-LD object
  • Empty lines allowed (same as Newline Delimited JSON) as it is more flexible
  • MIME type: application/x-ld+ndjson derived from the existing MIME type for JSON-LD application/ld+json and the MIME type of Newline Delimited JSON application/x-ndjson
  • File extension: .ndjsonld derived from the file extension for JSON-LD .jsonld and the file extension for Newline delimited JSON .ndjson.
@github-actions github-actions bot added this to 📥 Inbox in Project Progress Feb 17, 2021
desislava-hristova-ontotext added a commit to desislava-hristova-ontotext/rdf4j that referenced this issue Feb 17, 2021
… delimited JSON-LD

Introduce NDJSONLDParser that extends the JSONLDParser. It collects each JSON-LD line from the input, puts all JSON objects in a list, flattening them if necessary and pass further to the JSON API as one single JSON object.

Introduce NDJSONLDWriter that groups triples by subject and context and writes an JSON-LD line for each group, by delegating to the JSONLDWriter.
@abrokenjester abrokenjester added 📦 rio affects the Rio RDF Parser/Writer toolkit 📶 enhancement issue is a new feature or improvement help wanted we could use your help in fixing this issue labels Feb 18, 2021
@abrokenjester abrokenjester moved this from 📥 Inbox to 📋 Backlog in Project Progress Feb 18, 2021
desislava-hristova-ontotext added a commit to desislava-hristova-ontotext/rdf4j that referenced this issue Feb 19, 2021
… delimited JSON-LD

Introduce NDJSONLDParser that extends the JSONLDParser. It collects each JSON-LD line from the input, puts all JSON objects in a list, flattening them if necessary and pass further to the JSON API as one single JSON object.

Introduce NDJSONLDWriter that groups triples by subject and context and writes an JSON-LD line for each group, by delegating to the JSONLDWriter.
desislava-hristova-ontotext added a commit to desislava-hristova-ontotext/rdf4j that referenced this issue Feb 19, 2021
… delimited JSON-LD

Introduce NDJSONLDParser that extends the JSONLDParser. It collects each JSON-LD line from the input, puts all JSON objects in a list, flattening them if necessary and pass further to the JSON API as one single JSON object.

Introduce NDJSONLDWriter that groups triples by subject and context and writes an JSON-LD line for each group, by delegating to the JSONLDWriter.
@abrokenjester abrokenjester moved this from 📋 Backlog to 🚧 In progress in Project Progress Feb 21, 2021
@abrokenjester abrokenjester added this to the 3.6.0 milestone Feb 21, 2021
@abrokenjester abrokenjester removed the help wanted we could use your help in fixing this issue label Feb 21, 2021
@hmottestad hmottestad modified the milestones: 3.6.0, 4.0.0, 3.7.0 Feb 21, 2021
desislava-hristova-ontotext added a commit to desislava-hristova-ontotext/rdf4j that referenced this issue Feb 22, 2021
… delimited JSON-LD

Introduce NDJSONLDParser that extends the JSONLDParser. It collects each JSON-LD line from the input, puts all JSON objects in a list, flattening them if necessary and pass further to the JSON API as one single JSON object.

Introduce NDJSONLDWriter that groups triples by subject and context and writes an JSON-LD line for each group, by delegating to the JSONLDWriter.

Signed-off-by: desislava.hristova <desislava.hristova@ontotext.com>
desislava-hristova-ontotext added a commit to desislava-hristova-ontotext/rdf4j that referenced this issue Feb 22, 2021
… delimited JSON-LD

Introduce NDJSONLDParser that extends the JSONLDParser. It collects each JSON-LD line from the input, puts all JSON objects in a list, flattening them if necessary and pass further to the JSON API as one single JSON object.

Introduce NDJSONLDWriter that groups triples by subject and context and writes an JSON-LD line for each group, by delegating to the JSONLDWriter.

Signed-off-by: desislava.hristova <desislava.hristova@ontotext.com>
abrokenjester added a commit that referenced this issue Feb 24, 2021
…d-multiline-jsonld-format

GH-2840 Implement an RDFParser and RDFWriter for Newline delimited JSON-LD
Project Progress automation moved this from 🚧 In progress to 🥳 Done Feb 24, 2021
@VladimirAlexiev
Copy link

@desislava-hristova-ontotext @jeenbroekstra
There is https://w3c.github.io/json-ld-streaming/ which says things like "put @context first in file" and "put @id first in object".
So it doesn't rely on newline markers for streaming, but on a slightly restricted JSON structure.
Implementation:

Is that any better or more "standards compliant"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📶 enhancement issue is a new feature or improvement 📦 rio affects the Rio RDF Parser/Writer toolkit
Projects
No open projects
4 participants