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.

70 lines
2.4 KiB

7 months ago
  1. <!doctype html>
  2. <title>CodeMirror: N-Triples 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="ntriples.js"></script>
  8. <style>
  9. .CodeMirror {
  10. border: 1px solid #eee;
  11. height: auto;
  12. }
  13. </style>
  14. <div id=nav>
  15. <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
  16. <ul>
  17. <li><a href="../../index.html">Home</a>
  18. <li><a href="../../doc/manual.html">Manual</a>
  19. <li><a href="https://github.com/codemirror/codemirror5">Code</a>
  20. </ul>
  21. <ul>
  22. <li><a href="../index.html">Language modes</a>
  23. <li><a class=active href="#">N-Triples/N-Quads</a>
  24. </ul>
  25. </div>
  26. <article>
  27. <h2><a href="https://www.w3.org/TR/n-triples/">N-Triples</a> mode</h2>
  28. <p>The N-Triples mode also works well with on
  29. <a href="https://www.w3.org/TR/n-quads/">N-Quad</a> documents.
  30. </p>
  31. <form>
  32. <textarea id="ntriples" name="ntriples">
  33. <http://Sub1> <http://pred1> <http://obj> .
  34. <http://Sub2> <http://pred2#an2> "literal 1" .
  35. <http://Sub3#an3> <http://pred3> _:bnode3 .
  36. _:bnode4 <http://pred4> "literal 2"@lang .
  37. _:bnode5 <http://pred5> "literal 3"^^<http://type> .
  38. </textarea>
  39. </form>
  40. <script>
  41. var editor = CodeMirror.fromTextArea(document.getElementById("ntriples"), {});
  42. </script>
  43. <p><strong>MIME types defined:</strong> <code>application/n-triples</code>.</p>
  44. <hr />
  45. <p><a href="https://www.w3.org/TR/n-quads/">N-Quads</a> add a fourth
  46. element to the statement to track which graph the statement is from.
  47. Otherwise, it's identical to N-Triples.</p>
  48. <form>
  49. <textarea id="nquads" name="nquads">
  50. <http://Sub1> <http://pred1> <http://obj> <http://graph3> .
  51. <http://Sub2> <http://pred2#an2> "literal 1" <http://graph2> .
  52. <http://Sub3#an3> <http://pred3> _:bnode3 <http://graph2> .
  53. _:bnode4 <http://pred4> "literal 2"@lang <http://graph2> .
  54. # if a graph label
  55. _:bnode5 <http://pred5> "literal 3"^^<http://type> .
  56. </textarea>
  57. </form>
  58. <script>
  59. var nquads_editor = CodeMirror.fromTextArea(document.getElementById("nquads"), {});
  60. </script>
  61. <p><strong>MIME types defined:</strong> <code>application/n-quads</code>.</p>
  62. </article>