Skip to content

Playground javascript bug #67

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

Closed
davidlehn opened this issue Jan 23, 2012 · 4 comments
Closed

Playground javascript bug #67

davidlehn opened this issue Jan 23, 2012 · 4 comments

Comments

@davidlehn
Copy link
Member

I'm not sure what the following is supposed to output but it currently breaks the playground javascript. Perhaps a test case is needed to make sure it doesn't break other implementations as well?

{
   "@context": {
      "something": {"@type":"@id"}
   },
   "something" : {
     "@id": [
         "http://www.test.com/a",
         "http://www.test.com/b"
      ]
   }
}

http://json-ld.org/playground/?json-ld=%7B%22%40context%22%3A%7B%22something%22%3A%7B%22%40type%22%3A%22%40id%22%7D%7D%2C%22something%22%3A%7B%22%40id%22%3A%5B%22http%3A%2F%2Fwww.test.com%2Fa%22%2C%22http%3A%2F%2Fwww.test.com%2Fb%22%5D%7D%7D&frame=%7B%7D

@ghost ghost assigned dlongley Jan 23, 2012
@lanthaler
Copy link
Member

This is in my opinion a corner case that is closely related to issue #49. "something" could be interpreted as a relative IRI or as a term. There is no way to distinguish that.. The current spec just says that

"Full IRIs may also be used on the left-hand side of a context. Note that in order for the full IRI to match above, the full IRI must also be used in the JSON-LD document."

I think what was meant here is absolute IRI instead of full IRI.

-----Original Message-----
From: David I. Lehn [mailto:reply+i-2942317-
[email protected]]
Sent: Tuesday, January 24, 2012 5:54 AM
To: Markus Lanthaler
Subject: [json-ld.org] Playground javascript bug (#67)

I'm not sure what the following is supposed to output but it currently
breaks the playground javascript. Perhaps a test case is needed to
make sure it doesn't break other implementations as well?

{
   "@context": {
      "something": {"@type":"@id"}
   },
   "something" : {
     "@id": [
         "http://www.test.com/a",
         "http://www.test.com/b"
      ]
   }
}

http://json-ld.org/playground/?json-
ld=%7B%22%40context%22%3A%7B%22something%22%3A%7B%22%40type%22%3A%22%40
id%22%7D%7D%2C%22something%22%3A%7B%22%40id%22%3A%5B%22http%3A%2F%2Fwww
.test.com%2Fa%22%2C%22http%3A%2F%2Fwww.test.com%2Fb%22%5D%7D%7D&frame=%
7B%7D


Reply to this email directly or view it on GitHub:
#67

@msporny
Copy link
Member

msporny commented Feb 5, 2012

I think the example has a syntax error, no @id is specified? If that's true, then the following applies:

We discuss a solution to this in #54.

The markup above would be processed as if this were the input (using only the first item in the array):

{
  "@context": {
    "something": { "@id": "http://foo.com/bar", "@type": "@id" }
  },
  "something": { 
    "@id": "http://www.test.com/a" 
  }
}

... and that is something that works just fine in the JSON-LD Playground.

@msporny
Copy link
Member

msporny commented Feb 5, 2012

If the example does not have a syntax error, then no @id is specified for "something", and thus the mapping isn't specified, and therefore "something" would be ignored entirely.

@lanthaler
Copy link
Member

This was fixed in the meantime. something in the example above gets dropped now as it doesn't expand to an IRI.

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

4 participants