1
0

index.html 1.2 KB

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