Skip to content
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

IRI fragments cannot start with a digit #325

Closed
twalmsley opened this issue Feb 22, 2023 · 1 comment
Closed

IRI fragments cannot start with a digit #325

twalmsley opened this issue Feb 22, 2023 · 1 comment

Comments

@twalmsley
Copy link

I'm using random UUIDs after the # in IRIs and some of them start with digits, but the prefix replacement regex doesn't match these IRIs. Is there a reason for that or is it a bug? I can't find anything in the W3C that restricts fragments in this way.

E.g. https://www.example.com/test/things#3add0a26-8c75-47fb-abe7-a0ed1c23a0a doesn't match the generated regex:
^(?:hqdm:|amrc:|rdf:)[^/]*$|^(https:\/\/www\.example\.com\/test\/things#)([_a-zA-Z][\-_a-zA-Z0-9]*)$

The result is that some IRIs are not shortened using a prefix when exported (to TLL in my case), although the TTL is still valid.

@RubenVerborgh
Copy link
Member

That's by design indeed; the Writer prefixes some URIs, but not all of them. The regex can be expanded indeed, but getting it perfect for all cases would make it slow. That said, yours is a reasonable case that I wouldn't expect to slow down things.

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

No branches or pull requests

2 participants