I'm active in the SPARQL and DBPedia tags, so I have lots of opportunities to link to query results from the DBpedia SPARQL endpoint. If I have a query like the following (in which &&
appears), the link to the results is the following:
select * { ?x rdfs:label ?label . filter ( strlen(?label) = 5 && strlen(?label) = 5 ) } limit 1
http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=select+*+%7B+%3Fx+rdfs%3Alabel+%3Flabel+.+filter+%28+strlen%28%3Flabel%29+%3D+5+%26%26+strlen%28%3Flabel%29+%3D+5+%29+%7D+limit+1&format=text%2Fhtml&timeout=30000&debug=on
Using the [...](...)
link notation, I can make link with that URL that works without a problem. However, if I use the [...][2] ... [1]: ...
notation that's generated by using Control-L, the link doesn't take me to the query results, but rather to a syntax error about unbalanced parentheses.
bracket-parenthesis link
numbered link
The generated HTML source is:
<p><a href="http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=select+%2a+%7B+%3Fx+rdfs%3Alabel+%3Flabel+.+filter+%28+strlen%28%3Flabel%29+%3D+5+%26%26+strlen%28%3Flabel%29+%3D+5+%29+%7D+limit+1&format=text%2Fhtml&timeout=30000&debug=on" rel="nofollow">bracket-parenthesis link</a><br>
<a href="http://dbpedia.org/sparql?default-graph-uri=http://dbpedia.org&query=select%20%2a%20%7B%20?x%20rdfs%3alabel%20?label%20.%20filter%20%28%20strlen%28?label%29%20=%205%20&&%20strlen%28?label%29%20=%205%20%29%20%7D%20limit%201&format=text/html&timeout=30000&debug=on" rel="nofollow">numbered link</a></p>
Pulling the links from there, we can see that the URLs in the HTML source are different:
http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=select+%2a+%7B+%3Fx+rdfs%3Alabel+%3Flabel+.+filter+%28+strlen%28%3Flabel%29+%3D+5+%26%26+strlen%28%3Flabel%29+%3D+5+%29+%7D+limit+1&format=text%2Fhtml&timeout=30000&debug=on
http://dbpedia.org/sparql?default-graph-uri=http://dbpedia.org&query=select%20%2a%20%7B%20?x%20rdfs%3alabel%20?label%20.%20filter%20%28%20strlen%28?label%29%20=%205%20&&%20strlen%28?label%29%20=%205%20%29%20%7D%20limit%201&format=text/html&timeout=30000&debug=on
Shouldn't they be the same?
Related, but not the same
- It's not Markdown produces broken link.
- It doesn't appear to be Markdown not correctly generating links.
- It's closer to Links to URLs containing parentheses, which discusses escaping characters, but doesn't seem to be the same, because it doesn't address the differences between inline and numbered links.
- The title of Markdown editor bug for inline code links sounds relevant because of "inline", but it's about "inline code" not "inline (vs. numbered) links".