index.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#>
  29. # Comment!
  30. SELECT ?given ?family
  31. WHERE {
  32. {
  33. ?annot a:annotates &lt;http://www.w3.org/TR/rdf-sparql-query/> .
  34. ?annot dc:creator ?c .
  35. OPTIONAL {?c foaf:givenName ?given ;
  36. foaf:familyName ?family }
  37. } UNION {
  38. ?c !foaf:knows/foaf:knows? ?thing.
  39. ?thing rdfs
  40. } MINUS {
  41. ?thing rdfs:label "剛柔流"@jp
  42. }
  43. FILTER isBlank(?c)
  44. }
  45. </textarea></form>
  46. <script>
  47. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  48. mode: "application/sparql-query",
  49. matchBrackets: true
  50. });
  51. </script>
  52. <p><strong>MIME types defined:</strong> <code>application/sparql-query</code>.</p>
  53. </article>