-
Notifications
You must be signed in to change notification settings - Fork 543
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 parser: do not create formulas if the Turtle mode is activated #1142
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import unittest | ||
from io import BytesIO | ||
|
||
from rdflib import Graph | ||
from rdflib.plugins.memory import IOMemory | ||
from rdflib.plugins.stores.auditable import AuditableStore | ||
|
||
|
||
class TestIssue1141(unittest.TestCase): | ||
""" | ||
Tests is Turtle and TriG parsing works with a store with or without formula support | ||
""" | ||
def test_issue_1141(self): | ||
file = b"@prefix : <http://example.com/> . :s :p :o ." | ||
|
||
for format in ("turtle", "trig"): | ||
# with formula | ||
graph = Graph() | ||
self.assertTrue(graph.store.formula_aware) | ||
graph.load(BytesIO(file), format=format) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just FYI, in RDFLib 5.1.0 the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok! Thank you! I'll fix it if the global PR design is accepted |
||
self.assertEqual(len(graph), 1) | ||
|
||
# without | ||
graph = Graph(store=AuditableStore(IOMemory())) | ||
self.assertFalse(graph.store.formula_aware) | ||
graph.load(BytesIO(file), format=format) | ||
self.assertEqual(len(graph), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to have to look into this a little deeper. I don't know if adding a UUID to the RDFSink is the best way to approach this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UUID usage is what is currently done internally by the formula blank node generator