generator.get_code()

22 views
Skip to first unread message

Naresh MG

unread,
Mar 23, 2016, 5:59:54 PM3/23/16
to Quepy
So I could not run quepy from command prompt for windows but I tried calling get_code() from within generation.py (again on Windows)

basically inserted this line at the bottom in generation.py

get_code("Who is Tom Cruise?","sparql")

and tried to execute generation.py() but get the following error

  File "C:\Anaconda3\lib\site-packages\quepy\sparql_generation.py", line 45, in expression_to_sparql
    head = adapt(e.get_head())
AttributeError: 'str' object has no attribute 'get_head'




and for dot and mql I get this error..

  File "C:\Anaconda3\lib\site-packages\quepy\dot_generation.py", line 47, in expression_to_dot
    for node in e.iter_nodes():
AttributeError: 'str' object has no attribute 'iter_nodes'

so guess the question is not to be passed in as a str, how should the question be passed in please.

Any ideas ?


Thanks !



Rafael Carrascosa

unread,
Mar 23, 2016, 8:26:11 PM3/23/16
to qu...@googlegroups.com
get_code takes an Expression instance as the first argument. Check out dsl.py
An Expression instance is a tree-like structure that encodes a query.

Cheers!

--
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.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages