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

Forward slash in JSON key treated as error #543

Open
jakubklimek opened this issue Nov 23, 2023 · 2 comments
Open

Forward slash in JSON key treated as error #543

jakubklimek opened this issue Nov 23, 2023 · 2 comments

Comments

@jakubklimek
Copy link

jakubklimek commented Nov 23, 2023

A forward slash in JSON key like this:

{
  "@context": {
    "@version": 1.1,
    "a/b": "https://a"
  }
}

is treated as bad syntax: jsonld.SyntaxError: Invalid JSON-LD syntax; term in form of IRI must expand to definition.
However, forward slash is perfectly valid in JSON.
Where does this syntax error come from?

{
  "@context": {
    "@version": 1.1,
    "a_b": "https://a"
  }
}

is OK.

@jakubklimek
Copy link
Author

jakubklimek commented Nov 23, 2023

However, Apache Jena riot also reports this as invalid:

ERROR org.apache.jena.riot - A local context contains a term that has an invalid or missing IRI mapping [code=INVALID_IRI_MAPPING].

when used like this:

{
  "@context": {
    "@version": 1.1,
    "a/b": "https://a"
  },
  "@id": "https://id",
  "a/b": 2
}

@lemoustachiste
Copy link

@jakubklimek your issue is not too far from the one I was having here: #542. Maybe it can help

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

2 participants