Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add various list + base tests.#390

Draft
davidlehn wants to merge 1 commit intomaindigitalbazaar/jsonld.js:mainfrom
list-base-testsdigitalbazaar/jsonld.js:list-base-testsCopy head branch name to clipboard
Draft

Add various list + base tests.#390
davidlehn wants to merge 1 commit intomaindigitalbazaar/jsonld.js:mainfrom
list-base-testsdigitalbazaar/jsonld.js:list-base-testsCopy head branch name to clipboard

Conversation

@davidlehn
Copy link
Copy Markdown
Member

@davidlehn davidlehn commented Apr 15, 2020

  • WIP.
  • Started as a test to debug a N-Quads serialization bug.
  • Also checking some list + base behavior.

See #382

@davidlehn davidlehn added this to the JSON-LD 1.1 milestone Apr 15, 2020
@davidlehn davidlehn added the bug label Apr 15, 2020
Comment thread tests/misc.js
assert.equal(
rdf,
'_:b0 <foo:bar> _:b1 .\n' +
//'_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <test> .\n' +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This, and others, might be controversial. Certainly, the spec says that the base option overrides the input document's IRI, but this would correspond to the RFC3986 5.1.2 Base URI from the Encapsulating Entity, and following their hierarchy, an empty value would typically be made absolute by resaving against the Retrieval URI or the default base URI. It could be that it's just that the spec wording is muddy. Does it make sense to set the base option to anything other than an absolute URL?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So, arguably, the API should ignore a base option which is not a valid IRI (meaning absolute). The option is described as setting the base IRI, and base IRI is described as an IRI, meaning absolute:

The base IRI is an IRI established in the context, or is based on the JSON-LD document location. The base IRI is used to turn relative IRI references into IRIs.

We don't describe what to do for invalid options, so it's a bit of a gray area.

Comment thread tests/misc.js
const doc = {
"@context": {
"@base": "::",
"list": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This isn't invalid, as ':' is a valid char, which is a component of segment-nz. When expanding relative to the document base, it becomes https://w3c.github.io/json-ld-api/tests/toRdf/::, which is valid.

I'll pick something else.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.