Property Name | Description | Value class | Legal Values |
---|---|---|---|
`xmlbase` | The value to be included for an xml:base attribute on the root element in the file. | `String` | A URI string, or null (default) |
`longId` | Whether to use long or short id's for anon resources. Short id's are easier to read and are the default, but can run out of memory on very large models. | `String` or `Boolean` | `"true"`, `"false"` (default) |
`allowBadURIs` | URIs in the graph are, by default, checked prior to serialization. | `String` or `Boolean` | `"true"`, `"false"` (default) |
`relativeURIs` | What sort of relative URIs should be used. A comma separated list of options:
- *same-document* same-document references (e.g. "" or "\#foo") - *network* network paths e.g. `"//example.org/foo"` omitting the URI scheme - *absolute* absolute paths e.g. `"/foo"` omitting the scheme and authority - *relative* relative path not beginning in `"../"` - *parent* relative path beginning in `"../"` - *grandparent* relative path begining in `"../../"` The default value is "same-document, absolute, relative, parent". To switch off relative URIs use the value "". Relative URIs of any of these types are output where possible if and only if the option has been specified. |
String | |
`showXmlDeclaration` | If true, an XML Declaration is included in the output, if false no XML declaration is included. The default behaviour only gives an XML Declaration when asked to write to an `OutputStreamWriter` that uses some encoding other than UTF-8 or UTF-16. In this case the encoding is shown in the XML declaration. To ensure that the encoding attribute is shown in the XML declaration either: - Set this option to true and use the `write(Model,Writer,String)` variant with an appropriate `OutputStreamWriter`. - Or set this option to false, and write the declaration to an `OutputStream` before calling `write(Model,OutputStream,String)`. | `true`, `"true"`, `false`, `"false"` or `"default"` | can be true, false or "default" (null) |
`showDoctypeDeclaration` | If true, an XML Doctype declaration is included in the output. This declaration includes a `!ENTITY` declaration for each prefix mapping in the model, and any attribute value that starts with the URI of that mapping is written as starting with the corresponding entity invocation. | `String` or `Boolean` | `true`, `false`, `"true"`, `"false"` |
`tab` | The number of spaces with which to indent XML child elements. | `String` or `Integer` | positive integer "2" is the default |
`attributeQuoteChar` | How to write XML attributes. | `String` | `"\""` or `"'"` |
`blockRules` | A list of `Resource` or a `String` being a comma separated list of fragment IDs from [http://www.w3.org/TR/rdf-syntax-grammar](http://www.w3.org/TR/rdf-syntax-grammar) indicating grammar rules that will not be used. Rules that can be blocked are: - [section-Reification](http://www.w3.org/TR/rdf-syntax-grammar#section-Reification) ([`RDFSyntax.sectionReification`](/documentation/javadoc/jena/org/apache/jena/vocabulary/RDFSyntax.html#sectionReification)) - [section-List-Expand](http://www.w3.org/TR/rdf-syntax-grammar#section-List-Expand) ([`RDFSyntax.sectionListExpand`](/documentation/javadoc/jena/org/apache/jena/vocabulary/RDFSyntax.html#sectionListExpand)) - [parseTypeLiteralPropertyElt](http://www.w3.org/TR/rdf-syntax-grammar#parseTypeLiteralPropertyElt) ([`RDFSyntax.parseTypeLiteralPropertyElt`](/documentation/javadoc/jena/org/apache/jena/vocabulary/RDFSyntax.html#parseTypeLiteralPropertyElt)) - [parseTypeResourcePropertyElt](http://www.w3.org/TR/rdf-syntax-grammar#parseTypeResourcePropertyElt) ([`RDFSyntax.parseTypeLiteralPropertyElt`](/documentation/javadoc/jena/org/apache/jena/vocabulary/RDFSyntax.html#parseTypeLiteralPropertyElt)) - [parseTypeCollectionPropertyElt](http://www.w3.org/TR/rdf-syntax-grammar#parseTypeCollectionPropertyElt) ([`RDFSyntax.parseTypeCollectionPropertyElt`](/documentation/javadoc/jena/org/apache/jena/vocabulary/RDFSyntax.html#parseTypeCollectionPropertyElt)) - [idAttr](http://www.w3.org/TR/rdf-syntax-grammar#idAttr) ([`RDFSyntax.idAttr`](/documentation/javadoc/jena/org/apache/jena/vocabulary/RDFSyntax.html#idAttr)) - [propertyAttr](http://www.w3.org/TR/rdf-syntax-grammar#propertyAttr) ([`RDFSyntax.propertyAttr`](/documentation/javadoc/jena/org/apache/jena/vocabulary/RDFSyntax.html#propertyAttr)) In addition `"daml:collection"` ([`DAML_OIL.collection`](/documentation/javadoc/jena/org/apache/jena/vocabulary/DAML_OIL.html#collection)) can be blocked. Blocking [idAttr](http://www.w3.org/TR/rdf-syntax-grammar#idAttr) also blocks [section-Reification](http://www.w3.org/TR/rdf-syntax-grammar#section-Reification). By default, rule [propertyAttr](http://www.w3.org/TR/rdf-syntax-grammar#propertyAttr) is blocked. For the basic writer (RDF/XML) only [parseTypeLiteralPropertyElt](http://www.w3.org/TR/rdf-syntax-grammar#parseTypeLiteralPropertyElt) has any effect, since none of the other rules are implemented by that writer. | `Resource[]` or `String` | |
`prettyTypes` | Only for the RDF/XML-ABBREV writer. This is a list of the types of the principal objects in the model. The writer will tend to create RDF/XML with resources of these types at the top level. | `Resource[]` |