<s> from unittest import TestCase <EOL> from rdflib import ConjunctiveGraph <EOL> from rdflib import Namespace , Literal <EOL> from rdflib . collection import Collection <EOL> from nose . exc import SkipTest <EOL> target1xml = """<STR_LIT>""" <EOL> target2xml = """<STR_LIT>""" <EOL> class CollectionTest ( TestCase ) : <EOL> def test_collection_render ( self ) : <EOL> foo = Namespace ( '<STR_LIT>' ) <EOL> ex = Namespace ( '<STR_LIT>' ) <EOL> rdf = Namespace ( '<STR_LIT>' ) <EOL> target1 = ConjunctiveGraph ( ) <EOL> target1 . parse ( data = target1xml ) <EOL> target2 = ConjunctiveGraph ( ) <EOL> target2 . parse ( data = target2xml ) <EOL> g = ConjunctiveGraph ( ) <EOL> bits = [ ex [ '<STR_LIT:a>' ] , ex [ '<STR_LIT:b>' ] , ex [ '<STR_LIT:c>' ] ] <EOL> l = Collection ( g , ex [ '<STR_LIT>' ] , bits ) <EOL> triple = ( ex [ '<STR_LIT>' ] , rdf [ '<STR_LIT:type>' ] , foo [ '<STR_LIT>' ] ) <EOL> g . add ( triple ) <EOL> triple = ( ex [ '<STR_LIT>' ] , foo [ '<STR_LIT>' ] , Literal ( '<STR_LIT>' ) ) <EOL> g . add ( triple ) <EOL> for b in bits : <EOL> triple = ( b , rdf [ '<STR_LIT:type>' ] , foo [ '<STR_LIT>' ] ) <EOL> g . add ( triple ) <EOL> self . assertEqual ( g . isomorphic ( target1 ) , True ) </s>
