machinalis / quepy Goto Github PK
View Code? Open in Web Editor NEWA python framework to transform natural language questions to queries in a database query language.
License: Other
A python framework to transform natural language questions to queries in a database query language.
License: Other
502 Gateway Error in all queries
Hi,
Is there any support for legacy sql systems like mysql and oracle
Unmaintained? Last commit to master was more than 1 year ago.
That, docopt is missing as a requirement
Quepy provides support for cypher query languages?
Quepy provides support for cypher query languages? do you some advices?
thank you in advance~
How can I sort a query result set. similar to SELECT ... {...} ORDER BY ?var
change message:
"Want to help develop quepy? Welcome aboard! Find us in
quepydev at librelist.com"
to:
"Want to help develop quepy? Welcome aboard! Find us in
http://groups.google.com/group/quepy"
MQL will not be available in June 30, 2015.
It will be replaced with Wikidata.
See post here
I'd like to have support for key value store and document store storage backend:
This would be awesome for interconnected knowledge graphs retrieval of information in natural language.
I'm willing to help this happen.
In the example given on the Quepy README.rst, before
python examples/dbpedia/main.py "Who is Tom Cruise?"
, an instruction to configure settings.py (in examples/dbpedia) so that it points to the path where the nltkdata is placed, should be given.
I have installed as so:
pip install quepy
Then:
sivan@metal:~/icrav/code$ quepy
Traceback (most recent call last):
File "/home/sivan/icrav-venv/bin/quepy", line 27, in
from docopt import docopt
ImportError: No module named docopt
It appears that this fixes it:
pip install docopt
so docopt needs to be added to the requirements.txt
The query "What is Pokémon?" silently drops the é and then tells me there is no result in the database for "Pokmon". "What is Tyranitar?", on the other hand, got me this gem from Freebase:
are one of the 493 fictional species of Pokᅢᄅmon creatures from the multi-billion-dollar Pokᅢᄅmon media franchise, designed by Ken Sugimori. The purpose of Tyranitar in the games, anime, and manga, as with all other Pokᅢᄅmon, is to battle both wild Pokᅢᄅmon¬タヤuntamed creatures that characters encounter while embarking on various adventures and tamed Pokᅢᄅmon creatures owned by Pokᅢᄅmon trainer.
In case Github eats them, the two middle characters are U+FFC3 HALFWIDTH HANGUL LETTER AE and U+FFA9 HALFWIDTH HANGUL LETTER RIEUL - how U+00E9 LATIN SMALL LETTER E WITH ACUTE ended up as that is beyond me. (It may be a bug in the database, because the query "What is Pikachu?" gets back a correctly formatted page.)
While running quepy nltkdata /some/path
downloads the resources "wordnet" and "maxent_treebank
_pos_tagger", trying to run the applicaion gives the following error:
Resource u'taggers/averaged_perceptron_tagger/averaged_perceptron_tagger.pickle' not found. Please use the NLTK Downloader to obtain the resource: >>> nltk.download()
I believe this is because of the perceptron tagger being made the default tagger in the nltk project, which is a dependency for quepy.
As of now there are only triples inside WHERE{}. Including this filtering can increase the semantics in the search.
eg) List the details of Actors other than Tom Cruise?
which filters Tom Cruise and displays the result of other actors.
Implementing this is a great achievement against keyword based which will only details of Tom Cruise which is opposite of what the user wants.
To work on Windows, you'll need a quepy.bat wrapper for the quepy Python script. All the other things in my Scripts directory have them, but I'm not sure what is needed to get the installer to create it (or if you have to do it yourself). I installed using pip, not easy_install, if it makes a difference.
A few files where renamed and the docs were not changed to reflect this.
In particular, the tutorial name a file parsing.py
that does not exists because it was renamed to basic.py
.
This error should be fixed and a review of the docs should be made.
Anybody is welcome to submit pull requests for this!
I tried in several browsers and I get similar errors as below:
<title>502 Bad Gateway</title>I am facing some issues in understanding the api usage since I couldn't find enough examples. Besides the existing examples are unfortunately not very clear. It would be a great help if successful users of this framework could provide links to their projects.
Hi folks, is there any chance there's a simple way to implement other languages support? Cheers
as there is no quepy.py file then how can we start a new project
I have tried with quepyapp.py file to start a new project but nothing happened
"$ quepy.py startapp dbpedia"
how to do this
After installing with pip,It doesn't found any module quepy,(on windows)->and on "quepy --version" it opens up the quepy file in text editor.
please help me,I tries different way,but not any work for me.
I am constantly facing errors in this code, could anyone help me ?
I declared my ontology as filename in the settings.py folder,
what would be the best way to import ontology made in system to be used in quepy to generate queries ??
my conda env is python3,but it doesn't work,i can't import the quepy.when i create the env python2,it can work.it may not support the python3?
MQL write API has been retired and freebase now exists as a data dump of 1.9 billion Freebase triples in N-Triples RDF format, available on the developers page. So is it preferable to remove the related code or keep it as legacy?
@j0hn @dmoisset I am trying to build SPARQL queries using QUEPY and was looking for any example where you guys have used FILTER clause. I did not find any. Could you please provide a sample code or a tutorial. This issue has also been reported by another user #44.
Moreover, I tried to build queries extracting multiple items but query is not being generated. For example, i was trying to generate query for "list proteins with symbols and chromosome where protein symbol is ACT" How can I build query like this?
3- To generate a federated query you have to join the query with SERVICE clause. Does quepy support for joining (SERVICE) clause.
Hi elias,
Am getting below error..
C:\Users\xbbl1wk\Desktop\quepy-develop\examples\dbpedia>python main.py "who i
PREFIX owl: http://www.w3.org/2002/07/owl#
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX foaf: http://xmlns.com/foaf/0.1/
PREFIX skos: http://www.w3.org/2004/02/skos/core#
PREFIX quepy: http://www.machinalis.com/quepy#
PREFIX dbpedia: http://dbpedia.org/ontology/
PREFIX dbpprop: http://dbpedia.org/property/
PREFIX dbpedia-owl: http://dbpedia.org/ontology/
SELECT DISTINCT ?x1 WHERE {
?x0 rdf:type foaf:Person.
?x0 rdfs:label "Tom Cruise"@en.
?x0 rdfs:comment ?x1.
}
Traceback (most recent call last):
File "main.py", line 210, in
results = sparql.query().convert()
File "build\bdist.win32\egg\SPARQLWrapper\Wrapper.py", line 567, in query
File "build\bdist.win32\egg\SPARQLWrapper\Wrapper.py", line 537, in _query
File "C:\Users\xbbl1wk\AppData\Local\Continuum\Anaconda2\lib\urllib2.py", l
rlopen
return opener.open(url, data, timeout)
File "C:\Users\xbbl1wk\AppData\Local\Continuum\Anaconda2\lib\urllib2.py", l
pen
response = self._open(req, data)
File "C:\Users\xbbl1wk\AppData\Local\Continuum\Anaconda2\lib\urllib2.py", l
open
'_open', req)
File "C:\Users\xbbl1wk\AppData\Local\Continuum\Anaconda2\lib\urllib2.py", l
call_chain
result = func(*args)
File "C:\Users\xbbl1wk\AppData\Local\Continuum\Anaconda2\lib\urllib2.py", l
http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Users\xbbl1wk\AppData\Local\Continuum\Anaconda2\lib\urllib2.py", l
do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 10060] A connection attempt failed be
nected party did not properly respond after a period of time, or established
iled because connected host has failed to respond>
can you please help..
Traceback (most recent call last):
File "main.py", line 20, in
import quepy
File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/quepy/init.py", line 17, in
from quepy.quepyapp import install, QuepyApp
File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/quepy/quepyapp.py", line 41
except ImportError, error:
^
SyntaxError: invalid syntax
I just installed quepy to start working with some examples as shown in the tutorials. But I get the following errors while running main.py
.
Traceback (most recent call last):
File "main.py", line 9, in <module>
target, query, metadata = testquepy.get_query("what is a blowtorch?")
File "/usr/local/lib/python2.7/dist-packages/quepy/quepyapp.py", line 106, in get_query
for target, query, userdata in self.get_queries(question):
File "/usr/local/lib/python2.7/dist-packages/quepy/quepyapp.py", line 123, in get_queries
for expression, userdata in self._iter_compiled_forms(question):
File "/usr/local/lib/python2.7/dist-packages/quepy/quepyapp.py", line 137, in _iter_compiled_forms
words = list(self.tagger(question))
File "/usr/local/lib/python2.7/dist-packages/quepy/tagger.py", line 68, in wrapper
words = tagger_function(string)
File "/usr/local/lib/python2.7/dist-packages/quepy/tagger.py", line 64, in <lambda>
tagger_function = lambda x: run_nltktagger(x, settings.NLTK_DATA_PATH)
File "/usr/local/lib/python2.7/dist-packages/quepy/nltktagger.py", line 49, in run_nltktagger
u'NN': wordnet.NOUN,
File "/usr/local/lib/python2.7/dist-packages/nltk/corpus/util.py", line 99, in __getattr__
self.__load()
File "/usr/local/lib/python2.7/dist-packages/nltk/corpus/util.py", line 64, in __load
except LookupError: raise e
LookupError:
**********************************************************************
Resource u'corpora/wordnet' not found. Please use the NLTK
Downloader to obtain the resource: >>> nltk.download()
Searched in:
- u'/'
- u'h'
- u'o'
- u'm'
- u'e'
- u'/'
- u'g'
- u'u'
- u'r'
- u'u'
- u'p'
- u'a'
- u'd'
- u'/'
- u'n'
- u'l'
- u't'
- u'k'
- u'_'
- u'd'
- u'a'
- u't'
- u'a'
**********************************************************************
Also this is how i set he nltk_data variable in settings.py
:
# NLTK config
NLTK_DATA_PATH = "/home/gurupad/nltk_data" # List of paths with NLTK data
Can someone help me out?
When I ask "What is the capital of Massachusetts?" it fails to find an answer because it thinks Massachusetts is a country.
Word.prob seems to be unused.
It should be checked that this is so and the "prob" attribute and related code removed.
Credit to @dmoisset for spotting it
Hi in the online demo given at http://quepy.machinalis.com/ I'm getting result for "what is the plot of Titanic?" but not for "what is the plot of titanic?"
Is this expected?
I have been adding functions to, for example, ask the release date of a song. However, there are TWO other functions for this, except for different domains, movies and TV shows. How can we deal with this? Can you add some function that can determine whether the movies query yields no results, so try the TV show query, then the song query? Or is there a way to show all query results?
Hola, Todos los ejemplos tienen la siguiente sintaxis
SELECT DISTINCT {select} ....
por ejemplo:
SELECT DISTINCT ?x1 WHERE {
?x0 rdf:type foaf:Person.
?x0 rdfs:label "Tom Cruise"@en.
?x0 rdfs:comment ?x1.
}
Mi pregunta es, si es posible agregar mas variables en el SELECT
por ejemplo:
SELECT DISTINCT ?x0 ?x1 WHERE {
?x0 rdf:type foaf:Person.
?x0 rdfs:label "Tom Cruise"@en.
?x0 rdfs:comment ?x1.
}
Saludos
I am trying to create my own RDF module based on dbpedia in Chinese.
In my dsl.py, we created something like:
HasKeyword.relation = "rdfs:label"
HasKeyword.language = "zh"
However, when I created two RDF modules simultaneously in the constructor of main class:
self.dbpedia = quepy.install("dbpedia")
self.zhwiki = quepy.install("zhwiki") # Chinese version of dbpedia
I found that the latter module that I created will always override the first one.
In particular, the dsl.py for dbpedia look likes:
HasKeyword.language = "en"
And the variable "HasKeyword.language" will be overrided as "zh"
Is there any good way to resolve it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.