Skip to content

Commit

Permalink
prefix test for #428
Browse files Browse the repository at this point in the history
  • Loading branch information
gromgull committed Jan 24, 2017
1 parent 18efdd4 commit 1479e51
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_trig.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,25 @@ def testDefaultGraphSerializesWithoutName(self):
data = g.serialize(format='trig')

self.assertTrue('None' not in data)

def testPrefixes(self):

data = """
@prefix ns1: <http://ex.org/schema#> .
<http://ex.org/docs/document1> = {
ns1:Person_A a ns1:Person ;
ns1:TextSpan "Simon" .
}
<http://ex.org/docs/document2> = {
ns1:Person_C a ns1:Person ;
ns1:TextSpan "Agnes" .
}
"""

cg = rdflib.ConjunctiveGraph()
cg.parse(data=data, format='trig')
data = cg.serialize(format='trig')

self.assert_('ns2: <http://ex.org/docs/' in data, data)
self.assert_('<ns2:document1>' not in data, data)
self.assert_('ns2:document1' in data, data)

0 comments on commit 1479e51

Please sign in to comment.