def __init__(self, name=None): self.wf = Workflow(name) self.data = data.Datasets(self.wf)
"""Build FactGrid knowledge base and alias tables.""" import sling import sling.flags as flags import sling.task.workflow as workflow import sling.task.data as data flags.parse() # Start up workflow system. workflow.startup() # Create workflow. wf = workflow.Workflow("factgrid") datasets = data.Datasets(wf) # Resources. def res(files, fmt="records/frame"): return wf.resource(files, format=fmt) fgdir = "data/e/factgrid" fg_items = res(fgdir + "/factgrid-items.rec") fg_properties = res(fgdir + "/factgrid-properties.rec") items = res(fgdir + "/items.rec") fanin = res(fgdir + "/fanin.rec") xrefs = res(fgdir + "/xrefs.sling", "store/frame") xref_config = res("data/factgrid/xrefs.sling", "store/frame") recon_config = res("data/factgrid/recon.sling", "store/frame") fg_kb = res(fgdir + "/factgrid-kb.sling", "store/frame")