-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support underscores in the prefixes #24
Comments
What is the use case for underscores? The reason it's not allowed is that I don't want separate or different mappings for That's why prefix.cc doesn't allow uppercase characters and punctuation. The site is about the popular/canonical mappings, and not so much about the “long tail” of prefix mappings that are used only by a small group of people. Better supporting the “long tail” would be a completely reasonable goal, and some kind of punctuation to allow grouping of prefixes would probably be part of that. But the site lacks various other features that would be required to do a decent job on that goal. |
Thanks @cygri for getting back to me. The use case is that the OSLC standard (you can think of it as an LDP for the enterprise) developed under OASIS is using the following prefixes in the spec (as RFC SHOULDs plus most of them are in use in the apps since 2009):
I totally agree with you that the proliferation of |
Good point. The argument I made above for the limited [a-z0-9] range is pretty strong, in my opinion. But it's good that vocabulary authors propose canonical prefixes for their vocabularies. And it is desirable to have those proposed canonical prefixes in prefix.cc. And it's inevitable that some authors will propose prefixes outside of the [a-z0-9] range currently allowed by prefix.cc. I don't currently have a good idea on how to resolve this contradiction. |
I think the best way to resolve it would be to use https://github.com/perma-id/w3id.org approach with the pull-request model to add the prefixes. That would involve a lot of rework of the prefix.cc codebase; not sure I would have the time to do it if you give a green light. Practical way to resolve this may be to remove the restrictions but have a sort of premoderation. I don't think it will be much of moderation work, but then again, involves significant code changes to add an admin panel. The most practical way would be for me to ask you to add the prefixes via phpMyAdmin and forget about this issue until more people complain :) (Though would still require minimal code changes to resolve http://prefix.cc/oslc_rm for example) |
Good analysis. Can you make a separate PR just to make underscores resolve? I'll dig out the phpMyAdmin password… |
What is the status of this PR? We'd love to use and leverage prefix.cc, but many of the namespaces we're working with end with underscores (example: The Human Phenotype Ontology, "HP", uses "http://purl.obolibrary.org/obo/HP_" as a prefix). |
@hsolbrig This PR is about underscores in the prefix. It looks like you want underscores as the last character of the namespace URI. |
Ah - missed that. Has there been discussion on that topic? |
Closes cygri#24 Tested via https://regex101.com/ with PHP7.3+ selected. An alternative return value would be `(?=.{1,11}$)[a-z][a-z0-9]*(?:_[a-z0-9]+)?` and that would limit the whole prefix to 11 chars.
Underscore is a valid prefix char.
I traced the necessary changes till:
prefix.cc/lib/namespaces.class.php
Line 157 in abe782e
and
prefix.cc/lib/site.class.php
Line 285 in abe782e
Would you be ready to merge a PR for that?
The text was updated successfully, but these errors were encountered: