Many thanks for your patience, these are very useful details.
> Can you provide *repeatable examples*? Ideally, not using YASQE.
-- unfortunately not... but if I have the same problem, I'll try to
configure Jetty and/or Jena error handling (as Marco suggested) to get
some more information if I have time.
-- thanks for mentioning YASQE, I found the 'codemirror.js' file but
didn't know about Yasgui/Yasque.
> BTW *YASQE retains internal state like last query* (...) it seems
different ways to send request means they are different at Fuseki (e.g
Content-type).
-- So, let me translate in my newbie language : you mean that if my
/previous query/ has been parsed as 'query', the /next query string/
('update') is sent with the previous (wrong) content-type, and this
might be the cause of parse error? Therefore, nothing to do with special
characters. This sounds very interesting.
> If you are getting 400's from Fuseki (Bad request) the *HTTP
connection * is working just fine.
-- Good news (that's what I thought but wanted to be sure to understand)
Le 29/11/2018 à 12:47, Andy Seaborne a écrit :
On 29/11/2018 08:03, Vincent Ventresque wrote:
Thanks a lot for all these elements Andy.
However, I still don't understand /why the parser works most of the
time and fails sometimes/.
Can you provide repeatable examples? Ideally, not using YASQE.
(BTW YASQE retains internal state like last query). YASQE could do
with version upgrade if anyone wants to put in a PR.
As far as the information in this thread goes, it seems different ways
to send request means they are different at Fuseki (e.g Content-type).
Any clue about what's happening? I find it very strange that
re-typing the same query can solve the problem (I don't change
anything but the query string : the endpoint url is the same, etc).
Could it be linked to some http connection problem?
If you are getting 400's from Fuseki (Bad request) the HTTP connection
is working just fine.
Another point I'd like to understand : what is exactly the difference
between 'lexical error' and 'parse error' in Fuseki?
Examples?
Your txt file has "400 Parse error" sent back by Fuseki.
Le 29/11/2018 à 00:02, Andy Seaborne a écrit :
The /MyDataset/ is slightly magic.
Fuseki inspects the request and determines if it is a query or an
update.
It is a query if:
1/ The URL query string of the request URI has ?query= in it. (GET
or HTML form)
2/ The content type is application/sparql-query (POST)
and an update if:
3/ The URL update string is ?update= (GET or HTML form - GET wil be
bounced later on).
4/ The content type is application/sparql-update (POST)
The code is in ServiceRouter.chooseOperation(HttpAction,DataService)
It returns the determines operation which then is used to direct to
the request to the right code - query or update.
If sent to /query or /update the Fuseki knows it is a query or
update directly. There is still checking.
The logs shows the system the system detected the request as a
POSTed query (from YASQE - Fuseki uses a 3rd part SPARQL javascript
editor) because it logs "Query =" then parses it as query where
DELETE is not allowed.
This becomes more important at Fuseki 3.10 because the next version
supports access control so query vs update matters more.
s-update will send it as an update using POST with the right content
type.
This is not to do with browsers.
Andy
On 28/11/2018 20:13, Vincent Ventresque wrote:
Thanks Andy.
I don't understand : 'update' queries work in UI most of the time
(and when I re-write this 'delete' query, it works... Of course I
have to give http://localhost:3030/MyDataset or
http://localhost:3030/MyDataset/update as endpoint url (above
dialog box), not http://localhost:3030/MyDataset/query).
Besides, I'm not sure the problem didn't occur with 'select' or
other 'read-only' queries (I'll report the case if it happens).
BUT the error message (see here :
https://sourceforge.net/projects/ffl-misc/files/fuseki_strange_errors
) says
Encountered " "delete" "delete "" at line 19, column 1.
Was expecting one of:
"base" ...
"prefix" ...
"select" ...
"json" ...
"describe" ...
"construct" ...
"ask" ...
(7 ms)
and not 'delete', 'insert', so maybe the parser doesn't like
updates as you said.
-- Another case, maybe irrelevant for this problem, where I get
errors : I often try a query in the UI first, and then copy-paste
the string in a custom script to reuse it with command-line tools
(the script passes the query string to other scripts such as
s-query, tdbquery, s-update). I noticed that the 'auto-formatting'
(indentation, spaces, code folds, etc) in the UI dialog box inserts
'special characters' and sometimes I have to chop them to get the
script working. Maybe there's something wrong with a special
character in this 'delete' query too? (N.B. : I don't remember if
the error message is 'lexical error' or 'parse error' in this case)
-- a final point (don't know if it's relevant either) : I use only
Firefox, didn't try with other browsers. Do you think the problem
could be linked to javascript or some other piece of the web
interface in firefox (maybe a bug in firefox itself) ?
Le 28/11/2018 à 14:53, Andy Seaborne a écrit :
Vincent,
It's a parse because DELETE is SPARQL Update and the query editor
is for query. In SPARQL, they are different languages.
There is some way (IIRC) to use the UI with update but I can't
remember how - maybe someone else can answer that part.
Andy
On 28/11/2018 11:28, Vincent Ventresque wrote:
Hello,
Sometimes I have a '400 Parse error' when typing a query in
Fuseki UI.
-- Here, the query string 'delete {?s ?p ?o } where {?s ?p ?o }'
doesn't work at first. N.B.: I hadn't pasted the string from
other software, everything had been typed in the query dialog box.
-- If I change the string for a construct query (cut 'delete',
type 'construct' instead), it's ok. Then I cut 'construct' and
type 'delete' again, this time it works.
-- Nothing in log file
I get this error with fuseki 3.9.0 and 3.5.0.
I've uploaded a screenshot of the UI + a .txt file where you can
see the infos (install version, terminal output) :
https://sourceforge.net/projects/ffl-misc/files/fuseki_strange_errors
Do you have encountered this problem? Do you know where it comes
from?
Thanks in advance,
Vincent