tst: added test for the use cases
@@ -69,6 +69,21 @@ def test_turtle_valid_list():
for o in g.objects(NS.s, NS.p):
assert turtle_serializer.isValidList(o)
+def test_turtle_namespace():
+ graph = Graph()
+ graph.bind('GENO', 'http://purl.obolibrary.org/obo/GENO_')
+ graph.bind('RO_has_phenotype',
+ 'http://purl.obolibrary.org/obo/RO_0002200')
+ graph.add((URIRef('http://example.org'),
+ URIRef('http://purl.obolibrary.org/obo/RO_0002200'),
+ URIRef('http://purl.obolibrary.org/obo/GENO_0000385')))
+ output = [val for val in
+ graph.serialize(format='turtle').decode().splitlines()
+ if not val.startswith('@prefix')]
+ output = ' '.join(output)
+ assert 'RO_has_phenotype:' in output
+ assert 'GENO:0000385' in output
+
if __name__ == "__main__":
import nose
