summaryrefslogtreecommitdiffstats
path: root/docs/raptor-serializers.xml
blob: d18b905eac6f1285a806f2a2f66524b6f327a6a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" 
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<chapter id="raptor-serializers">
<title>Serializers in Raptor (triples to syntax)</title>

<section id="raptor-serializers-intro">
<title>Introduction</title>

<para>This section describes the serializers that can be compiled into
Raptor and their options.  The exact serializers supported may vary
by different builds of raptor and can be queried at run-time by use of the
<link linkend="raptor-world-get-serializer-description"><function>raptor_world_get_serializer_description</function></link>
function</para>

<para>The optional options that may be set on parsers can also
be queried at run-time with the 
<link linkend="raptor-world-get-option-description"><function>raptor_world_get_option_description</function></link>
function.</para>

</section>


<section id="serializer-atom">
<title>Atom 1.0 serializer (name <literal>atom</literal>)</title>

<para>A serializer to the Atom 1.0 syndication format defined in IETF
<ulink url="http://www.ietf.org/rfc/rfc4287.txt">RFC 4287</ulink>.
This serializes an RDF graph written in the RSS 1.0 data model
to Atom 1.0 plus optionally writes extra RDF triples.
</para>
<para>
The extra RDF triples are written into an at:md metadata block, along
with at:feedmap and at:entrymap elements to describe the RSS 1.0
predicate to Atom 1.0 elements mappings for the feed and entry blocks
respecively.  The extra triples are enabled when serializer option
'rssTriples' is set to string value 'atom-triples'.
</para>

<para>
If no atom triples content type field (at:contentType predicate) is
given, the type is set to 'text/html' when writing out an
atom:content field in Atom 1.0 format.
</para>

</section>


<section id="serializer-json">
<title>JSON serializers (name <literal>json</literal> and name <literal>json-triples</literal>)</title>

<para>Two serializers that write JSON in either a resource-centric
format with name <literal>json</literal> and in a triple-dump format
with name <literal>json-triples</literal>.  The resource-centric
format is based on the Talis
<ulink url="http://n2.talis.com/wiki/RDF_JSON_Specification">RDF/JSON</ulink>
design and the triple-dump format based on the SPARQL query results in JSON
design.
</para>

</section>


<section id="serializer-mkr">
<title>mKR serializer - default (name <literal>mkr</literal>)</title>

<para>A serializer for the
<ulink url="http://contextknowledgesystems.org/CKS.html">mKR (my Knowledge Representation) Language</ulink>
</para>

</section>


<section id="serializer-nquads">
<title>N-Quads serializer - default (name <literal>nquads</literal>)</title>

<para>A serializer to the
<ulink url="http://sw.deri.org/2008/07/n-quads/">N-Quads</ulink>
extension to N-Triples, providing an optional 4th context graph term
at the end of the line when a named graph is associated with a triple
(the triple is contained in a named graph).  This is useful for seeing the
output of named graphs or dealing with SPARQL Datasets.
</para>

</section>


<section id="serializer-ntriples">
<title>N-Triples serializer - default (name <literal>ntriples</literal>)</title>

<para>A serializer to the
<ulink url="http://www.w3.org/TR/rdf-testcases/#ntriples">N-Triples</ulink>
syntax as used by the 
<ulink url="http://www.w3.org/2001/sw/RDFCore/">W3C RDF Core working group</ulink>
for the <ulink url="http://www.w3.org/TR/rdf-testcases/">RDF Test Cases</ulink>.
</para>

</section>


<section id="serializer-rdfxml">
<title>RDF/XML serializer (name <literal>rdfxml</literal>)</title>

<para>A serializer to the standard
<ulink url="http://www.w3.org/TR/rdf-syntax-grammar/">RDF/XML syntax</ulink>
as revised by the
<ulink url="http://www.w3.org/2001/sw/RDFCore/">W3C RDF Core working group</ulink>.
This writes a plain triple-based RDF/XML serialization with no
optimisation or pretty-printing.
</para>

</section>


<section id="serializer-rdfxml-abbrev">
<title>RDF/XML (Abbreviated) serializer (name <literal>rdfxml-abbrev</literal>)</title>

<para>An RDF/XML serializer using several of the RDF/XML
abbreviations to provide a more compact readable format, at the cost
of some pre-processing.  This is suitable for small documents.
</para>

</section>


<section id="serializer-rdfxml-xmp">
<title>RDF/XML (XMP Profile) serializer (name <literal>rdfxml-xmp</literal>)</title>
<para>A serializer to the Adobe XMP profile of RDF/XML suitable for
embedding inside an external document.  Embedding means that the
XML header is omitted, wheras for other XML serializings, it is
always emitted.
</para>

</section>


<section id="serializer-turtle">
<title>Turtle serializer (name <literal>turtle</literal>)</title>
<para>A serializer for the
<ulink url="http://www.dajobe.org/2004/01/turtle/">Turtle Terse RDF Triple Language</ulink>
syntax, designed as a useful subset of
<ulink url="http://www.w3.org/DesignIssues/Notation3">Notation 3</ulink>.
</para>

</section>


<section id="serializer-rss-1-0">
<title>RSS 1.0 serializer (name <literal>rss-1.0</literal>)</title>
<para>A serializer to the
<ulink url="http://purl.org/rss/1.0/spec">RDF Site Summary (RSS) 1.0</ulink>
format for describing a syndication feed of items.
</para>

<para>By default this only serializes the RDF triples that describe
the RSS channel and items found.  If serialiser option 'rssTriples'
is set to value 'rdf-xml' then any additional triples found will
be included in the channel or item output.
</para>

</section>


<section id="serializer-dot">
<title>GraphViz dot serializer (name <literal>dot</literal>)</title>
<para>A serializer to the
<ulink url="http://www.graphviz.org/">GraphViz</ulink> DOT format.
</para>

<para>This serializer has a set of associated serializer options
that may be set to customise the output colors using
<link linkend="raptor-serializer-set-option"><function>raptor_serializer_set_option()</function></link>
with the appropriate option name and value as given below.
</para>

<programlisting>
RAPTOR_OPTION_RESOURCE_BORDER 	Border color of resource nodes
RAPTOR_OPTION_LITERAL_BORDER 	Border color of literal nodes
RAPTOR_OPTION_BNODE_BORDER 	Border color of blank nodes
RAPTOR_OPTION_RESOURCE_FILL 	Fill color of resource nodes
RAPTOR_OPTION_LITERAL_FILL 	Fill color of literal nodes
RAPTOR_OPTION_BNODE_FILL 	Fill color of blank nodes
</programlisting>


</section>


</chapter>

<!--
Local variables:
mode: sgml
sgml-parent-document: ("raptor-docs.xml" "book" "part")
End:
-->