SemWeb.RdfXmlWriter.Options

SemWeb : SemWeb Namespace
RdfXmlWriter.Options Class

This class specifies output style options for the SemWeb.RdfXmlWriter.

public class RdfXmlWriter.Options

#### Remarks

This class defines two static fields which have option settings for two common styles: SemWeb.RdfXmlWriter.Options.Full and SemWeb.RdfXmlWriter.Options.XMP. See the documentation for those fields for details.

## Members

See Also: Inherited members from object.

### Constructors

RdfXmlWriter.Options () This is the default public constructor.

### Fields

EmbedNamedNodes | bool . Sets whether named nodes (nodes with URIs) are embedded within property elements.
Full static | RdfXmlWriter.Options . An instance of Options specifying that all output options are turned on.
UseParseTypeLiteral | bool . Sets whether parseType=Literal is used for xsd:XMLLiteral values.
UsePredicateAttributes | bool . Sets whether predicate attributes may be used.
UseRdfID | bool . Sets whether the rdf:ID attribute is used to identify named nodes with URIs relative to the Base URI of the document, instead of an rdf:about attribute.
UseRdfLI | bool . Sets whether rdf:_nnn URIs are replaced with rdf:li.
UseTypedNodes | bool . Sets whether typed rdf:Description elements are allowed.
XMP static | RdfXmlWriter.Options . An instance of Options with only the options turned on supported by the Adobe XMP metadata format.

## Member Details

### RdfXmlWriter.Options Constructor

public RdfXmlWriter.Options ()

This is the default public constructor.

#### Remarks

None.

### EmbedNamedNodes Field

public bool EmbedNamedNodes

Sets whether named nodes (nodes with URIs) are embedded within property elements.

#### Remarks

When this field is `true`, the following output might be generated:

RDF/XML Example
    <rdf:Description>
       <ex:hasRelationTo>
          <rdf:Description rdf:about="http://www.example.org/">
             ...
          </rdf:Description>
       </ex:hasRelationTo>
    </rdf:Description>

But when this field is `false`, the following output would be generated instead:

RDF/XML Example
    <rdf:Description>
       <ex:hasRelationTo rdf:resource="http://www.example.org/"/>
    </rdf:Description>
    <rdf:Description rdf:about="http://www.example.org/">
       ...
    </rdf:Description>

### Full Field

public static RdfXmlWriter.Options Full

An instance of Options specifying that all output options are turned on.

#### Remarks

All of the instance fields in this object are `true`, providing general RDF/XML output with options to make the document more readable.

### UseParseTypeLiteral Field

public bool UseParseTypeLiteral

Sets whether parseType=Literal is used for xsd:XMLLiteral values.

#### Remarks

When this field is `true`, the following output might be generated:

RDF/XML Example
    <rdf:Description>
       <ex:hasContent rdf:parseType="Literal">
          <myContent>this is <b>my</b> content</myContent>
       </ex:hasContent>
    </rdf:Description>

But when this field is `false`, the following output would be generated instead:

RDF/XML Example
    <rdf:Description>
       <ex:hasContent>
          &lt;myContent&gt;this is &lt;b&gt;my&lt;/b&gt; content&lt;/myContent&gt;
       </ex:hasContent>
    </rdf:Description>

### UsePredicateAttributes Field

public bool UsePredicateAttributes

Sets whether predicate attributes may be used.

#### Remarks

When this field is `true`, the following output might be generated:

RDF/XML Example
    <foaf:Person>
       <foaf:knows foaf:firstname="John" foaf:lastname="Doe"/>
    </foaf:Person>

But when this field is `false`, the following output would be generated instead:

RDF/XML Example
    <foaf:Person>
       <foaf:knows>
          <rdf:Description>
             <foaf:firstname>John</foaf:firstname>
             <foaf:lastname>Doe</foaf:lastname>
          </rdf:Description>
       </foaf:knows>
    </foaf:Person>

### UseRdfID Field

public bool UseRdfID

Sets whether the rdf:ID attribute is used to identify named nodes with URIs relative to the Base URI of the document, instead of an rdf:about attribute.

#### Remarks

When this field is `true`, the following output might be generated:

RDF/XML Example
    <foaf:Person rdf:ID="John">
       ...
    </foaf:Person>

But when this field is `false`, the following output would be generated instead:

RDF/XML Example
    <foaf:Person rdf:about="http://www.example.org/baseURI#John">
       ...
    </foaf:Person>

### UseRdfLI Field

public bool UseRdfLI

Sets whether rdf:_nnn URIs are replaced with rdf:li.

#### Remarks

This field controls whether rdf:_nnn properties are written out as rdf:li. This field only has an effect when the rdf:_nnn properties are streamed into the RdfXmlWriter in numerical order.

When this field is `true`, the following output might be generated:

RDF/XML Example
    <rdf:Bag>
       <rdf:li rdf:resource="http://www.example.org/one"/>
       <rdf:li rdf:resource="http://www.example.org/two"/>
       <rdf:li rdf:resource="http://www.example.org/three"/>
    </rdf:Bag>

But when this field is `false`, the following output would be generated instead:

RDF/XML Example
    <rdf:Bag>
       <rdf:_1 rdf:resource="http://www.example.org/one"/>
       <rdf:_2 rdf:resource="http://www.example.org/two"/>
       <rdf:_3 rdf:resource="http://www.example.org/three"/>
    </rdf:Bag>

### UseTypedNodes Field

public bool UseTypedNodes

Sets whether typed rdf:Description elements are allowed.

#### Remarks

When this field is `true`, the following output might be generated:

RDF/XML Example
    <foaf:Person>
       ...
    </foaf:Person>

But when this field is `false`, the following output would be generated instead:

RDF/XML Example
    <rdf:Description>
       <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
       ...
    </rdf:Description>

### XMP Field

public static RdfXmlWriter.Options XMP

An instance of Options with only the options turned on supported by the Adobe XMP metadata format.

#### Remarks

The Adobe XMP format is a reduced version of RDF/XML used for embedding metadata in images and other files. This class turns off the output options of the RdfXmlWriter that are not supported in XMP. The UseTypedNodes, UseRdfID, UseParseTypeLiteral, and UsePredicateAttributes fields are set to `false`. The remaining fields are set to `true`.