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

Optimizing Compact Form #8

Closed
presbrey opened this issue Aug 11, 2011 · 1 comment
Closed

Optimizing Compact Form #8

presbrey opened this issue Aug 11, 2011 · 1 comment

Comments

@presbrey
Copy link

Today in #json-ld, Manu and I discussed improving the compact form serializers to produce shorter, more compartmentalized, digest-able output. The optimization is primarily against @iri-keyed blocks, esp. with predicates having multiple IRI targets.

Any value like { @iri: /joe } should be automatically compacted to just "/joe" and a coercion rule should be added to the @context.

We also briefly speculated whether this should be described as a new form, eg. "short".

In any case, there should be a form where all non-data terms are separated into @context sections as much as possible. This will help pave the way for JSON-LD Web Services to encourage plain k/v pairs with "default @context". And support /really/ thin clients that don't have any LD know-how (@iri) whatsoever (ignore all @).

Explicit example:

{ "@context": {"foo": "http://example.com/foo#"}, "foo:bar": [{ "@iri" : "http://example.com/blah" }, { "@iri" : "http://example.com/blah" }] } }

optimized to:

{ "@context": {"foo": "http://example.com/foo#", "@Coerce": {"@iri": ["foo:bar"]}}, "foo:bar": ["http://example.com/blah", "http://example.com/blah"] }

@lanthaler
Copy link
Member

RESOLVED: JSON-LD processors MUST implement the compaction API. The algorithm for compaction optimization is not defined. There is an 'optimize' flag that can be set to true or false to enable compaction optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants