def rdfxmlparser(store, openFormula, thisDoc=None, flags="", why=None, parser='sax2rdf'): if parser == 'rdflib': import rdflib_user return rdflib_user.rdflib_handoff(store, openFormula, thisDoc, why=why) else: # parser == sax2xml import sax2rdf return sax2rdf.RDFXMLParser(store, openFormula, thisDoc=thisDoc, flags=flags, why=why)
def convert(text, addr, outFp): gen = KIFSink.Sink(outFp) p = sax2rdf.RDFXMLParser(gen, addr) gen.startDoc() p.feed(text) gen.endDoc()