<s> import unittest <EOL> import rdflib <EOL> rdflib . plugin . register ( '<STR_LIT>' , rdflib . store . Store , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> class StoreTestCase ( unittest . TestCase ) : <EOL> def test_memory_store ( self ) : <EOL> g = rdflib . Graph ( "<STR_LIT>" ) <EOL> subj1 = rdflib . URIRef ( "<STR_LIT>" ) <EOL> pred1 = rdflib . URIRef ( "<STR_LIT>" ) <EOL> obj1 = rdflib . URIRef ( "<STR_LIT>" ) <EOL> triple1 = ( subj1 , pred1 , obj1 ) <EOL> triple2 = ( subj1 , <EOL> rdflib . URIRef ( "<STR_LIT>" ) , <EOL> rdflib . URIRef ( "<STR_LIT>" ) ) <EOL> g . add ( triple1 ) <EOL> self . assert_ ( len ( g ) == <NUM_LIT:1> ) <EOL> g . add ( triple2 ) <EOL> self . assert_ ( len ( list ( g . triples ( ( subj1 , None , None ) ) ) ) == <NUM_LIT:2> ) <EOL> self . assert_ ( len ( list ( g . triples ( ( None , pred1 , None ) ) ) ) == <NUM_LIT:1> ) <EOL> self . assert_ ( len ( list ( g . triples ( ( None , None , obj1 ) ) ) ) == <NUM_LIT:1> ) <EOL> g . remove ( triple1 ) <EOL> self . assert_ ( len ( g ) == <NUM_LIT:1> ) <EOL> g . serialize ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( defaultTest = '<STR_LIT>' ) </s>
