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

Non-standard JSON format on query timeout #113

Closed
MaillPierre opened this issue Nov 10, 2022 · 0 comments
Closed

Non-standard JSON format on query timeout #113

MaillPierre opened this issue Nov 10, 2022 · 0 comments
Assignees

Comments

@MaillPierre
Copy link
Member

I obtain a non-JSON standard response when I send a query that timeout asking for a JSON response.

When querying the following :

PREFIX dcat: <http://www.w3.org/ns/dcat#>
        PREFIX void: <http://rdfs.org/ns/void#>
        ASK {
            SERVICE <http://prod-dekalog.inria.fr/sparql> {
                {
                    BIND(Iri(REPLACE(str(<http://prod-dekalog.inria.fr/sparql>), "http://", "https://")) AS ?endpointUrl)
                    { ?res a dcat:Dataset }
                    UNION { ?res a void:Dataset }
                    UNION { GRAPH ?g { ?res a dcat:Dataset } }
                    UNION { GRAPH ?g { ?res a void:Dataset } }
                    { ?res ?p <http://prod-dekalog.inria.fr/sparql> }
                    UNION { GRAPH ?g { ?res ?p ?endpointUrl } } .
                }
                UNION {
                    BIND(Iri(REPLACE(str(<http://prod-dekalog.inria.fr/sparql>), "https://", "http://")) AS ?endpointUrl)
                    { ?res a dcat:Dataset }
                    UNION { ?res a void:Dataset }
                    UNION { GRAPH ?g { ?res a dcat:Dataset } }
                    UNION { GRAPH ?g { ?res a void:Dataset } }
                    { ?res ?p <http://prod-dekalog.inria.fr/sparql> }
                    UNION { GRAPH ?g { ?res ?p ?endpointUrl } } .
                }
            }
        }

with format=json in the url query, I obtain the following response from the server:

{
<!--
PREFIX dcat: <http://www.w3.org/ns/dcat#>
        PREFIX void: <http://rdfs.org/ns/void#>
        ASK {
            SERVICE <http://prod-dekalog.inria.fr/sparql> {
                {
                    BIND(Iri(REPLACE(str(<http://prod-dekalog.inria.fr/sparql>), "http://", "https://")) AS ?endpointUrl)
                    { ?res a dcat:Dataset }
                    UNION { ?res a void:Dataset }
                    UNION { GRAPH ?g { ?res a dcat:Dataset } }
                    UNION { GRAPH ?g { ?res a void:Dataset } }
                    { ?res ?p <http://prod-dekalog.inria.fr/sparql> }
                    UNION { GRAPH ?g { ?res ?p ?endpointUrl } } .
                }
                UNION {
                    BIND(Iri(REPLACE(str(<http://prod-dekalog.inria.fr/sparql>), "https://", "http://")) AS ?endpointUrl)
                    { ?res a dcat:Dataset }
                    UNION { ?res a void:Dataset }
                    UNION { GRAPH ?g { ?res a dcat:Dataset } }
                    UNION { GRAPH ?g { ?res a void:Dataset } }
                    { ?res ?p <http://prod-dekalog.inria.fr/sparql> }
                    UNION { GRAPH ?g { ?res ?p ?endpointUrl } } .
                }
            }
        }

Service error: http://prod-dekalog.inria.fr/sparql
jakarta.ws.rs.ProcessingException: java.net.SocketTimeoutException: Read timed out
-->
"head": { } ,

"boolean" : false
}

The javascript JSON parser does not recognize this as proper JSON and throws an exception on the first <.

@MaillPierre MaillPierre changed the title Unexpected JSON format on query timeout Non-standard JSON format on query timeout Nov 10, 2022
@remiceres remiceres self-assigned this Nov 14, 2022
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