Skip to content

Define when an IRI is considered to be absolute and if IRI normalization is supported #46

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
lanthaler opened this issue Dec 5, 2011 · 11 comments

Comments

@lanthaler
Copy link
Member

We still have to define how we detect whether an IRI is an absolute IRI or not (this should be easy as we just have to look for a colon and an undefined prefix). We also have to define whether we allow stuff like "../" and "./" in relative IRIs and suffixes. Doing so would require IRI normalization and would go beyond pure textual concatenation.

@gkellogg
Copy link
Member

This is redundant now, as the spec only allows absolute IRIs.

@msporny
Copy link
Member

msporny commented Jan 22, 2012

The spec supports relative IRIs, absolute IRIs, and prefixes:

http://json-ld.org/spec/ED/json-ld-syntax/20120122/#iris

@gkellogg
Copy link
Member

Definitions of absolute and relative IRIs added to commit ae24034.

@lanthaler
Copy link
Member Author

This defines what an absolute IRI is but not necessarily how we recognize one. Should we have something like:

if no term and prefix matches but the following regex (TBD) matches, the value is considered to be an absolute IRI?

@gkellogg
Copy link
Member

The problem is, it is very difficult to distinguish an IRI from a compact IRI (CURIE). As mentioned on the call, one way is to limit the value space of the suffix portion to exclude values that begin with '//', but this is not fool-proof, as there are IRI schemes that do not need to begin with '//', such as 'mailto'. The proposed updated CURIE grammar for RDFa is the following:

 curie       ::= [ [ prefix ] ':' ] reference
 reference   ::= ( ipath-absolute / ipath-rootless / ipath-empty )
                     [ "?" iquery ] [ "#" ifragment ]

We could consider the reference portion for the definition of suffix in JSON-LD, but I think we agreed on today's telecon that this was premature.

Practically speaking, in JSON-LD, a CURIE is recognized when the prefix is defined as a term in the active context, and otherwise, the value is treated as an absolute IRI. I propose that we add this definition and resolve the issue.

@lanthaler
Copy link
Member Author

In other words you would propose that if a term contains a colon but the prefix isn't defined it is treated as an absolute IRI, right?

@gkellogg
Copy link
Member

Yes, I believe that's what I just said.

@lanthaler
Copy link
Member Author

OK.. that would basically that all terms with colons would result in an IRI but probably there's no other technical solution without relying on a list of allowed schemas.

@msporny
Copy link
Member

msporny commented Feb 5, 2012

PROPOSAL: If a key in a JSON-LD document contains a colon, it is a CompactIRI if the prefix is defined as a term in the active context, otherwise it is an AbsoluteIRI.

@lanthaler
Copy link
Member Author

+1

If we are going to define it that way we need to add a note in the spec saying that keys with colons are ALWAYS mapped to an IRI - there's no way around this. The only thing we could do is to specify an escape character (which could also work with the @ keywords)... but I don't know if we really need to go that far.

@msporny
Copy link
Member

msporny commented Feb 7, 2012

RESOLVED: If a key in a JSON-LD document contains a colon and the first colon is not followed by "//", it is a CompactIRI if the prefix is defined as a term in the active context, otherwise it is an AbsoluteIRI.

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

3 participants