GithubHelp home page GithubHelp logo

Support JSON-LD about archieml-js HOT 2 CLOSED

bollwyvl avatar bollwyvl commented on July 20, 2024
Support JSON-LD

from archieml-js.

Comments (2)

abstrctn avatar abstrctn commented on July 20, 2024

Hi @bollwyvl, this question falls pretty squarely under one we started over on the archieml.org repo, "Unicode support for keys": newsdev/archieml.org#3

Using @ symbols in keys doesn't seem any stranger than many of the unicode symbols we may want to support going forward; the question is always going to be how to make the parsers recognize a key without implementations getting too complicated.

Using : in values, like you do above in @id: sdo:jobTitle shouldn't be a problem (AML doesn't care what values are used after the first :, so even :s can be used).

It looks like JSON-LD standard [suggests](New DOMESTIC preview) that colons can be used on the left side of keys as well ("Using a compact IRI as a term"):

{
  "@context":
  {
    "foaf": "http://xmlns.com/foaf/0.1/",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "name": "foaf:name",
    "foaf:age":
    {
      "@type": "xsd:integer"
    },
    "foaf:homepage":
    {
      "@type": "@id"
    }
  },
  ...
}

As well as using "absolute IRIs" by using a URL as a key, such as http://xmlns.com/foaf/0.1/homepage. I don't know whether this is something A) you care about, or B) is required to support JSON-LD, since it's listed under a non-normative section. But both would be problematic since introducing :s to keys would necessitate introducing some sort of escaping mechanism for keys, which opens a can of worms.

There's a few open questions to discuss here that I'm going to move to the archieml.org issues page. So while this is a maybe, I'm gonna close the issue here. You should be able to modify your version of archieml.js for your own usage, but I want to answer to the larger question about keys before adding characters to the "allowed" list one by one. Thanks!

from archieml-js.

bollwyvl avatar bollwyvl commented on July 20, 2024

Great answer! I'll track the other ticket.

IMHO: the only important thing for user-centric support of json-ld is @ in the LHS.

Then at least one can define

@context: http://some/external/context

Which can give meaning to all the keys in the document... It is cruel and unusual to make someone use the colon namespacing if you are trying to "help" get something done.

from archieml-js.

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.