2
0

index.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CodeMirror: SPARQL mode</title>
  6. <link rel="stylesheet" href="../../lib/codemirror.css">
  7. <script src="../../lib/codemirror.js"></script>
  8. <script src="../../addon/edit/matchbrackets.js"></script>
  9. <script src="sparql.js"></script>
  10. <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  11. <link rel="stylesheet" href="../../doc/docs.css">
  12. </head>
  13. <body>
  14. <h1>CodeMirror: SPARQL mode</h1>
  15. <form><textarea id="code" name="code">
  16. PREFIX a: &lt;http://www.w3.org/2000/10/annotation-ns#>
  17. PREFIX dc: &lt;http://purl.org/dc/elements/1.1/>
  18. PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/>
  19. # Comment!
  20. SELECT ?given ?family
  21. WHERE {
  22. ?annot a:annotates &lt;http://www.w3.org/TR/rdf-sparql-query/> .
  23. ?annot dc:creator ?c .
  24. OPTIONAL {?c foaf:given ?given ;
  25. foaf:family ?family } .
  26. FILTER isBlank(?c)
  27. }
  28. </textarea></form>
  29. <script>
  30. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  31. mode: "application/x-sparql-query",
  32. tabMode: "indent",
  33. matchBrackets: true
  34. });
  35. </script>
  36. <p><strong>MIME types defined:</strong> <code>application/x-sparql-query</code>.</p>
  37. </body>
  38. </html>