pkumod / gAnswer

A KBQA system based on DBpedia.
http://ganswer.gstore-pku.com
BSD 3-Clause "New" or "Revised" License
376 stars 98 forks source link

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

Open jamestch opened 5 years ago

jamestch commented 5 years ago

按照文档进行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 { ?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

ansNum=3 varNum=1 rawLines.length=4 Revise Answers: line=?wife: line=?wife: line=?wife: 3 ?wife: ?wife: ?wife: 看日志实际是有结果的,但是http请求看到的结果为空
nicklin96 commented 5 years ago

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

jamestch commented 5 years ago

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

nicklin96 commented 5 years ago

是的