summaryrefslogtreecommitdiff
path: root/rdflib/plugins/sparql/results/graph.py
blob: 0b14be27bb03e97dfb82fb8860ced2840db98a99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
from rdflib import Graph
from rdflib.query import Result, ResultParser


class GraphResultParser(ResultParser):
    def parse(self, source, content_type):

        res = Result("CONSTRUCT")  # hmm - or describe?type_)
        res.graph = Graph()
        res.graph.parse(source, format=content_type)

        return res