summaryrefslogtreecommitdiff
path: root/test/test_graph.py
diff options
context:
space:
mode:
authorNicholas Car <nicholas.car@surroundaustralia.com>2021-10-17 21:23:14 +1000
committerGitHub <noreply@github.com>2021-10-17 21:23:14 +1000
commit735ecb99b6def1f0dd7aa480e3a81334ae740a0f (patch)
treece1a92c82c735479ce89ba3258a866d998e286c9 /test/test_graph.py
parent9a9ca7c37d936d7ae00134226a8d249d6a97fed7 (diff)
parent49462fddad2bd2ff148134b49241e1c9d5a8e09f (diff)
downloadrdflib-ttl2.tar.gz
Merge branch 'master' into ttl2ttl2
Diffstat (limited to 'test/test_graph.py')
-rw-r--r--test/test_graph.py19
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")