You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on the Neo4j Discussion Forum instead of creating an issue here.
Expected Behavior (Mandatory)
With this query i get ans answer from wikidata:
WITH 'SELECT * WHERE { ?person wdt:P106 wd:Q10833314 ; rdfs:label "Nick Kyrgios"@en ; wdt:P569 ?dateOfBirth ; wdt:P27 [ rdfs:label ?countryName ] . filter(lang(?countryName) = "en")}' AS sparql
CALL apoc.load.jsonParams("https://query.wikidata.org/sparql?query=" + sparql,
{ Accept: "application/sparql-results+json"},
null
)
YIELD value
RETURN value
Actual Behavior (Mandatory)
If you put a newline in the SPARQL-part the query fails
WITH 'SELECT * WHERE {
?person wdt:P106 wd:Q10833314 ; rdfs:label "Nick Kyrgios"@en ; wdt:P569 ?dateOfBirth ; wdt:P27 [ rdfs:label ?countryName ] . filter(lang(?countryName) = "en")}' AS sparql
CALL apoc.load.jsonParams("https://query.wikidata.org/sparql?query=" + sparql,
{ Accept: "application/sparql-results+json"},
null
)
YIELD value
RETURN value
How to Reproduce the Problem
see above
Simple Dataset (where it's possibile)
//Insert here a set of Cypher statements that helps us to reproduce the problem
Steps (Mandatory)
Screenshots (where it's possibile)
Specifications (Mandatory)
Neo4j 4.3.6
Versions
OS: all
Neo4j: 4.3.6
Neo4j-Apoc: apoc-4.3.0.3.jar
The text was updated successfully, but these errors were encountered:
As a fast workaround, currently you could substitute "https://query.wikidata.org/sparql?query=" + sparql with this: replace("https://query.wikidata.org/sparql?query=" + sparql, "\n", "")
This is not bug. The argument of the query parameter needs to be url encoded for the URI to be a valid URI by the rules of the URI standard. URL encoding can be done with apoc.text.urlencode. This query runs fine:
WITH apoc.text.urlencode('SELECT * WHERE {
?person wdt:P106 wd:Q10833314 ; rdfs:label "Nick Kyrgios"@en ; wdt:P569 ?dateOfBirth ; wdt:P27 [ rdfs:label ?countryName ] . filter(lang(?countryName) = "en")}') AS sparql
CALL apoc.load.jsonParams("https://query.wikidata.org/sparql?query=" + sparql,
{ Accept: "application/sparql-results+json"},
null
)
YIELD value
RETURN value
Issue by kuczera
Friday Nov 26, 2021 at 17:38 GMT
Originally opened as neo4j-contrib/neo4j-apoc-procedures#2377
Guidelines
Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on the Neo4j Discussion Forum instead of creating an issue here.
Expected Behavior (Mandatory)
With this query i get ans answer from wikidata:
Actual Behavior (Mandatory)
If you put a newline in the SPARQL-part the query fails
How to Reproduce the Problem
see above
Simple Dataset (where it's possibile)
Steps (Mandatory)
Screenshots (where it's possibile)
Specifications (Mandatory)
Neo4j 4.3.6
Versions
The text was updated successfully, but these errors were encountered: