def run(modName) :
        # Import the python module
        defs = None
        (fl,realpath,descr) = imp.find_module(modName,["."])
        mod = imp.load_module(modName,fl,realpath,descr)
        defs = mod.__dict__

        ##################################################
        # Two ways of identifying the RDF data:
        # 1. A Triple Store generated in the module
        graph = None
        try :
                graph = defs["graph"]
        except :
                pass
        # 2. Directly in the test module as a string
        rdfData = None
        try :
                rdfData     = defs["rdfData"]
        except :
                pass

        # Get the final of the triple store...
        if graph == None :
                stream = FileInputSource(StringIO.StringIO(rdfData))
                graph = sparqlGraph.SPARQLGraph()
                graph.parse(stream,format="xml")

        ###############################################
        # Retrive the query data
        pattern     = defs["pattern"]
        optPattern  = defs["optional"]	
        construct   = defs["construct"]	


        ###############################################		
        print "\n============= Test Module: %s =============" % modName			

        results     = graph.queryObject(pattern,optPattern)
        graph = results.construct(construct)
        graph.serialize("output.rdf")

        print "=== generated RDF file (output.rdf):\n"
        for l in file("output.rdf") :
                sys.stdout.write(l)
dataset/ETHPy150Open RDFLib/rdfextras/test/test_sparql/sparql/ConstructTests/constuctTest.py/run/original