Comments (2)
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.
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)
- Only one line in a multi-line string can be escaped; multiple should be possible
- Test suite HOT 3
- Since commit a89c313... objects no longer "close" as they used to
- Is there a json to AML method? HOT 1
- Document crashes JS parser (but works in Ruby) HOT 3
- Freeforms shouldn't require trailing newlines to pick up last line of text
- Support for numbers
- Exclude unnecessary files from production installs
- Sandbox doesn't escape output
- Converting JSON to ArchieML HOT 1
- Google autoformatting tends to break arrays of strings
- Cut npm release of v0.5.0? HOT 1
- 'Using with Google Documents' instructions, error
- Add SECURITY.md
- Multi-line values are created when they shouldn't be HOT 3
- In-line JSON parsing HOT 1
- Arrays should override strings that already exist at a key HOT 1
- Nested array string values don't overwrite nested key/value pairs created by scoped arrays HOT 3
- Make inline comments configurable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from archieml-js.