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