-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #974 from nicholascar/Issue-920-redux
Issue 920 fixes as per Issue desc + test
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Issue 920 - NTriples fails to parse URIs with only a scheme | ||
from rdflib import Graph | ||
g=Graph() | ||
g.parse(data='<a:> <b:> <c:> .', format='nt') # nquads also fails | ||
N3, by contrast, succeeds: | ||
g.parse(data='<a:> <b:> <c:> .', format='n3') | ||
""" | ||
from rdflib import Graph | ||
import unittest | ||
|
||
|
||
class TestIssue920(unittest.TestCase): | ||
|
||
def test_issue_920(self): | ||
g = Graph() | ||
# NT tests | ||
g.parse(data='<a:> <b:> <c:> .', format='nt') | ||
g.parse(data='<http://a> <http://b> <http://c> .', format='nt') | ||
g.parse(data='<https://a> <http://> <http://c> .', format='nt') | ||
|
||
# related parser tests | ||
g.parse(data='<a:> <b:> <c:> .', format='turtle') | ||
g.parse(data='<http://a> <http://b> <http://c> .', format='turtle') | ||
g.parse(data='<https://a> <http://> <http://c> .', format='turtle') | ||
|
||
g.parse(data='<a:> <b:> <c:> .', format='n3') | ||
g.parse(data='<http://a> <http://b> <http://c> .', format='n3') | ||
g.parse(data='<https://a> <http://> <http://c> .', format='n3') | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |