Theme Inspinia
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 1.5KB

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