Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Write down a consistent format for keys #87

Open
simonwo opened this issue Nov 29, 2018 · 5 comments
Open

Write down a consistent format for keys #87

simonwo opened this issue Nov 29, 2018 · 5 comments

Comments

@simonwo
Copy link

simonwo commented Nov 29, 2018

I can't find a consistent definition for the format of an entry key.The RSF RFC claims that it's a alphanumeric string with dashes and underscores, but this is clearly a lie due to the presence of system entries with colons (e.g. "field:xyz").

Could we decide on a sensible agreed format?

I'm also keen to be able to include spaces \x20 and slashes \x2F in keys; for some of the keys in my registers these characters are appropriate. It seems like the sensible thing would be to have a blacklist rather than a whitelist, e.g. no tab characters.

@MatMoore
Copy link

Hi @simonwo, we are currently putting together a new version of the spec, and keys are defined here: https://spec.openregister.org/v2/glossary/key

Slashes are supported, but spaces aren't. It would be great to understand more about your use case where they come up. Are you deriving keys from some existing identifiers or generating them?

@arnau
Copy link
Contributor

arnau commented Nov 29, 2018

Hi @simonwo to add on @MatMoore comment, RSF is not stable and metadata is not stable either so the spec is not lying, it actually agrees with RFC008.

About spaces, keys are supposed to be identifiers not necessarily text for direct human consumption, hence being that restrictive.

@simonwo
Copy link
Author

simonwo commented Nov 29, 2018

Ah, I was reading the (admittedly, draft) RSF RFC which must contain an old definition. Apologies, I didn't find the glossary.

I am indeed deriving keys from existing identifiers. I'm doing something with European legislation. They have human-readable unique identifiers that contain words, e.g "REGULATION (EC) No 853/2004". The ID is not just the numeric bit, you also need the words REGULATION (EC), else it's incorrect. From: https://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2004:139:0055:0205:en:PDF

Admittedly they're not designed as a machine-readable database ID, nevertheless they are unique and how people actually reference legislation. Also I didn't want to define an arbitrary ID of my own.

@simonwo
Copy link
Author

simonwo commented Nov 29, 2018

Still looks like the v2 spec for keys doesn't allow colons though?

@arnau
Copy link
Contributor

arnau commented Nov 30, 2018

I doesn't no, v2 has no metadata though. Time constraints mainly.

Let us take your use case for a bit so we can study the implications of this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants