Allow parentheses in uri by fredrik-aschehoug · Pull Request #1280 · RDFLib/rdflib (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation2 Commits7 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

fredrik-aschehoug

Fixes: Allow URI's containing parentheses to be split correctly.

I could not find any documentation stating that parentheses are not allowed in the name part of the URI. I noticed that in my serialized graphs, URI's containing parentheses did not serialize properly. Yago3 for example uses parentheses extensively.

Please excuse me if my assumption that parentheses are allowed is wrong.

@coveralls

Coverage Status

Coverage decreased (-0.008%) to 75.515% when pulling a5f3964 on fredrik-aschehoug:allow_parantheses_in_URI into 1b77d03 on RDFLib:master.

@nicholascar

Yes, "(" & ")" are indeed allowed, they are sub-delims, that is used for delimitation in some places within the URI but not everywhere. See the URI syntax https://tools.ietf.org/html/rfc3986#section-3.3:

pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"

Since the theory checks out, the PR passes all tests and you've supplied new tests, I'm happy to approve this.

nicholascar