Exemplo n.º 1
0
 def _get_sparql_meta(self):
     """
     Parses the query metadata and load a table of available queries.
     """
     self._graph.parse(source=utils.get_meta_path(),
                       publicID=''.join(['file://', utils.get_meta_path()]),
                       format='turtle')
     result = self._graph.query(self._queries['meta.rq'])
     df = utils.result_to_dataframe(result)
     uuid_series = df.uri.str.slice(start=27)
     uuid_series.name = 'uuid'
     uuid = df.join(uuid_series)
     return uuid.set_index('uuid')
Exemplo n.º 2
0
    def execute_select(self, query_index, **kwargs):
        """
        Execute a query, but return dataframe of the results.

        Parameters
        ----------
        query_index : str

        Returns
        -------
        df : pandas.Dataframe
            Dataframe object of SELECT SPARQL query
        """
        result = self.execute(query_index, **kwargs)
        return utils.result_to_dataframe(result)