class OreRdfGraphParser(RdfGraphParser): def __init__(self, session, config, parent=None): super(OreRdfGraphParser, self).__init__(session, config, parent) self.fsParser = RdfLibParser() def process_document(self, session, doc): fmt = self.get_setting(session, 'format', '') data = doc.get_raw(session) graph = Graph() inpt = StringInputSource(data) if fmt: graph.parse(inpt, fmt) else: graph.parse(inpt) rec = OreGraphRecord(graph) # drop into foresite to turn graph into ORE objects rem = self.fsParser.process_graph(graph) rec.aggregation = rem.aggregation return rec
def __init__(self, session, config, parent=None): super(OreRdfGraphParser, self).__init__(session, config, parent) self.fsParser = RdfLibParser()