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

Updating namespace.py to solve issue #801 #1044

Merged
merged 7 commits into from Jul 30, 2020

Conversation

aayush17002
Copy link
Contributor

@aayush17002 aayush17002 commented May 10, 2020

Added acceptance clause for "%" in Allowed name chars.

Closes #801

Added acceptance clause for "%" in Allowed name chars.
@coveralls
Copy link

coveralls commented May 10, 2020

Coverage Status

Coverage increased (+0.1%) to 75.766% when pulling 63a825f on aayush17002:patch-1 into a3245fb on RDFLib:master.

Test file to increase the scope of n amespaces.
@white-gecko
Copy link
Member

Were you able to check if this also results in valid results for the other serialization formats? #801 (comment)

@aayush17002
Copy link
Contributor Author

Yes on making the changes described in my code I was able to get valid results other serialization formats also.

@aayush17002
Copy link
Contributor Author

Sir,
Are there any other changes required, If not, please accept my solution.

Comment on lines 2 to 5
Issue 715 - path query chaining issue
Some incorrect matches were found when using oneOrMore ('+') and
zeroOrMore ('*') property paths and specifying neither the
subject or the object.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment looks out of date.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@darrengarvey I have updated the comment

g.bind('', example)
node = BNode()
g.add((node, example['first%20name'], Literal('John')))
print(g.serialize(format="turtle").decode())
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be checking the result of the serialisation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@darrengarvey I have added the assert statement for checking the result

Deleting test_issue801
Updated test file to test issue 801
Added assertions for testing issue RDFLib#801
@@ -13,7 +13,8 @@ def test_issue_801(self):
g.bind('', example)
node = BNode()
g.add((node, example['first%20name'], Literal('John')))
print(g.serialize(format="turtle").decode())
self.assertEqual(g.serialize(format="turtle").decode().split("\n")[-3] == '[] :first%20name "John" .', True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this instead be:

self.assertEqual(g.serialize(format="turtle").decode().split("\n")[-3],
                '[] :first%20name "John" .')

That way if the test fails you get to see what both sides of the equality comparison are. Plus keeping the line length shorter and making the string easier to see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@darrengarvey I have applied the requested changes

@@ -13,7 +13,8 @@ def test_issue_801(self):
g.bind('', example)
node = BNode()
g.add((node, example['first%20name'], Literal('John')))
print(g.serialize(format="turtle").decode())
self.assertEqual(g.serialize(format="turtle").decode().split("\n")[-3] == '[] :first%20name "John" .', True)
print (g.serialize(format="turtle").decode())
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to make test run output noisy. I don't see other tests in rdflib printing output, so do you need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@darrengarvey I have applied the requested changes

Removed print statement
Reformatting assert statement
Copy link
Contributor

@darrengarvey darrengarvey left a comment

Choose a reason for hiding this comment

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

LGTM.

(@aayush17002 I'm not a developer, but thought I'd review anyway)

@nicholascar
Copy link
Member

@aayush17002 please merge in master branch since a whole host of changes were recently merged in to remove Python 2 code. This will trigger a re-checking of the code by Travis. Then it may be ready for merging.

@aayush17002
Copy link
Contributor Author

@nicholascar I have merged into the master branch again as suggested by you

@nicholascar nicholascar merged commit 7c7f763 into RDFLib:master Jul 30, 2020
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.

Problem with prefixes created for URIs containing %20
5 participants