Quepy for Elastic Search

152 views
Skip to first unread message

Naresh MG

unread,
Mar 22, 2016, 4:17:34 PM3/22/16
to Quepy
Hello,

what you have built here with Quepy is absoultey great. thanks for the same.

I have one question though...the documentation says "dbpedia/dsl.py: the file where you will define the domain specific language of your database schema. "

Does "your database" mean any database or only the ones supported at the moment ?

I am trying to see if this can be used for Elastic Search...and if not out of the box..I am assuming changes or further development can be done for Elastic Search...by reading your documentation  

Thanks for your help !

-Naresh

Rafael Carrascosa

unread,
Mar 22, 2016, 6:12:38 PM3/22/16
to qu...@googlegroups.com
Hi,

By 'database' we mean something that accepts SPARQL queries. If you have a database that accepts other query languages but not SPARQL then you will need to use some kind of adapter to translate the query languages.

Alternatively, if you dare, you could try writing an adaptor (in generation.py) to output the destination query language directly. There are two generators (sparql and mql) that you could use as examples.

Regards,

Rafael


--
You received this message because you are subscribed to the Google Groups "Quepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quepy+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Naresh

unread,
Mar 28, 2016, 9:14:56 PM3/28/16
to Quepy
while I am trying to wrap my head around this nice library, a question to check if I might be headed in the right direction..

I want to incorporate a new set of question kind...on a new entity in an orgnzation (say that does not fall into Person, Movie, etc..) then my understanding is that I would create a new py file similar to person.py, movie.py...say simply call it airplane.py 

Example questions are 
- How many average number of planes land in SFO
- What is the average number of planes that land in SFO
- How many planes landed in SFO today


In this new airplane.py , I would create classes like...WhatIsAverage(), WhatIsTotal(), HowMany()

And then the tackle ...dsl.py and generation.py (yet to figure that out...but just checking teh direction to start with)

Rafael Carrascosa

unread,
Mar 28, 2016, 10:45:55 PM3/28/16
to qu...@googlegroups.com
Hi Naresh,

Yes, you are in the right track. Each of those clases specifies an edge in a graph database. If you try Quepy agains dbpedia you should not need to make any changes to dsl.py and generation.py.

If you are trying to map a few know question kinds (say 20) into queries on a SQL database that has not so many tables (say 20) then you might have better luck by just parsing your queries with regular expressions and mapping them to SQL 'by hand'. I sounds silly, yes, but it will get you further than you think.
I you want to make it fancier you can re-use the refo's regexes and the basic NLP from Quepy.


Cheers!





Naresh

unread,
Mar 29, 2016, 7:01:57 PM3/29/16
to Quepy
Thanks ! will look out for the regex  option also !, would agree for something not too fancy regex should do the trick !

Pranay Roy

unread,
Apr 2, 2016, 10:03:08 PM4/2/16
to qu...@googlegroups.com

Hi Naresh,
I am also trying to something similar like you. Is Quepy useful in creating SQL.
?

Message has been deleted

Rafael Carrascosa

unread,
Oct 12, 2016, 9:18:44 AM10/12/16
to qu...@googlegroups.com
Hi Vishnu,

For the Quepy demo we used sparqlwrapper to make the connection to the database. Check out how it is used in this file.
Also, please note that making the actual query to the database is outside of Quepy's scope, which is converting natural language to database queries (not answers).

Cheers,


Rafael

On Wed, Oct 12, 2016 at 4:38 AM, Vishnu Jayanand <vishnu....@gmail.com> wrote:
Hi rafacarrascosa,

I understand that the DB requires support for SPARQL queries. Let's say xyz DB has that. How do I define connection to xyz DB? Which file defines the connection properties? settings.py?
Please guide. Very new to this.

Regards,
Vishnu
To unsubscribe from this group and stop receiving emails from it, send an email to quepy+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages