001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.jena; 014 015import java.util.*; 016 017import org.apache.juneau.jena.annotation.*; 018import org.apache.juneau.utils.*; 019import org.apache.juneau.xml.*; 020import org.apache.juneau.xml.annotation.*; 021 022/** 023 * Configurable properties common to both the {@link RdfSerializer} and {@link RdfParser} classes. 024 */ 025public interface RdfCommon { 026 027 /** 028 * Property prefix. 029 */ 030 static final String PREFIX = "RdfCommon."; 031 032 /** 033 * Maps RDF writer names to property prefixes that apply to them. 034 */ 035 static final Map<String,String> LANG_PROP_MAP = new AMap<String,String>() 036 .append("RDF/XML","rdfXml.") 037 .append("RDF/XML-ABBREV","rdfXml.") 038 .append("N3","n3.") 039 .append("N3-PP","n3.") 040 .append("N3-PLAIN","n3.") 041 .append("N3-TRIPLES","n3.") 042 .append("TURTLE","n3.") 043 .append("N-TRIPLE","ntriple."); 044 045 /** 046 * Configuration property: RDF language. 047 * 048 * <h5 class='section'>Property:</h5> 049 * <ul> 050 * <li><b>Name:</b> <js>"Rdf.language.s"</js> 051 * <li><b>Data type:</b> <code>String</code> 052 * <li><b>Default:</b> <js>"RDF/XML-ABBREV"</js> 053 * <li><b>Methods:</b> 054 * <ul> 055 * <li class='jm'>{@link RdfSerializerBuilder#language(String)} 056 * <li class='jm'>{@link RdfSerializerBuilder#n3()} 057 * <li class='jm'>{@link RdfSerializerBuilder#ntriple()} 058 * <li class='jm'>{@link RdfSerializerBuilder#turtle()} 059 * <li class='jm'>{@link RdfSerializerBuilder#xml()} 060 * <li class='jm'>{@link RdfSerializerBuilder#xmlabbrev()} 061 * <li class='jm'>{@link RdfParserBuilder#language(String)} 062 * <li class='jm'>{@link RdfParserBuilder#n3()} 063 * <li class='jm'>{@link RdfParserBuilder#ntriple()} 064 * <li class='jm'>{@link RdfParserBuilder#turtle()} 065 * <li class='jm'>{@link RdfParserBuilder#xml()} 066 * </ul> 067 * </ul> 068 * 069 * <h5 class='section'>Description:</h5> 070 * <p> 071 * Can be any of the following: 072 * <ul class='spaced-list'> 073 * <li> 074 * <js>"RDF/XML"</js> 075 * <li> 076 * <js>"RDF/XML-ABBREV"</js> (default) 077 * <li> 078 * <js>"N-TRIPLE"</js> 079 * <li> 080 * <js>"N3"</js> - General name for the N3 writer. 081 * Will make a decision on exactly which writer to use (pretty writer, plain writer or simple writer) when 082 * created. 083 * Default is the pretty writer but can be overridden with system property 084 * <code>com.hp.hpl.jena.n3.N3JenaWriter.writer</code>. 085 * <li> 086 * <js>"N3-PP"</js> - Name of the N3 pretty writer. 087 * The pretty writer uses a frame-like layout, with prefixing, clustering like properties and embedding 088 * one-referenced bNodes. 089 * <li> 090 * <js>"N3-PLAIN"</js> - Name of the N3 plain writer. 091 * The plain writer writes records by subject. 092 * <li> 093 * <js>"N3-TRIPLES"</js> - Name of the N3 triples writer. 094 * This writer writes one line per statement, like N-Triples, but does N3-style prefixing. 095 * <li> 096 * <js>"TURTLE"</js> - Turtle writer. 097 * http://www.dajobe.org/2004/01/turtle/ 098 * </ul> 099 */ 100 public static final String RDF_language = PREFIX + "language.s"; 101 102 /** 103 * Configuration property: XML namespace for Juneau properties. 104 * 105 * <h5 class='section'>Property:</h5> 106 * <ul> 107 * <li><b>Name:</b> <js>"Rdf.juneauNs.s"</js> 108 * <li><b>Data type:</b> {@link Namespace} 109 * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneau/'</js>}</code> 110 * <li><b>Methods:</b> 111 * <ul> 112 * <li class='jm'>{@link RdfSerializerBuilder#juneauNs(Namespace)} 113 * <li class='jm'>{@link RdfParserBuilder#juneauNs(Namespace)} 114 * </ul> 115 * </ul> 116 */ 117 public static final String RDF_juneauNs = PREFIX + "juneauNs.s"; 118 119 /** 120 * Configuration property: Default XML namespace for bean properties. 121 * 122 * <h5 class='section'>Property:</h5> 123 * <ul> 124 * <li><b>Name:</b> <js>"Rdf.juneauBpNs.s"</js> 125 * <li><b>Data type:</b> {@link Namespace} 126 * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneaubp/'</js>}</code> 127 * <li><b>Methods:</b> 128 * <ul> 129 * <li class='jm'>{@link RdfSerializerBuilder#juneauBpNs(Namespace)} 130 * <li class='jm'>{@link RdfParserBuilder#juneauBpNs(Namespace)} 131 * </ul> 132 * </ul> 133 */ 134 public static final String RDF_juneauBpNs = PREFIX + "juneauBpNs.s"; 135 136 /** 137 * Configuration property: Reuse XML namespaces when RDF namespaces not specified. 138 * 139 * <h5 class='section'>Property:</h5> 140 * <ul> 141 * <li><b>Name:</b> <js>"Rdf.useXmlNamespaces.b"</js> 142 * <li><b>Data type:</b> <code>Boolean</code> 143 * <li><b>Default:</b> <jk>true</jk> 144 * <li><b>Methods:</b> 145 * <ul> 146 * <li class='jm'>{@link RdfSerializerBuilder#useXmlNamespaces(boolean)} 147 * <li class='jm'>{@link RdfParserBuilder#useXmlNamespaces(boolean)} 148 * </ul> 149 * </ul> 150 * 151 * <h5 class='section'>Description:</h5> 152 * <p> 153 * When specified, namespaces defined using {@link XmlNs @XmlNs} and {@link Xml @Xml} will be inherited by the RDF serializers. 154 * Otherwise, namespaces will be defined using {@link RdfNs @RdfNs} and {@link Rdf @Rdf}. 155 */ 156 public static final String RDF_useXmlNamespaces = PREFIX + "useXmlNamespaces.b"; 157 158 /** 159 * Configuration property: RDF/XML property: <code>iri_rules</code>. 160 * 161 * <h5 class='section'>Property:</h5> 162 * <ul> 163 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.iri-rules.s"</js> 164 * <li><b>Data type:</b> <code>String</code> 165 * <li><b>Default:</b> <js>"lax"</js> 166 * </ul> 167 * 168 * <h5 class='section'>Description:</h5> 169 * <p> 170 * Set the engine for checking and resolving. 171 * 172 * <p> 173 * Possible values: 174 * <ul class='spaced-list'> 175 * <li> 176 * <js>"lax"</js> - The rules for RDF URI references only, which does permit spaces although the use of spaces 177 * is not good practice. 178 * <li> 179 * <js>"strict"</js> - Sets the IRI engine with rules for valid IRIs, XLink and RDF; it does not permit spaces 180 * in IRIs. 181 * <li> 182 * <js>"iri"</js> - Sets the IRI engine to IRI 183 * (<a class="doclink" href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>, 184 * <a class="doclink" href="http://www.ietf.org/rfc/rfc3987.txt">RFC 3987</a>). 185 * </ul> 186 */ 187 public static final String RDF_arp_iriRules = PREFIX + "jena.rdfXml.iri-rules.s"; 188 189 /** 190 * Configuration property: RDF/XML ARP property: <code>error-mode</code>. 191 * 192 * <h5 class='section'>Property:</h5> 193 * <ul> 194 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.error-mode.s"</js> 195 * <li><b>Data type:</b> <code>String</code> 196 * <li><b>Default:</b> <js>"lax"</js> 197 * </ul> 198 * 199 * <h5 class='section'>Description:</h5> 200 * <p> 201 * This allows a coarse-grained approach to control of error handling. 202 * 203 * <p> 204 * Possible values: 205 * <ul> 206 * <li><js>"default"</js> 207 * <li><js>"lax"</js> 208 * <li><js>"strict"</js> 209 * <li><js>"strict-ignore"</js> 210 * <li><js>"strict-warning"</js> 211 * <li><js>"strict-error"</js> 212 * <li><js>"strict-fatal"</js> 213 * </ul> 214 * 215 * <p> 216 * See also: 217 * <ul class='spaced-list'> 218 * <li> 219 * <a class="doclink" href="http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setDefaultErrorMode()">ARPOptions.setDefaultErrorMode()</a> 220 * <li> 221 * <a class="doclink" href="http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setLaxErrorMode()">ARPOptions.setLaxErrorMode()</a> 222 * <li> 223 * <a class="doclink" href="http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setStrictErrorMode()">ARPOptions.setStrictErrorMode()</a> 224 * <li> 225 * <a class="doclink" href="http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setStrictErrorMode(int)">ARPOptions.setStrictErrorMode(int)</a> 226 * </ul> 227 */ 228 public static final String RDF_arp_errorMode = PREFIX + "jena.rdfXml.error-mode.s"; 229 230 /** 231 * Configuration property: RDF/XML ARP property: <code>embedding</code>. 232 * 233 * <h5 class='section'>Property:</h5> 234 * <ul> 235 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.embedding.b"</js> 236 * <li><b>Data type:</b> <code>Boolean</code> 237 * <li><b>Default:</b> <jk>false</jk> 238 * </ul> 239 * 240 * <h5 class='section'>Description:</h5> 241 * <p> 242 * Sets ARP to look for RDF embedded within an enclosing XML document. 243 * 244 * <p> 245 * See also: 246 * <ul class='spaced-list'> 247 * <li> 248 * <a class="doclink" href="http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setEmbedding(boolean)">ARPOptions.setEmbedding(boolean)</a> 249 * </ul> 250 */ 251 public static final String RDF_arp_embedding = PREFIX + "jena.rdfXml.embedding.b"; 252 253 /** 254 * Configuration property: RDF/XML ARP property: <code>ERR_xxx</code>. 255 * 256 * <h5 class='section'>Property:</h5> 257 * <ul> 258 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.ERR_"</js> 259 * <li><b>Data type:</b> <code>String</code> 260 * </ul> 261 * 262 * <h5 class='section'>Description:</h5> 263 * <p> 264 * Provides fine-grained control over detected error conditions. 265 * 266 * <p> 267 * Possible values: 268 * <ul> 269 * <li><js>"EM_IGNORE"</js> 270 * <li><js>"EM_WARNING"</js> 271 * <li><js>"EM_ERROR"</js> 272 * <li><js>"EM_FATAL"</js> 273 * </ul> 274 * 275 * <p> 276 * See also: 277 * <ul class='spaced-list'> 278 * <li> 279 * <a class="doclink" href="http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPErrorNumbers.html">ARPErrorNumbers</a> 280 * <li> 281 * <a class="doclink" href="http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setErrorMode(int,%20int)">ARPOptions.setErrorMode(int, int)</a> 282 * </ul> 283 */ 284 public static final String RDF_arp_err_ = PREFIX + "jena.rdfXml.ERR_"; 285 286 /** 287 * Configuration property: RDF/XML ARP property: <code>WARN_xxx</code>. 288 * 289 * <h5 class='section'>Property:</h5> 290 * <ul> 291 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.WARN_"</js> 292 * <li><b>Data type:</b> <code>String</code> 293 * </ul> 294 * 295 * <h5 class='section'>Description:</h5> 296 * <p> 297 * See {@link #RDF_arp_err_} for details. 298 */ 299 public static final String RDF_arp_warn_ = PREFIX + "jena.rdfXml.WARN_"; 300 301 /** 302 * RDF/XML ARP property: <code>IGN_xxx</code>. 303 * 304 * <h5 class='section'>Property:</h5> 305 * <ul> 306 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.IGN_"</js> 307 * <li><b>Data type:</b> <code>String</code> 308 * </ul> 309 * 310 * <h5 class='section'>Description:</h5> 311 * <p> 312 * See {@link #RDF_arp_err_} for details. 313 */ 314 public static final String RDF_arp_ign_ = PREFIX + "jena.rdfXml.IGN_"; 315 316 /** 317 * Configuration property: RDF/XML property: <code>xmlbase</code>. 318 * 319 * <h5 class='section'>Property:</h5> 320 * <ul> 321 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.xmlbase.s"</js> 322 * <li><b>Data type:</b> <code>String</code> 323 * <li><b>Default:</b> <jk>null</jk> 324 * </ul> 325 * 326 * <h5 class='section'>Description:</h5> 327 * <p> 328 * The value to be included for an <xa>xml:base</xa> attribute on the root element in the file. 329 */ 330 public static final String RDF_rdfxml_xmlBase = PREFIX + "jena.rdfXml.xmlbase.s"; 331 332 /** 333 * Configuration property: RDF/XML property: <code>longId</code>. 334 * 335 * <h5 class='section'>Property:</h5> 336 * <ul> 337 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.longId.b"</js> 338 * <li><b>Data type:</b> <code>Boolean</code> 339 * <li><b>Default:</b> <jk>false</jk> 340 * </ul> 341 * 342 * <h5 class='section'>Description:</h5> 343 * <p> 344 * Whether to use long ID's for anon resources. 345 * Short ID's are easier to read, but can run out of memory on very large models. 346 */ 347 public static final String RDF_rdfxml_longId = PREFIX + "jena.rdfXml.longId.b"; 348 349 /** 350 * Configuration property: RDF/XML property: <code>allowBadURIs</code>. 351 * 352 * <h5 class='section'>Property:</h5> 353 * <ul> 354 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.allowBadURIs.b"</js> 355 * <li><b>Data type:</b> <code>Boolean</code> 356 * <li><b>Default:</b> <jk>false</jk> 357 * </ul> 358 * 359 * <h5 class='section'>Description:</h5> 360 * <p> 361 * URIs in the graph are, by default, checked prior to serialization. 362 */ 363 public static final String RDF_rdfxml_allowBadUris = PREFIX + "jena.rdfXml.allowBadURIs.b"; 364 365 /** 366 * Configuration property: RDF/XML property: <code>relativeURIs</code>. 367 * 368 * <h5 class='section'>Property:</h5> 369 * <ul> 370 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.relativeURIs.s"</js> 371 * <li><b>Data type:</b> <code>String</code> 372 * <li><b>Default:</b> <js>"same-document, absolute, relative, parent"</js> 373 * </ul> 374 * 375 * <h5 class='section'>Description:</h5> 376 * <p> 377 * What sort of relative URIs should be used. 378 * 379 * <p> 380 * A comma separate list of options: 381 * <ul class='spaced-list'> 382 * <li> 383 * <js>"same-document"</js> - Same-document references (e.g. <js>""</js> or <js>"#foo"</js>) 384 * <li> 385 * <js>"network"</js> - Network paths (e.g. <js>"//example.org/foo"</js> omitting the URI scheme) 386 * <li> 387 * <js>"absolute"</js> - Absolute paths (e.g. <js>"/foo"</js> omitting the scheme and authority) 388 * <li> 389 * <js>"relative"</js> - Relative path not beginning in <js>"../"</js> 390 * <li> 391 * <js>"parent"</js> - Relative path beginning in <js>"../"</js> 392 * <li> 393 * <js>"grandparent"</js> - Relative path beginning in <js>"../../"</js> 394 * </ul> 395 * 396 * <p> 397 * The default value is <js>"same-document, absolute, relative, parent"</js>. 398 * To switch off relative URIs use the value <js>""</js>. 399 * Relative URIs of any of these types are output where possible if and only if the option has been specified. 400 */ 401 public static final String RDF_rdfxml_relativeUris = PREFIX + "jena.rdfXml.relativeURIs.s"; 402 403 /** 404 * Configuration property: RDF/XML property: <code>showXmlDeclaration</code>. 405 * 406 * <h5 class='section'>Property:</h5> 407 * <ul> 408 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.showXmlDeclaration.s"</js> 409 * <li><b>Data type:</b> <code>String</code> 410 * <li><b>Default:</b> <js>"default"</js> 411 * </ul> 412 * 413 * <h5 class='section'>Description:</h5> 414 * <p> 415 * Possible values: 416 * <ul class='spaced-list'> 417 * <li> 418 * <js>"true"</js> - Add XML Declaration to the output. 419 * <li> 420 * <js>"false"</js> - Don't add XML Declaration to the output. 421 * <li> 422 * <js>"default"</js> - Only add an XML Declaration when asked to write to an <code>OutputStreamWriter</code> 423 * that uses some encoding other than <code>UTF-8</code> or <code>UTF-16</code>. 424 * In this case the encoding is shown in the XML declaration. 425 * </ul> 426 */ 427 public static final String RDF_rdfxml_showXmlDeclaration = PREFIX + "jena.rdfXml.showXmlDeclaration.s"; 428 429 /** 430 * Configuration property: RDF/XML property: <code>showDoctypeDeclaration</code>. 431 * 432 * <h5 class='section'>Property:</h5> 433 * <ul> 434 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.showDoctypeDeclaration.b"</js> 435 * <li><b>Data type:</b> <code>Boolean</code> 436 * <li><b>Default:</b> <jk>true</jk> 437 * </ul> 438 * 439 * <h5 class='section'>Description:</h5> 440 * <p> 441 * If true, an XML doctype declaration is included in the output. 442 * This declaration includes a <code>!ENTITY</code> declaration for each prefix mapping in the model, and any 443 * attribute value that starts with the URI of that mapping is written as starting with the corresponding entity 444 * invocation. 445 */ 446 public static final String RDF_rdfxml_showDoctypeDeclaration = PREFIX + "jena.rdfXml.showDoctypeDeclaration.b"; 447 448 /** 449 * Configuration property: RDF/XML property: <code>tab</code>. 450 * 451 * <h5 class='section'>Property:</h5> 452 * <ul> 453 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.tab.i"</js> 454 * <li><b>Data type:</b> <code>Integer</code> 455 * <li><b>Default:</b> <code>2</code> 456 * </ul> 457 * 458 * <h5 class='section'>Description:</h5> 459 * <p> 460 * The number of spaces with which to indent XML child elements. 461 */ 462 public static final String RDF_rdfxml_tab = PREFIX + "jena.rdfXml.tab.i"; 463 464 /** 465 * Configuration property: RDF/XML property: <code>attributeQuoteChar</code>. 466 * 467 * <h5 class='section'>Property:</h5> 468 * <ul> 469 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.attributeQuoteChar.s"</js> 470 * <li><b>Data type:</b> <code>Character</code> 471 * <li><b>Default:</b> <js>'"'</js> 472 * </ul> 473 * 474 * <h5 class='section'>Description:</h5> 475 * <p> 476 * The XML attribute quote character. 477 */ 478 public static final String RDF_rdfxml_attributeQuoteChar = PREFIX + "jena.rdfXml.attributeQuoteChar.s"; 479 480 /** 481 * Configuration property: RDF/XML property: <code>blockRules</code>. 482 * 483 * <h5 class='section'>Property:</h5> 484 * <ul> 485 * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.blockRules.s"</js> 486 * <li><b>Data type:</b> <code>String</code> 487 * <li><b>Default:</b> <js>""</js> 488 * </ul> 489 * 490 * <h5 class='section'>Description:</h5> 491 * <p> 492 * A list of <code>Resource</code> or a <code>String</code> being a comma separated list of fragment IDs from 493 * <a class="doclink" href="http://www.w3.org/TR/rdf-syntax-grammar">RDF Syntax Grammar</a> indicating grammar 494 * rules that will not be used. 495 */ 496 public static final String RDF_rdfxml_blockRules = PREFIX + "jena.rdfXml.blockRules.s"; 497 498 /** 499 * Configuration property: N3/Turtle property: <code>minGap</code>. 500 * 501 * <h5 class='section'>Property:</h5> 502 * <ul> 503 * <li><b>Name:</b> <js>"Rdf.jena.n3.minGap.i"</js> 504 * <li><b>Data type:</b> <code>Integer</code> 505 * <li><b>Default:</b> <code>1</code> 506 * </ul> 507 * 508 * <h5 class='section'>Description:</h5> 509 * <p> 510 * Minimum gap between items on a line. 511 */ 512 public static final String RDF_n3_minGap = PREFIX + "jena.n3.minGap.i"; 513 514 /** 515 * Configuration property: N3/Turtle property: <code>objectLists</code>. 516 * 517 * <h5 class='section'>Property:</h5> 518 * <ul> 519 * <li><b>Name:</b> <js>"Rdf.jena.n3.objectLists.b"</js> 520 * <li><b>Data type:</b> <code>Boolean</code> 521 * <li><b>Default:</b> <jk>true</jk> 522 * </ul> 523 * 524 * <h5 class='section'>Description:</h5> 525 * <p> 526 * Print object lists as comma separated lists. 527 */ 528 public static final String RDF_n3_objectLists = PREFIX + "jena.n3.objectLists.b"; 529 530 /** 531 * Configuration property: N3/Turtle property: <code>subjectColumn</code>. 532 * 533 * <h5 class='section'>Property:</h5> 534 * <ul> 535 * <li><b>Name:</b> <js>"Rdf.jena.n3.subjectColumn.i"</js> 536 * <li><b>Data type:</b> <code>Integer</code> 537 * <li><b>Default:</b> indentProperty 538 * </ul> 539 * 540 * <h5 class='section'>Description:</h5> 541 * <p> 542 * If the subject is shorter than this value, the first property may go on the same line. 543 */ 544 public static final String RDF_n3_subjectColumn = PREFIX + "jena.n3.subjectColumn.i"; 545 546 /** 547 * Configuration property: N3/Turtle property: <code>propertyColumn</code>. 548 * 549 * <h5 class='section'>Property:</h5> 550 * <ul> 551 * <li><b>Name:</b> <js>"Rdf.jena.n3.propertyColumn.i"</js> 552 * <li><b>Data type:</b> <code>Integer</code> 553 * <li><b>Default:</b> <code>8</code> 554 * </ul> 555 * 556 * <h5 class='section'>Description:</h5> 557 * <p> 558 * Width of the property column. 559 */ 560 public static final String RDF_n3_propertyColumn = PREFIX + "jena.n3.propertyColumn.i"; 561 562 /** 563 * Configuration property: N3/Turtle property: <code>indentProperty</code>. 564 * 565 * <h5 class='section'>Property:</h5> 566 * <ul> 567 * <li><b>Name:</b> <js>"Rdf.jena.n3.indentProperty.i"</js> 568 * <li><b>Data type:</b> <code>Integer</code> 569 * <li><b>Default:</b> <code>6</code> 570 * </ul> 571 * 572 * <h5 class='section'>Description:</h5> 573 * <p> 574 * Width to indent properties. 575 */ 576 public static final String RDF_n3_indentProperty = PREFIX + "jena.n3.indentProperty.i"; 577 578 /** 579 * Configuration property: N3/Turtle property: <code>widePropertyLen</code>. 580 * 581 * <h5 class='section'>Property:</h5> 582 * <ul> 583 * <li><b>Name:</b> <js>"Rdf.jena.n3.widePropertyLen.i"</js> 584 * <li><b>Data type:</b> <code>Integer</code> 585 * <li><b>Default:</b> <code>20</code> 586 * </ul> 587 * 588 * <h5 class='section'>Description:</h5> 589 * <p> 590 * Width of the property column. 591 * Must be longer than <code>propertyColumn</code>. 592 */ 593 public static final String RDF_n3_widePropertyLen = PREFIX + "jena.n3.widePropertyLen.i"; 594 595 /** 596 * Configuration property: N3/Turtle property: <code>abbrevBaseURI</code>. 597 * 598 * <h5 class='section'>Property:</h5> 599 * <ul> 600 * <li><b>Name:</b> <js>"Rdf.jena.n3.abbrevBaseURI.b"</js> 601 * <li><b>Data type:</b> <code>Boolean</code> 602 * <li><b>Default:</b> <jk>true</jk> 603 * </ul> 604 * 605 * <h5 class='section'>Description:</h5> 606 * <p> 607 * Control whether to use abbreviations <code><></code> or <code><#></code>. 608 */ 609 public static final String RDF_n3_abbrevBaseUri = PREFIX + "jena.n3.abbrevBaseURI.b"; 610 611 /** 612 * Configuration property: N3/Turtle property: <code>usePropertySymbols</code>. 613 * 614 * <h5 class='section'>Property:</h5> 615 * <ul> 616 * <li><b>Name:</b> <js>"Rdf.jena.n3.usePropertySymbols.b"</js> 617 * <li><b>Data type:</b> <code>Boolean</code> 618 * <li><b>Default:</b> <jk>true</jk> 619 * </ul> 620 * 621 * <h5 class='section'>Description:</h5> 622 * <p> 623 * Control whether to use <code>a</code>, <code>=</code> and <code>=></code> in output 624 */ 625 public static final String RDF_n3_usePropertySymbols = PREFIX + "jena.n3.usePropertySymbols.b"; 626 627 /** 628 * Configuration property: N3/Turtle property: <code>useTripleQuotedStrings</code>. 629 * 630 * <h5 class='section'>Property:</h5> 631 * <ul> 632 * <li><b>Name:</b> <js>"Rdf.jena.n3.useTripleQuotedStrings.b"</js> 633 * <li><b>Data type:</b> <code>Boolean</code> 634 * <li><b>Default:</b> <jk>true</jk> 635 * </ul> 636 * 637 * <h5 class='section'>Description:</h5> 638 * <p> 639 * Allow the use of <code>"""</code> to delimit long strings. 640 */ 641 public static final String RDF_n3_useTripleQuotedStrings = PREFIX + "jena.n3.useTripleQuotedStrings.b"; 642 643 /** 644 * Configuration property: N3/Turtle property: <code>useDoubles</code>. 645 * 646 * <h5 class='section'>Property:</h5> 647 * <ul> 648 * <li><b>Name:</b> <js>"Rdf.jena.n3.useDoubles.b"</js> 649 * <li><b>Data type:</b> <code>Boolean</code> 650 * <li><b>Default:</b> <jk>true</jk> 651 * </ul> 652 * 653 * <h5 class='section'>Description:</h5> 654 * <p> 655 * Allow the use doubles as <code>123.456</code>. 656 */ 657 public static final String RDF_n3_useDoubles = PREFIX + "jena.n3.useDoubles.b"; 658 659 /** 660 * Configuration property: RDF format for representing collections and arrays. 661 * 662 * <h5 class='section'>Property:</h5> 663 * <ul> 664 * <li><b>Name:</b> <js>"Rdf.collectionFormat.s"</js> 665 * <li><b>Data type:</b> <code>String</code> 666 * <li><b>Default:</b> <js>"DEFAULT"</js> 667 * <li><b>Methods:</b> 668 * <ul> 669 * <li class='jm'>{@link RdfSerializerBuilder#collectionFormat(RdfCollectionFormat)} 670 * <li class='jm'>{@link RdfParserBuilder#collectionFormat(RdfCollectionFormat)} 671 * </ul> 672 * </ul> 673 * 674 * <h5 class='section'>Description:</h5> 675 * <p> 676 * Possible values: 677 * <ul class='spaced-list'> 678 * <li> 679 * <js>"DEFAULT"</js> - Default format. The default is an RDF Sequence container. 680 * <li> 681 * <js>"SEQ"</js> - RDF Sequence container. 682 * <li> 683 * <js>"BAG"</js> - RDF Bag container. 684 * <li> 685 * <js>"LIST"</js> - RDF List container. 686 * <li> 687 * <js>"MULTI_VALUED"</js> - Multi-valued properties. 688 * </ul> 689 * 690 * <h5 class='section'>Notes:</h5> 691 * <ul class='spaced-list'> 692 * <li> 693 * If you use <js>"BAG"</js> or <js>"MULTI_VALUED"</js>, the order of the elements in the collection will get 694 * lost. 695 * </ul> 696 */ 697 public static final String RDF_collectionFormat = PREFIX + "collectionFormat.s"; 698 699 /** 700 * Configuration property: Collections should be serialized and parsed as loose collections. 701 * 702 * <h5 class='section'>Property:</h5> 703 * <ul> 704 * <li><b>Name:</b> <js>"Rdf.looseCollections.b"</js> 705 * <li><b>Data type:</b> <code>Boolean</code> 706 * <li><b>Default:</b> <jk>false</jk> 707 * <li><b>Methods:</b> 708 * <ul> 709 * <li class='jm'>{@link RdfSerializerBuilder#looseCollections(boolean)} 710 * <li class='jm'>{@link RdfSerializerBuilder#looseCollections()} 711 * <li class='jm'>{@link RdfParserBuilder#looseCollections(boolean)} 712 * <li class='jm'>{@link RdfParserBuilder#looseCollections()} 713 * </ul> 714 * </ul> 715 * 716 * <h5 class='section'>Description:</h5> 717 * <p> 718 * When specified, collections of resources are handled as loose collections of resources in RDF instead of 719 * resources that are children of an RDF collection (e.g. Sequence, Bag). 720 * 721 * <p> 722 * Note that this setting is specialized for RDF syntax, and is incompatible with the concept of 723 * losslessly representing POJO models, since the tree structure of these POJO models are lost 724 * when serialized as loose collections. 725 * 726 * <p> 727 * This setting is typically only useful if the beans being parsed into do not have a bean property 728 * annotated with {@link Rdf#beanUri @Rdf(beanUri=true)}. 729 * 730 * <h5 class='section'>Example:</h5> 731 * <p class='bcode'> 732 * WriterSerializer s = RdfSerializer.<jsm>create</jsm>().xmlabbrev().looseCollections(<jk>true</jk>).build(); 733 * ReaderParser p = RdfParser.<jsm>create</jsm>().xml().looseCollections(<jk>true</jk>).build(); 734 * 735 * List<MyBean> l = createListOfMyBeans(); 736 * 737 * <jc>// Serialize to RDF/XML as loose resources</jc> 738 * String rdfXml = s.serialize(l); 739 * 740 * <jc>// Parse back into a Java collection</jc> 741 * l = p.parse(rdfXml, LinkedList.<jk>class</jk>, MyBean.<jk>class</jk>); 742 * 743 * MyBean[] b = createArrayOfMyBeans(); 744 * 745 * <jc>// Serialize to RDF/XML as loose resources</jc> 746 * String rdfXml = s.serialize(b); 747 * 748 * <jc>// Parse back into a bean array</jc> 749 * b = p.parse(rdfXml, MyBean[].<jk>class</jk>); 750 * </p> 751 */ 752 public static final String RDF_looseCollections = PREFIX + "looseCollections.b"; 753}