You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by GitBox <gi...@apache.org> on 2020/09/20 10:48:26 UTC

[GitHub] [jena-site] kinow commented on a change in pull request #22: Turtle writer options

kinow commented on a change in pull request #22:
URL: https://github.com/apache/jena-site/pull/22#discussion_r491678810



##########
File path: source/documentation/io/rdf-output.md
##########
@@ -240,7 +241,58 @@ but always writes one complete triple on one line (no use of `;`).
 | TURTLE_FLAT |
 | TRIG_FLAT   |
 
-### N-Triples and N-Quads
+### Turtle and Trig format options {#opt-turtle-trig}
+
+Some context settings affect the output of Turtle and TriG writers. Unless
+otherwise noted, the settign applies to both Turtle and TriG.
+
+| Context setting | Cmd line | Values |
+|-----------------|----------|--|
+| RIOT.symTurtleDirectiveStyle | "ttl:directiveStyle" | "sparql", "rdf11", "at", "n3" |
+| RIOT.symTurtleOmitBase       | "ttl:omitBase"       | "true", "false" |
+
+<p>&nbsp;</p>

Review comment:
       Ha, nice trick!

##########
File path: source/documentation/io/rdf-output.md
##########
@@ -240,7 +241,58 @@ but always writes one complete triple on one line (no use of `;`).
 | TURTLE_FLAT |
 | TRIG_FLAT   |
 
-### N-Triples and N-Quads
+### Turtle and Trig format options {#opt-turtle-trig}
+
+Some context settings affect the output of Turtle and TriG writers. Unless
+otherwise noted, the settign applies to both Turtle and TriG.

Review comment:
       s/the settign/the setting

##########
File path: source/documentation/io/rdf-output.md
##########
@@ -240,7 +241,58 @@ but always writes one complete triple on one line (no use of `;`).
 | TURTLE_FLAT |
 | TRIG_FLAT   |
 
-### N-Triples and N-Quads
+### Turtle and Trig format options {#opt-turtle-trig}
+
+Some context settings affect the output of Turtle and TriG writers. Unless
+otherwise noted, the settign applies to both Turtle and TriG.
+
+| Context setting | Cmd line | Values |
+|-----------------|----------|--|
+| RIOT.symTurtleDirectiveStyle | "ttl:directiveStyle" | "sparql", "rdf11", "at", "n3" |
+| RIOT.symTurtleOmitBase       | "ttl:omitBase"       | "true", "false" |
+
+<p>&nbsp;</p>
+
+| Directive Style | Effect |
+|------------------|-------|
+| "sparql", "rdf11"    | Use `PREFIX` and `BASE` in output.   |
+| "at", "n3"           | Use `@prefix` and `@base` in output. |
+| unset                | Use `@prefix` and `@base` in output. |
+
+<p>&nbsp;</b>
+
+#### Format Option Usage
+
+##### _Setting directive style_
+```
+    riot --set ttl:directiveStyle=sparql --pretty Turtle file1.rdf file2.nt ...
+```
+and in code:
+```
+  RDFWriter.create()
+     .set(RIOT.symTurtleDirectiveStyle, "sparql")
+     .lang(Lang.TTL)
+     .source(model)
+     .output(System.out);
+```
+##### _Base URI_
+
+Output can be written with relative URIs and no base. Note: such output is not
+portable; it's meaning depends on the base URI at the time of reading.

Review comment:
       s/it's/its




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org