示例#1
0
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)
示例#2
0
文件: rdfx2kif.py 项目: weyls/swap
def convert(text, addr, outFp):
    gen = KIFSink.Sink(outFp)
    p = sax2rdf.RDFXMLParser(gen, addr)
    gen.startDoc()
    p.feed(text)
    gen.endDoc()