-
Notifications
You must be signed in to change notification settings - Fork 132
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
N3 writer doesn't exhaustively use prefixes #372
Comments
This comment was marked as resolved.
This comment was marked as resolved.
@TallTed |
N3.js does not strive for the shortest form; it adds some prefixes but not exhaustively, and this for performance reasons. That said, in this case, the regex can easily be adjusted, presumably without performance impact. |
just bumping this. I have the same question. Long repetative URI's in a project. the resulting .n3 files can be so much easier to read if the subjects and objects would also use prefixes. Can this be a configurable option? |
example
vs
|
I see now why the prefix is not matching. It's because the regex used in N3 doesn't allow for any slashes after the partial IRI that is prefixed. Ive got long IRI's, and I can shorten them with prefixes, but it would leave some slashes because the common pattern in the IRI's only matches part of the IRI and some slashes remain afterwards. It's matching my whole IRI when I add But @RubenVerborgh do you know if it's against the standard to do so? Should a prefixed IRI not contain any slash? Because I see you're also checking a IRI is prefixed by ensuring there is no slash after
|
It's not, but there could be cases where regex performance gets into exponential territory because of backtracking (typically loads of slashes in URIs). |
expected results:
results:
The text was updated successfully, but these errors were encountered: