Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy GAnswer via jar后,http请求返回结果异常 #31

Open
jamestch opened this issue Sep 11, 2019 · 3 comments
Open

Deploy GAnswer via jar后,http请求返回结果异常 #31

jamestch opened this issue Sep 11, 2019 · 3 comments

Comments

@jamestch
Copy link

jamestch commented Sep 11, 2019

按照文档进行jar包部署,且出现了"Server Ready!"。

但发送请求 :
http://ip:port/gSolve/?data={maxAnswerNum:3,%20maxSparqlNum:2,%20question:Who%20is%20the%20wife%20of%20Donald%20Trump?}
返回结果如下:
{"question":"Who is the wife of Donald Trump?","vars":["?wife"],"sparql":["select DISTINCT ?wife where { \t\t?wife. } LIMIT 3"],"results":{"bindings":[{"?wife":{"type":"uri","value":""}},{"?wife":{"type":"uri","value":""}},{"?wife":{"type":"uri","value":""}}]},"status":"200"}
返回结果中value为空,但是我看后台输出日志里面,实际已经查询到了结果,如下:
==========Group Simple Relations=========

Check query graph count: 80
Pass single check: 2
Pass final check: 3
TopkJoin time=3
number of rankedSparqls = 3
parameter: ?operation=query&username=root&password=123456&db_name=dbpedia16&format=txt&sparql=select DISTINCT ?wife where { <Donald_Trump> ?wife. } LIMIT 3
request: http://dbpedia16.gstore-pku.com:80/%3Foperation%3Dquery%26username%3Droot%26password%3D123456%26db_name%3Ddbpedia16%26format%3Dtxt%26sparql%3Dselect+DISTINCT+%3Fwife++where+%7B+%3CDonald_Trump%3E%09%3Cspouse%3E%09%3Fwife.+%7D+LIMIT+3
?wife
<Ivana_Trump>
<Melania_Trump>
<Marla_Maples>

ansNum=3
varNum=1
rawLines.length=4
Revise Answers:
line=?wife:<Ivana_Trump>
line=?wife:<Melania_Trump>
line=?wife:<Marla_Maples>
3
?wife:<Ivana_Trump>
?wife:<Melania_Trump>
?wife:<Marla_Maples>
看日志实际是有结果的,但是http请求看到的结果为空

@nicklin96
Copy link
Collaborator

您好!请问您是用什么方式获取和查看http请求返回的呢?
如果您在浏览器中查看返回内容,实体名字可能会被识别成HTML tag而无法正常显示。您可以通过查看网页源代码看到被识别成HTML tag的内容

@jamestch
Copy link
Author

谢谢您的指导,的确如此,查看网页源代码可以看到返回结果。这个问题是不是纯粹是网页展示的问题,那是不是可以这样理解:我通过程序requests.post/get获取response后直接解析结果是不是不存在这个问题

@nicklin96
Copy link
Collaborator

是的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants