1rdfproc(1) General Commands Manual rdfproc(1)
2
3
4
6 rdfproc - Redland RDF processor utility
7
9 rdfproc [options] store-name command arg...
10
12 rdfproc test parse http://planetrdf.com/guide/rss.rdf
13 rdfproc test print
14 rdfproc test serialize ntriples
15
17 The rdfproc utility allows parsing, querying, manipulating and serial‐
18 izing of RDF content using the Redland RDF library. The store-name is
19 a Redland store name, typically a short identifier. The arguments to
20 command vary and are explained in section COMMANDS below.
21
23 rdfproc uses the usual GNU command line syntax, with long options
24 starting with two dashes (`-') if supported by the getopt_long func‐
25 tion. Otherwise the short options are only available.
26
27 -h, --help
28 Show a summary of the options.
29
30 -c, --contexts
31 Use a store with Redland contexts.
32
33 -n, --new
34 Make a new store, overwriting any existing one.
35
36 -o, --output FORMAT
37 Set the output FORMAT for sequences of triples, such as from a
38 search (find command) to a Redland serializer. At present the
39 alternatives are 'simple' (the default one if this option is
40 omitted), 'ntriples' or 'rdfxml'.
41
42 -p, --password
43 Read the storage option 'password' from standard input. Termi‐
44 nated by end of line ('\n') or end of file. This is equivalent
45 to setting it using -t or --storage-options but does not require
46 exposing the password in the argument list.
47
48 -r, --results FORMAT
49 Set the query results syntax format.
50
51 The exact list of formats depends on what libraptor(3) was built
52 with but is given correct in the usage message with -h.
53
54 -s, --storage TYPE
55 Set the Redland storage type (default 'hashes'). Alternatives
56 are 'memory' which is always present and '3store', 'file',
57 'mysql', 'sqlite', 'uri' when support for those is compiled in
58 If environment variable RDFPROC_STORAGE_TYPE is set, the storage
59 type given here will override it.
60
61 -t, --storage-options OPTIONS
62 Set options for the the Redland storage, default is "hash-
63 type='bdb',dir='.'" to match the default storage "hashes". For
64 storages types such as 'mysql' that need extra options this
65 would typically be something like "host='hostname',data‐
66 base='dbname',user='abc',password='pass'". If environment vari‐
67 able RDFPROC_STORAGE_OPTIONS is set, the storage options given
68 here will be applied afterwards.
69
70 -v, --version
71 Print the Redland version and exit.
72
74 Where a node is allowed, such as NODE, SUBJECT, PREDICATE or OBJECT
75 below, simple heuristics are used to guess which are blank node identi‐
76 fiers, URIs or literals (to add a statement with a literal, use add-
77 typed). If the item starts with _: then it is assumed to be a blank
78 node identifier, otherwise if it matches something:// it is assumed to
79 be a URI, otherwise it is a literal. Literals are only allowed as
80 objects of statements and blank nodes are not allowed as predicates.
81
82 add SUBJECT PREDICATE OBJECT [CONTEXT]
83 Add the given triple to graph, in the optional Redland context
84 if the CONTEXT node is given.
85
86
87 add-typed SUBJECT PREDICATE OBJECT OBJECT-LANG OBJECT-URI [CONTEXT]
88 Add the triple with the datatyped literal object to the graph,
89 in the optional Redland context if CONTEXT is given.
90
91
92 arc SUBJECT OBJECT
93
94 arcs SUBJECT OBJECT
95 Show one node/all nodes that match triples (SUBJECT, ?, OBJECT)
96
97
98 arcs-in NODE
99 Show all properties of triples with NODE as a subject.
100
101
102 arcs-out NODE
103 Show all properties of triples with NODE as an object.
104
105
106 contains SUBJECT PREDICATE OBJECT
107 Check if the given triple is in the graph.
108
109
110 contexts
111 List all the contexts in the graph (if contexts are enabled).
112
113
114 find SUBJECT|- PREDICATE|- OBJECT|- [CONTEXT]
115 Find matching triples to the given statement where - stands for
116 a blank that matches any node. If CONTEXT is given, only search
117 for triples in that context node.
118
119
120 has-arc-in NODE ARC
121 Check that there is a triple with NODE as a subject and ARC as a
122 predicate.
123
124
125 has-arc-out NODE ARC
126 Check that there is a triple with NODE as a object and ARC as a
127 predicate.
128
129
130 parse URI|FILENAME [SYNTAX| [BASE URI]]
131 Parse syntax at URI into the graph using SYNTAX which can be one
132 of rdfxml (RDF/XML, default), ntriples, turtle, rss-tag-soup
133 (for all RSS and Atoms), grddl and guess to use content hints
134 and protocol information to work it out. (This list changes
135 faster than this manual page) If FILENAME is a existing file,
136 the appropriate URI will be generated for it.
137
138
139 parse-stream URI|FILENAME [SYNTAX [BASE URI [CONTEXT]]
140 Streaming parse syntax at URI into the graph using SYNTAX which
141 can be one of rdfxml (RDF/XML, default) or ntriples. If FILE‐
142 NAME is an existing file, the appropriate URI will be generated
143 for it. If the optional CONTEXT URI is given, the triples are
144 added to that context.
145
146
147 print Print the graph triples in a simple format showing context nodes
148 if present.
149
150
151 query NAME|- URI|- QUERY-STRING
152 Run QUERY-STRING query in language NAME returning variable bind‐
153 ings, a boolean or RDF graph depending on the query. Query lan‐
154 guage can be 'sparql' or 'rdql'.
155
156
157 remove SUBJECT PREDICATE OBJECT [CONTEXT]
158 Remove the given triple graph, in the optional Redland context
159 if CONTEXT is given.
160
161
162 remove-context CONTEXT
163 Remove all triples in the graph with the Redland context CON‐
164 TEXT.
165
166
167 serialize [SYNTAX [URI [MIME-TYPE]]]
168 Serializes the graph to a syntax with a particular ISYNTAX URI
169 or Internet Media Type/MIME Type. The default is RDF/XML (NAME
170 "rdfxml", MIME Type "application/rdf/xml") if none of the above
171 are given. Other alternatives are "ntriples" (no MIME Type).
172
173
174 source PREDICATE OBJECT
175
176 sources PREDICATE OBJECT
177 Show one node/all nodes that match triples (?, PREDICATE,
178 OBJECT)
179
180
181 target SUBJECT PREDICATE
182
183 targets SUBJECT PREDICATE
184 Show one node/all nodes that match triples (SUBJECT, PREDICATE,
185 ?)
186
187
189 RDFPROC_STORAGE_OPTIONS can be set to provide storage options instead
190 of using the option -t, --storage-options OPTIONS. When both are
191 given, command options are applied last.
192
193 RDFPROC_STORAGE_TYPE can be set to provide a storage type instead of
194 using the option -s, --storage TYPE. When both are given, the storage
195 type from the command is used.
196
198 RDF/XML Syntax (Revised), W3C Recommendation, http://www.w3.org/TR/rdf-
199 syntax-grammar/ ⟨http://www.w3.org/TR/rdf-syntax-grammar/⟩
200
201 N-Triples, in RDF Test Cases, Jan Grant and Dave Beckett (eds.) W3C
202 Recommendation, http://www.w3.org/TR/rdf-testcases/#ntriples
203 ⟨http://www.w3.org/TR/rdf-testcases/#ntriples⟩
204
206 redland(3), libraptor(3), rapper(1)
207
209 Dave Beckett - http://purl.org/net/dajobe/
210 ⟨http://purl.org/net/dajobe/⟩
211
212
213
214 2007-02-17 rdfproc(1)