Neosemantics invalid input error

I was following a video "Using Public RDF Resources in Neo4j" on youTube and tried to run the query from the video in neosemantics app but I get an error

PREFIX neo: <neo://voc#>
CONSTRUCT{
	?virus a neo:Virus, neo:WikidataNode ; neo:name ?virusName ;
		neo:HAS_PARENT ?parentVirus ;
		neo:LINKS_TO_MS_ACADEMIC_FOS ?msAcademicUri ;
		neo:SAME_AS_DESCRIPTOR ?meshUri .
?parentVirus a neo:Virus .
}
WHERE {
 ?virus wdt:P171 + wd:Q808	;
	wdt:P171 ?parentVirus;
	rdfs:label ?virusName ;
	filter(lang(?virusName) = 'en') .

optional { ?virus wdt:P486 ?meshCode . 
		bind(URI(concat("http://id.nln.nih.gov/mesh/", ?meshCode)) as ?meshUri)}
optional { ?virus wdt:P6366 ?msAcademic . 
		bind(URI(concat("http://ma-graph.org/entity", ?msAcademic)) as ?msAcademicUri)}
} limit 5

Error Running Query
Invalid input ''': expected 'd/D' (line 2, column 587 (offset: 614)) " 'https://query.wikidata.org/sparql?query=PREFIX%20neo%3A%20<neo%3A%2F%2Fvoc%23> CONSTRUCT{ %3Fvirus%20a%20neo%3AVirus%2C%20neo%3AWikidataNode%20%3B%20neo%3Aname%20%3FvirusName%20%3B neo%3AHAS_PARENT%20%3FparentVirus%20%3B neo%3ALINKS_TO_MS_ACADEMIC_FOS%20%3FmsAcademicUri%20%3B neo%3ASAME_AS_DESCRIPTOR%20%3FmeshUri%20. %3FparentVirus%20a%20neo%3AVirus%20. } WHERE%20{ %20%3Fvirus%20wdt%3AP171%20%2B%20wd%3AQ808 %3B wdt%3AP171%20%3FparentVirus%3B rdfs%3Alabel%20%3FvirusName%20%3B filter(lang(%3FvirusName)%20%3D%20'en')%20.%0A%0Aoptional%20%7B%20%3Fvirus%20wdt%3AP486%20%3FmeshCode%20.%20%0A%09%09bind(URI(concat(%22http%3A%2F%2Fid.nln.nih.gov%2Fmesh%2F%22%2C%20%3FmeshCode))%20as%20%3FmeshUri)%7D%0Aoptional%20%7B%20%3Fvirus%20wdt%3AP6366%20%3FmsAcademic%20.%20%0A%09%09bind(URI(concat(%22http%3A%2F%2Fna-graph.org%2Fentity%22%2C%20%3FmsAcademic))%20as%20%3FmsAcademicUri)%7D%0A%7D%20limit%205%20'," ^

This query works perfectly fine in wikidata query service that's why I'm wondering what's the problem with running it in neosemantics.

EDIT:

When I run the same query in wikidata, copy Url and run it in neosemantics using Fetch from URL as RDF datasource everything works. But I still get the error when using a SPARQL query as a a datasource

Hi @maarriaa, nice catch :wink:

I've been trying it at my end and I've noticed that the n10s app is not escaping properly the single quotes. If you try the same query but using filter(lang(?virusName) = "en") . instead of the single-quoted version then it all works fine.

I've shared it with @adam.cowley to try and understand if there's a reason for the special treatment of single quotes.

Cheers,

JB

Thank you for the answer!