Git Product home page Git Product logo

ndjson-ld's People

Contributors

pchampin avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ndjson-ld's Issues

Blank Node Scope

On the call, I think we discussed that blank nodes would be scoped to each individual record, however this would make using this format in a manner similar to N-Quads unable to represent shared blank nodes.

Most serializations scope blank node identifiers to the file. In this reckoning:

{"@id": "foo", "prop": {"@id": "_:bar"}}
{"@id": "_:bar", "prop": {"@id": "baz"}}

could be semantically equivalent to:

{"@id": "foo", "prop": {"@id": "_:bar", "prop": {"@id": "baz"}}}

Otherwise, there would be no way to state this using independent records.

Proposal: blank node labels are shared across all documents within a stream.

API

Similar to how it's done in the YAML-LD spec, the spec should mirror the JSON-LD API WebIDL definitions, and largely delegate each line to the JSON-LD API.

This requires extending the JSON-LD Internal Representation with the notion of a document type with a sequence being an array of documents with a document consisting of either an array or map.

Base format

From json-ld/yaml-ld#63, there are at least three different formats that could serve as the basis for this work:

  • NDJSON – newline delimited JSON, which prohibits the use of newlines within a given record. Media type is specified as application/x+ndjson, which is not recommended. It purports to be a living spec. Previous support for comments between records, now removed.
  • JSON Lines – the basis from which NDJSON was forked. Apparently not intended as a spec. No suggested media type, although issue comments suggest application/x+jsonlines and application/x-json-stream. Otherwise, virtually indistinguishable from NDJSON.
  • LDJSON – Aside from the obvious confusion of LDJSON-LD, I can't find anything definitive other than the Wikipedia entry.
  • JSON Text Sequences – RFC7464 – This has the obvious advantage of being an RFC with a registered media type application/json-seq. Allows newlines within JSON records, but requires records be proceeded by an ASCII Record Separator (%x1E). A disadvantage is that this is not as amenable to presentation or editing by a common text editor.

Use case gathering?

I have seen a number of possible use cases expressed in various repos, email threads, etc.

Given that we could use these to help us gather the specific set of requirements that any new specification/standard needs to support - perhaps we should start here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.