- All Superinterfaces:
RDFWriterI
- All Known Implementing Classes:
BaseXMLWriter
,RDFXML_Abbrev
,RDFXML_Basic
This interface only adds documentation to
RDFWriterI
.
The documentation identifies the properties that can be
set on RDF/XML and RDF/XML-ABBREV writers.-
Field Summary
Fields inherited from interface org.apache.jena.rdf.model.RDFWriterI
NSPREFIXPROPBASE
-
Method Summary
Modifier and TypeMethodDescriptionsetProperty
(String propName, Object propValue) Sets properties on this writer.Methods inherited from interface org.apache.jena.rdf.model.RDFWriterI
setErrorHandler, write, write
-
Method Details
-
setProperty
Sets properties on this writer.Properties to Control RDF/XML Output Property Name Description Value class Legal Values xmlbase The value for xml:base in the file as a string. 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 separate 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 begining in "../"
- parent
- relative path begining in "../"
- grandparent
- relative path begining in "../../"
String showXmlDeclaration - can be true, false or "default" (null)
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 use the write(Model,Writer,String)
variant with an appropriate OutputStreamWriter or set this option to false write the declaration to an OutputStream before callingwrite(Model,OutputStream,String)
.true, "true", false, "false" or "default" 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. Warning: experimental. 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 width A guide to the num of cols before inserting an arbitrary newline. String or Integer positive integer "60" 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 indicating grammar rules that will not be used. Rules that can be avoided are: - section-Reification (
RDFSyntax.sectionReification
) - section-List-Expand (
RDFSyntax.sectionListExpand
) - parseTypeLiteralPropertyElt
(
RDFSyntax.parseTypeLiteralPropertyElt
) - parseTypeResourcePropertyElt
(
RDFSyntax.parseTypeLiteralPropertyElt
) - parseTypeCollectionPropertyElt
(
RDFSyntax.parseTypeCollectionPropertyElt
) - idAttr
(
RDFSyntax.idAttr
) - propertyAttr
(
RDFSyntax.propertyAttr
)
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.
Example usage showing the default value:w.setProperty("prettyTypes", new Resource[]{ OWL.Ontology, OWL.Datatype, RDFS.Datatype, RDFS.Class, OWL.Class, OWL.ObjectProperty, RDF.Property, OWL.DatatypeProperty, OWL.TransitiveProperty, OWL.SymmetricProperty, OWL.FunctionalProperty, OWL.InverseFunctionalProperty, });
Resource[] - Specified by:
setProperty
in interfaceRDFWriterI
- Parameters:
propName
- One of "xmlBase", "longId", "allowBadURIs", "relativeURIs","showXMLDeclaration", "tab", "attributeQuoteChar", "blockRules", "prettyTypes", "showDoctypeDeclaration", "width"propValue
- A String, Boolean, Integer, Resource[] as appropriate.- Returns:
- the old value for this property, or
null
if no value was set.
-