diff options
Diffstat (limited to 'test/test_graph.py')
| -rw-r--r-- | test/test_graph.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test_graph.py b/test/test_graph.py index 08c112a5..8143eff9 100644 --- a/test/test_graph.py +++ b/test/test_graph.py @@ -9,9 +9,14 @@ from urllib.error import URLError, HTTPError from rdflib import URIRef, Graph, plugin from rdflib.exceptions import ParserError from rdflib.plugin import PluginException +from rdflib.namespace import Namespace from nose.exc import SkipTest +from pathlib import Path + +from test.testutils import GraphHelper + class GraphTestCase(unittest.TestCase): store = "default" @@ -326,6 +331,20 @@ class GraphTestCase(unittest.TestCase): # this endpoint is currently not available, ignore this test. pass + def test_parse_file_uri(self): + EG = Namespace("http://example.org/#") + g = Graph() + g.parse(Path("./test/nt/simple-04.nt").absolute().as_uri()) + triple_set = GraphHelper.triple_set(g) + self.assertEqual( + triple_set, + { + (EG["Subject"], EG["predicate"], EG["ObjectP"]), + (EG["Subject"], EG["predicate"], EG["ObjectQ"]), + (EG["Subject"], EG["predicate"], EG["ObjectR"]), + }, + ) + def testTransitive(self): person = URIRef("ex:person") dad = URIRef("ex:dad") |
