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

Replace "optimize" option with "strict" option in JsonLdOptions #232

Closed
lanthaler opened this issue Mar 22, 2013 · 2 comments
Closed

Replace "optimize" option with "strict" option in JsonLdOptions #232

lanthaler opened this issue Mar 22, 2013 · 2 comments

Comments

@lanthaler
Copy link
Member

We currently have an optimize option in JsonLdOptions (defaulting to false) which is defined as follows:

If set to true, the JSON-LD processor is allowed to optimize the output of the Compaction algorithm to produce even compacter representations. The algorithm for compaction optimization is beyond the scope of this specification and thus not defined. Consequently, different implementations MAY implement different optimization algorithms.

I think it would be advantageous to replace this option with a strict option (defaulting to true) defined as follows:

If set to true, the JSON-LD processor or library MUST produce exactly the same results as the algorithms defined in this specification. If set to false, the JSON-LD processor or library is allowed to extend or modify the algorithms defined in this specification to enable application-specific optimizations. The definition of such optimizations is beyond the scope of this specification and thus not defined. Consequently, different implementations MAY implement different optimizations.

Another alternative (perhaps more future-proof) would be to change optimize to processingMode and specify a single mode json-ld-1.0:

If set to json-ld-1.0, the JSON-LD processor or library MUST produce exactly the same results as the algorithms defined in this specification. If set another value, the JSON-LD processor or library is allowed to extend or modify the algorithms defined in this specification to enable application-specific optimizations. The definition of such optimizations is beyond the scope of this specification and thus not defined. Consequently, different implementations MAY implement different optimizations. Developers MUST NOT define modes beginning with json-ld as they are reserved for future versions of this specification.

The advantage would be that it might be simpler to introduce mechanisms such as framing without having to update the whole API spec. The downside might be that multiple competing modes will establish, but the same is the case with an optimize or strict flag.

PROPOSAL 1: Change optimize flag to strict flag as defined above.

PROPOSAL 2: Change optimize flag to processingMode option as defined above.

@lanthaler
Copy link
Member Author

PROPOSAL 1: +0.9
PROPOSAL 2: +1

@lanthaler
Copy link
Member Author

RESOLVED: Change 'optimize' flag to be a 'processingMode' option. The default value for JSON-LD 1.0 processors is 'json-ld-1.0'. Implementers may accept other values, but must ensure that those values are not prefixed with the string 'json-ld'. If the processingMode is set to 'json-ld-1.0', the outcome must be the same as the algorithms.

lanthaler added a commit that referenced this issue Mar 26, 2013
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

1 participant