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

HTML baseURI and @context? #53

Closed
ajs6f opened this issue Dec 7, 2018 · 5 comments
Closed

HTML baseURI and @context? #53

ajs6f opened this issue Dec 7, 2018 · 5 comments

Comments

@ajs6f
Copy link
Member

ajs6f commented Dec 7, 2018

We need to clarify the relationship between the base URI as derived from an embedding HTML document and a URI used for @context. Our work so far has addressed other kinds of URI resolution, but not this in particular.

@gkellogg
Copy link
Member

gkellogg commented Dec 7, 2018

We need to go a bit further and describe (syntax) and spec (api) how to retrieve a context when dereferencing the resolved URL results in an HTML document. This might include either/or fragment identifiers and profile=http://www.w3.org/ns/json-ld#context.

Resolving a relative IRI reference to a context would be similar to resolving a relative IRI within embedded JavaScript, IMO, which would use the base URL of the script element.

One interesting use case might be the following:

<html>
  <head>
    <base href="http://example.org/" />
    <script type="application/ld+json;profile=http://www.w3.org/ns/json-ld#context">
      {
        "@context": {"@vocab": "http://schema.org/"}
      }
    </script>
    <script id="starthere" type="application/ld+json">
      {
        "@context": "",
        "@id": "",
        "@type": "Thing"
      }
    </script>
  </head>
</html>

If you expanded the document with target "starthere", it would load the context from itself, and use the first script, due to the type profile, setting @vocab to http://schema.org/. The result should be something like the following:

[{
  "@id": "http://example.org/",
  "@type": ["http://schema.org/Thing"]
}]

@BigBlueHat
Copy link
Member

@gkellogg your comment above seems to take this in a different direction than what I understood @ajs6f to be describing.

@ajs6f's description seems to match what I filed in w3c/json-ld-syntax#134

Your comment seems to wide the scope (understandably) to "what if the context URL is the HTML document (or another HTML document with an embedded context)?"

Does that sound correct? If so, we should file a separate issue for the "extracting the context file from HTML" scenario.

Cool?

@gkellogg
Copy link
Member

@BigBlueHat Yes, this gets back to our documentation issue, where we suggested that a JSON-LD document might reference an HTML document to get its context (or frame).

@BigBlueHat
Copy link
Member

I'd suggest we close this as superseded by w3c/json-ld-syntax#134 (comment) and the extraction of the "HTML as context file" expressed in #66.

@azaroth42 that seem sensible re: github issue management?

@BigBlueHat
Copy link
Member

Closing as I think has been superseded by other issues mentioned above.

@ghost ghost removed the needs discussion label Feb 28, 2019
@azaroth42 azaroth42 removed this from Discuss-Call in JSON-LD Management DEPRECATED Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@BigBlueHat @gkellogg @ajs6f and others