cubicweb/web/views/sparql.py
changeset 12830 5318da3497e8
parent 12826 c13c0188f8a3
equal deleted inserted replaced
12829:0e9ce897dfdf 12830:5318da3497e8
    59         vid = self._cw.form.get('resultvid', 'table')
    59         vid = self._cw.form.get('resultvid', 'table')
    60         if sparql:
    60         if sparql:
    61             try:
    61             try:
    62                 qinfo = Sparql2rqlTranslator(self._cw.vreg.schema).translate(sparql)
    62                 qinfo = Sparql2rqlTranslator(self._cw.vreg.schema).translate(sparql)
    63             except TypeResolverException as exc:
    63             except TypeResolverException as exc:
    64                 self.w(self._cw._('can not resolve entity types:') + u' ' + unicode(exc))
    64                 self.w(self._cw._('can not resolve entity types:') + u' ' + str(exc))
    65             except UnsupportedQuery:
    65             except UnsupportedQuery:
    66                 self.w(self._cw._('we are not yet ready to handle this query'))
    66                 self.w(self._cw._('we are not yet ready to handle this query'))
    67             except xy.UnsupportedVocabulary as exc:
    67             except xy.UnsupportedVocabulary as exc:
    68                 self.w(self._cw._('unknown vocabulary:') + u' ' + unicode(exc))
    68                 self.w(self._cw._('unknown vocabulary:') + u' ' + str(exc))
    69             else:
    69             else:
    70                 rql, args = qinfo.finalize()
    70                 rql, args = qinfo.finalize()
    71                 if vid == 'sparqlxml':
    71                 if vid == 'sparqlxml':
    72                     url = self._cw.build_url('view', rql=rql % args, vid=vid)
    72                     url = self._cw.build_url('view', rql=rql % args, vid=vid)
    73                     raise Redirect(url)
    73                     raise Redirect(url)