Demonstrator - Reasoning WebAPI issueshttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues2020-12-12T19:06:59Zhttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/25Describe project2020-12-12T19:06:59ZSiebers, MichaelDescribe projectGive the GitLab project a telling name, maybe provide additional information / linksGive the GitLab project a telling name, maybe provide additional information / linksVersion 1.0Siebers, MichaelSiebers, Michaelhttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/20/explain: Is it supposed to be like this?2020-11-23T15:35:40ZSyed Mamoon Ahmed/explain: Is it supposed to be like this?Please tell me what am I doing wrong?
Here is my request:
> {
> "abs_path": "/A/B/Filename-2.exe"
> }
Here is the response:
> HTTP/1.1 400 Bad Request
> Date: Mon, 16 Nov 2020 21:43:23 GMT
> Connection: close
> Content-Le...Please tell me what am I doing wrong?
Here is my request:
> {
> "abs_path": "/A/B/Filename-2.exe"
> }
Here is the response:
> HTTP/1.1 400 Bad Request
> Date: Mon, 16 Nov 2020 21:43:23 GMT
> Connection: close
> Content-Length: 350
> Content-Type: text/html; charset=UTF-8
>
> <!DOCTYPE html>
> <html>
> <head>
> <title>400 Bad Request</title>
>
> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
>
> </head>
> <body>
>
> <h1>Bad Request</h1>
>
> <p>
> Unknown message: not_irrelevant('/A/B/Filename-2.exe')</p>
>
> <address>
> <a href="http://www.swi-prolog.org">SWI-Prolog</a> httpd at transmatter-laptop
> </address>
>
> </body>
> </html>Sebastian SeufertSebastian Seuferthttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/19irrelevant/file result not satisfactory2020-12-04T17:46:02ZSyed Mamoon Ahmedirrelevant/file result not satisfactoryI did the following two requests to /bg endpoint from example:
```
[
{
"type" : "file",
"abs_path": "/A/B/Filename.exe",
"file_size": 1024,
"creation_time": "1604235569",
"modification_time": "1...I did the following two requests to /bg endpoint from example:
```
[
{
"type" : "file",
"abs_path": "/A/B/Filename.exe",
"file_size": 1024,
"creation_time": "1604235569",
"modification_time": "1604235569",
"access_time": "1604235569",
"change_time": "1604235569",
"media_type": "img",
"filename_extension": "png"
},
{
"type" : "directory",
"abs_path": "/A/B/",
"creation_time": "1604235509",
}
]
```
and
```
[
{
"type" : "file",
"abs_path": "/A/B/Filename-2.exe",
"file_size": 1024,
"creation_time": "1604235589",
"modification_time": "1604235589",
"access_time": "1604235589",
"change_time": "1604235589",
"media_type": "img",
"filename_extension": "png"
}
]
```
then following request to /irrelevant/file:
```
{
"abs_path": "/A/B/Filename-2.exe",
}
```
I get the following response:
`{"result": false}`
Which according to the the irrelevance theory:
`irrelevant(F) :- same_directory(F,F2), newer(F2,F).`
should be true.
I have also tried changing the time to earlier (i.e. query file is older) i still get the "false" responseSiebers, MichaelSiebers, Michaelhttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/18204 response not working in /clear endpoint2020-11-28T11:27:48ZSyed Mamoon Ahmed204 response not working in /clear endpointAfter a file is unregistered from the background knowledge, any repitition of same request yields the following result:
> (500 internal server error) goal unexpectedly failed: web_api:clear_bg([protocol(http),peer(ip(127,0,0,1)),pool(c...After a file is unregistered from the background knowledge, any repitition of same request yields the following result:
> (500 internal server error) goal unexpectedly failed: web_api:clear_bg([protocol(http),peer(ip(127,0,0,1)),pool(client('httpd@4444',web_api:http_dispatch,<stream>(0x7fe91c0310c0),<stream>(0x7fe91c0117b0))),input(<stream>(0x7fe91c0310c0)),method(post),request_uri('/clear'),path('/clear'),http_version(1-1),accept_encoding('gzip,deflate'),content_type('application/json'),content_length(274),host(localhost),port(4444),connection('Keep-Alive'),user_agent('Apache-HttpClient/4.1.1 (java 1.5)')])https://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/17Alternate misfiring in /bg endpoint2020-11-28T11:27:25ZSyed Mamoon AhmedAlternate misfiring in /bg endpointAfter a file is registered into the background knowledge, the first consecutive request yields 204 response. But after that the server starts misfiring on alternate requests:
> error getting response: org.apache.http.client.ClientProtoc...After a file is registered into the background knowledge, the first consecutive request yields 204 response. But after that the server starts misfiring on alternate requests:
> error getting response: org.apache.http.client.ClientProtocolExceptionSebastian SeufertSebastian Seuferthttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/16No content in 204 response in /bg endpoint2020-11-23T15:33:10ZSyed Mamoon AhmedNo content in 204 response in /bg endpointAfter a file is registered to the background knowledge, I can receive the 204 response on the next request, but there is no conetent as described in the README:
> HTTP/1.1 204 No Content
> Date: Mon, 16 Nov 2020 19:31:39 GMT
> Content...After a file is registered to the background knowledge, I can receive the 204 response on the next request, but there is no conetent as described in the README:
> HTTP/1.1 204 No Content
> Date: Mon, 16 Nov 2020 19:31:39 GMT
> Content-Type: text/plain; charset=UTF-8
> Connection: Keep-Alive
> Content-Length: 107Sebastian SeufertSebastian Seuferthttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/15No count in /bg response2020-11-23T15:26:03ZSyed Mamoon AhmedNo count in /bg responseFollowing is the response from /bg endpoint:
> HTTP/1.1 201 Created
> Date: Mon, 16 Nov 2020 19:26:06 GMT
> Content-Type: text/plain; charset=UTF-8
> Connection: Keep-Alive
> Content-Length: 72
>
> Content-type: application/json; chars...Following is the response from /bg endpoint:
> HTTP/1.1 201 Created
> Date: Mon, 16 Nov 2020 19:26:06 GMT
> Content-Type: text/plain; charset=UTF-8
> Connection: Keep-Alive
> Content-Length: 72
>
> Content-type: application/json; charset=UTF-8
>
> "Action: add, Details: 1"
As you can see, there is no count there. (Also, what is count anyway?)Sebastian SeufertSebastian Seuferthttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/13Bug in same_directory/22020-11-09T12:49:10ZSiebers, MichaelBug in same_directory/2The predicate same_directory/2 relies on in_directory/2. This produces a trailing slash on path names, which hinders matching of the absolute path name of the parent directory.
Why do unit tests for in_directory/1 and same_directory/2 p...The predicate same_directory/2 relies on in_directory/2. This produces a trailing slash on path names, which hinders matching of the absolute path name of the parent directory.
Why do unit tests for in_directory/1 and same_directory/2 pass?Siebers, MichaelSiebers, Michaelhttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/12Handle /explain2020-11-16T17:03:21ZSiebers, MichaelHandle /explain- [x] define helper for explanation generation
- [x] document expected input and output (for helper)
- [x] write unit tests (for helper)
- [x] implement functionality (in helper)
- [x] transform output to response- [x] define helper for explanation generation
- [x] document expected input and output (for helper)
- [x] write unit tests (for helper)
- [x] implement functionality (in helper)
- [x] transform output to responseSiebers, MichaelSiebers, Michaelhttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/11Handle /irrelevant/file2020-11-16T17:03:20ZSiebers, MichaelHandle /irrelevant/file- [x] define helper for irrelevant file detection
- [x] document expected input and output (for helper)
- [x] write unit tests (for helper)
- [x] implement functionality (in helper)
- [x] transform output to response- [x] define helper for irrelevant file detection
- [x] document expected input and output (for helper)
- [x] write unit tests (for helper)
- [x] implement functionality (in helper)
- [x] transform output to responseSiebers, MichaelSiebers, Michaelhttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/10Incorrect transmission of response content type2020-11-16T10:59:54ZSiebers, MichaelIncorrect transmission of response content type*Steps to reproduce*
- start the server
- place a POST request at /bg (or /clear) with arbitrary valid payload, e.g. `[{"type" : "directory","abs_path": "/A/B/","creation_time": 1604235509}]`
*Expected behavior*
Response with `Content...*Steps to reproduce*
- start the server
- place a POST request at /bg (or /clear) with arbitrary valid payload, e.g. `[{"type" : "directory","abs_path": "/A/B/","creation_time": 1604235509}]`
*Expected behavior*
Response with `Content-Type: application/json; charset=UTF-8` in headers and `"Action: add, Details: 2"` as payload.
*Observed behavior*
Response with `Content-Type: text/plain; charset=UTF-8` in headers and
```
Content-type: application/json; charset=UTF-8 [sic!]
"Action: add, Details: 2"
```
as payload.Sebastian SeufertSebastian Seuferthttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/9/clear fails with status code 500 when clearing an empty bg2020-11-16T13:09:34ZSiebers, Michael/clear fails with status code 500 when clearing an empty bg**Steps to reproduce**
- start the server
- place a POST request without payload at /clear
Can also be reproduced by first adding something to the bg and then clearing that twice.
**Expected behavior**
Fail gracefully, that is return...**Steps to reproduce**
- start the server
- place a POST request without payload at /clear
Can also be reproduced by first adding something to the bg and then clearing that twice.
**Expected behavior**
Fail gracefully, that is return 2xx status code.
**Observed behavior**
Server returns 500 Internal Server Error
*Error trace in PROLOG*
```
% [Thread httpd@4444_2] POST /clear: [500] goal unexpectedly failed: web_api:clear_bg([protocol(http),peer(ip(127,0,0,1)),pool(client('httpd@4444',web_api:http_dispatch,<stream>(0x7ff06c01a8e0),<stream>(0x7ff06c01aa70))),input(<stream>(0x7ff06c01a8e0)),method(post),request_uri('/clear'),path('/clear'),http_version(1-1),content_type('application/json'),user_agent('PostmanRuntime/7.26.5'),accept([media(_752/_754,[],1.0,[])]),postman_token('5eb7687c-b1e3-40d9-aa30-7b29f18623c3'),host(localhost),port(4444),accept_encoding('gzip, deflate, br'),connection('keep-alive'),content_length(434)])
In:
[19] throw(error(goal_failed(...),_864))
[18] http_dispatch:call_action(web_api:clear_bg,[protocol(http),...|...]) at /usr/lib/swi-prolog/library/http/http_dispatch.pl:772
[16] time:run_alarm_goal('<garbage_collected>','<garbage_collected>') at /usr/lib/swi-prolog/library/time.pl:145
[15] setup_call_catcher_cleanup(time:alarm(300,...,...,...),time:run_alarm_goal(...,...),_982,time:remove_alarm_notrace(...)) at /usr/lib/swi-prolog/boot/init.pl:443
[13] time:call_with_time_limit(300,'<garbage_collected>') at /usr/lib/swi-prolog/library/time.pl:136
[8] httpd_wrapper:call_handler('<garbage_collected>',1,'<garbage_collected>') at /usr/lib/swi-prolog/library/http/http_wrapper.pl:320
[7] catch(httpd_wrapper:call_handler(...,1,...),error(goal_failed(...),context(_1144,_1146)),httpd_wrapper:true) at /usr/lib/swi-prolog/boot/init.pl:371
[6] httpd_wrapper:handler_with_output_to(web_api:http_dispatch,1,'<garbage_collected>',current_output,error(goal_failed(...),context(_1210,_1212))) at /usr/lib/swi-prolog/library/http/http_wrapper.pl:297
[5] httpd_wrapper:handler_with_output_to('<garbage_collected>',1,'<garbage_collected>',<stream>(0x7ff06c01fd10),error(goal_failed(...),context(_1264,_1266))) at /usr/lib/swi-prolog/library/http/http_wrapper.pl:309
[4] httpd_wrapper:http_wrapper('<garbage_collected>',<stream>(0x7ff06c01a8e0),<stream>(0x7ff06c01aa70),_1302,'<garbage_collected>') at /usr/lib/swi-prolog/library/http/http_wrapper.pl:98
[3] thread_httpd:http_process('<garbage_collected>',<stream>(0x7ff06c01a8e0),<stream>(0x7ff06c01aa70),'<garbage_collected>') at /usr/lib/swi-prolog/library/http/thread_httpd.pl:778
[2] catch(thread_httpd:http_process(...,<stream>(0x7ff06c01a8e0),<stream>(0x7ff06c01aa70),...),_1366,thread_httpd:true) at /usr/lib/swi-prolog/boot/init.pl:371
[1] thread_httpd:http_worker([queue('httpd@4444'),...|...]) at /usr/lib/swi-prolog/library/http/thread_httpd.pl:554
[0] <meta call>
Note: some frames are missing due to last-call optimization.
Re-run your program in debug mode (:- debug.) to get more detail.
```Sebastian SeufertSebastian Seuferthttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/8Test common theory predicates2020-11-07T14:54:30ZSiebers, MichaelTest common theory predicatesTest whether the common theory predicates
- work,
- conform to type expectations, and
- are semi-deterministic, deterministic or non-deterministic as expected.Test whether the common theory predicates
- work,
- conform to type expectations, and
- are semi-deterministic, deterministic or non-deterministic as expected.Siebers, MichaelSiebers, Michaelhttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/7Change endpoints as in readme defined2020-11-07T16:45:25ZSebastian SeufertChange endpoints as in readme defined*"§=A!!! SWI-Documentation is wrong/old (GET/DELETE not working with a body),
hence all endpoints handling data parameters need to be changed to POST.
readme is the 'file of truth'*"§=A!!! SWI-Documentation is wrong/old (GET/DELETE not working with a body),
hence all endpoints handling data parameters need to be changed to POST.
readme is the 'file of truth'Sebastian SeufertSebastian Seuferthttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/4Design server responses for "unexplainable" atoms.2020-12-10T18:35:59ZSiebers, MichaelDesign server responses for "unexplainable" atoms.Currently, explain/4 succeeds only if the atom to explain is true and an explanation can be constructed. For the first part this is intended: if the atom is false an "explanation why this is true" does not make sense. However, what is th...Currently, explain/4 succeeds only if the atom to explain is true and an explanation can be constructed. For the first part this is intended: if the atom is false an "explanation why this is true" does not make sense. However, what is the desired server response in that case? It probably should not be a 500, since there is no server-side error as such. Maybe a 200 with no payload?
What about the second part? When no explanation can be constructed for a true atom this is indeed an error. However, this probably should only happen if the domain designer made a mistake (e.g., forgot an explanation template). So this is probably also no 500.
Both errors should be distinguishable by the client.Version 1.0Sebastian SeufertSebastian Seuferthttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/3Hand-over Brose-Version2020-11-07T22:11:02ZSiebers, MichaelHand-over Brose-VersionUte (and the student first using this version) should know where to find the code and how to use the software.Ute (and the student first using this version) should know where to find the code and how to use the software.Version 1.0https://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/2Define JSON scheme for API IO & Write Wiki2020-12-10T18:37:36ZSebastian SeufertDefine JSON scheme for API IO & Write WikiSebastian SeufertSebastian Seuferthttps://gitlab.rz.uni-bamberg.de/cogsys/dare2del/demonstrator/-/issues/1Harmonize predicate-naming into a template definition for multifile use2020-11-16T17:33:29ZSebastian SeufertHarmonize predicate-naming into a template definition for multifile useSebastian SeufertSebastian Seufert