示例#1
0
    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
示例#2
0
 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
示例#3
0
 def __init__(self, session, config, parent=None):
     super(OreRdfGraphParser, self).__init__(session, config, parent)
     self.fsParser = RdfLibParser()
示例#4
0
 def __init__(self, session, config, parent=None):
     super(OreRdfGraphParser, self).__init__(session, config, parent)
     self.fsParser = RdfLibParser()