GithubHelp home page GithubHelp logo

Comments (11)

gkellogg avatar gkellogg commented on July 22, 2024

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

from json-ld.org.

msporny avatar msporny commented on July 22, 2024

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

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

from json-ld.org.

gkellogg avatar gkellogg commented on July 22, 2024

Definitions of absolute and relative IRIs added to commit ae24034.

from json-ld.org.

lanthaler avatar lanthaler commented on July 22, 2024

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?

from json-ld.org.

gkellogg avatar gkellogg commented on July 22, 2024

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.

from json-ld.org.

lanthaler avatar lanthaler commented on July 22, 2024

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?

from json-ld.org.

gkellogg avatar gkellogg commented on July 22, 2024

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

from json-ld.org.

lanthaler avatar lanthaler commented on July 22, 2024

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.

from json-ld.org.

msporny avatar msporny commented on July 22, 2024

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.

from json-ld.org.

lanthaler avatar lanthaler commented on July 22, 2024

+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.

from json-ld.org.

msporny avatar msporny commented on July 22, 2024

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.

from json-ld.org.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.