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

GH-1409: Unnecessary parsing of IRIs every time an RDF parser is used #1410

Conversation

avataar
Copy link
Contributor

@avataar avataar commented May 10, 2019

Signed-off-by: Pavel Mihaylov pavel@ontotext.com

This PR addresses GitHub issue: #1409

Also fixes an issue in AbstractRDFParser.createURI() where non-fatal validation of IRIs didn't return null (this was masked by old code in resolveURI()).

…arser is used

Signed-off-by: Pavel Mihaylov <pavel@ontotext.com>
@abrokenjester
Copy link
Contributor

@rdf4j-bot whitelist

@abrokenjester
Copy link
Contributor

@rdf4j-bot run tests

@abrokenjester
Copy link
Contributor

Thanks for the fix @avataar. It appears a regression test is failing. There may be a corner case overlooked here.

Pavel Mihaylov added 2 commits May 13, 2019 11:08
…arser is used (fixed failing test)

Signed-off-by: Pavel Mihaylov <pavel@ontotext.com>
…arser is used (fixed formatting from prev commit)

Signed-off-by: Pavel Mihaylov <pavel@ontotext.com>
@@ -440,8 +440,7 @@ public void test780IRISpace() throws Exception {
assertEquals(1, model.size());
model.filter(null, RDF.TYPE, null)
.objects()
.forEach(obj -> assertEquals("http://purl.bioontology.org/ontology/UATC/%20SERINE%20%20",
obj.stringValue()));
.forEach(obj -> assertEquals("http://purl.bioontology.org/ontology/UATC/ SERINE ", obj.stringValue()));
Copy link
Contributor

@abrokenjester abrokenjester May 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the test case to conform to the changed behaviour, and will result in syntactically illegal IRIs being produced. I know that this only occurs when VERIFY_URI_SYNTAX has been disabled, but looking at the original fix that introduced this test case (#780, see PR #839 ) the %-encoding of encoded spaces when syntax validation is disabled was a deliberate feature. Are you quite sure you're correct to modify this test?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking a bit further, the original issue complained about the round-trip: the writer serializing such IRIs with the spaces un-encoded. I've just verified that the TurtleWriter has been fixed to deal with that. So I guess the motivation for this test case (and the behavior that it tested) has changed, and you may be right that this is the correct behavior.

@abrokenjester abrokenjester merged commit a8323bf into eclipse-rdf4j:master May 17, 2019
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

Successfully merging this pull request may close these issues.

2 participants