<s> from rdflib . graph import ConjunctiveGraph <EOL> from rdflib . term import URIRef , Literal <EOL> from rdflib . namespace import RDFS <EOL> from StringIO import StringIO <EOL> import unittest <EOL> testContent = """<STR_LIT>""" <EOL> doc1 = URIRef ( "<STR_LIT>" ) <EOL> QUERY = u"""<STR_LIT>""" <EOL> class TestSparqlOPT_FILTER2 ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . graph = ConjunctiveGraph ( ) <EOL> self . graph . load ( StringIO ( testContent ) , format = '<STR_LIT>' ) <EOL> def test_OPT_FILTER ( self ) : <EOL> results = self . graph . query ( QUERY , <EOL> DEBUG = False ) <EOL> results = list ( results ) <EOL> self . failUnless ( <EOL> results == [ ( doc1 , ) ] , <EOL> "<STR_LIT>" % ( [ ( doc1 , ) ] , repr ( results ) ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
