Comments in a SPARQL query?

Can I write comments in a request so that only God, except me, remembers what I did?

I just started learning SPARQL, so forgive my ignorance.

For instance:

SELECT ?names WHERE { ?names dbo:award :Turing_Award // get names that won Turing award } 

which throws a parsing error.

A negative answer will also be accepted!

I am using the SPARQL endpoint for a DBpedia dataset at http://dbpedia.org/sparql .

+5
source share
1 answer

SPARQL 1.1 specification :

Comments in SPARQL queries take the form β€œ#”, outside the IRI or line and continue to the end of the line (marked with 0x0D or 0x0A) or the end of the file if there is no line end marker after the comment. Comments are treated as spaces.

Therefore, your SPARQL snippet example should read:

 SELECT ?names WHERE { ?names dbo:award :Turing_Award # get names that won Turing award } 
+11
source

Source: https://habr.com/ru/post/1237022/


All Articles