annotate win32-mingw/include/sord-0/sord/sord.h @ 8:c29fa680fb5a

Add sord, serd
author Chris Cannam
date Wed, 20 Mar 2013 15:23:43 +0000
parents
children
rev   line source
Chris@8 1 /*
Chris@8 2 Copyright 2011-2013 David Robillard <http://drobilla.net>
Chris@8 3
Chris@8 4 Permission to use, copy, modify, and/or distribute this software for any
Chris@8 5 purpose with or without fee is hereby granted, provided that the above
Chris@8 6 copyright notice and this permission notice appear in all copies.
Chris@8 7
Chris@8 8 THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
Chris@8 9 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
Chris@8 10 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
Chris@8 11 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
Chris@8 12 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
Chris@8 13 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
Chris@8 14 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Chris@8 15 */
Chris@8 16
Chris@8 17 /**
Chris@8 18 @file sord.h API for Sord, a lightweight RDF model library.
Chris@8 19 */
Chris@8 20
Chris@8 21 #ifndef SORD_SORD_H
Chris@8 22 #define SORD_SORD_H
Chris@8 23
Chris@8 24 #include <stddef.h>
Chris@8 25 #include <stdint.h>
Chris@8 26 #include <stdio.h>
Chris@8 27
Chris@8 28 #include "serd/serd.h"
Chris@8 29
Chris@8 30 #ifdef SORD_SHARED
Chris@8 31 # ifdef _WIN32
Chris@8 32 # define SORD_LIB_IMPORT __declspec(dllimport)
Chris@8 33 # define SORD_LIB_EXPORT __declspec(dllexport)
Chris@8 34 # else
Chris@8 35 # define SORD_LIB_IMPORT __attribute__((visibility("default")))
Chris@8 36 # define SORD_LIB_EXPORT __attribute__((visibility("default")))
Chris@8 37 # endif
Chris@8 38 # ifdef SORD_INTERNAL
Chris@8 39 # define SORD_API SORD_LIB_EXPORT
Chris@8 40 # else
Chris@8 41 # define SORD_API SORD_LIB_IMPORT
Chris@8 42 # endif
Chris@8 43 #else
Chris@8 44 # define SORD_API
Chris@8 45 #endif
Chris@8 46
Chris@8 47 #ifdef __cplusplus
Chris@8 48 extern "C" {
Chris@8 49 #else
Chris@8 50 # include <stdbool.h>
Chris@8 51 #endif
Chris@8 52
Chris@8 53 /**
Chris@8 54 @defgroup sord Sord
Chris@8 55 A lightweight RDF model library.
Chris@8 56
Chris@8 57 Sord stores RDF (subject object predicate context) quads, where the context
Chris@8 58 may be omitted (to represent triples in the default graph).
Chris@8 59 @{
Chris@8 60 */
Chris@8 61
Chris@8 62 /**
Chris@8 63 Sord World.
Chris@8 64 The World represents all library state, including interned strings.
Chris@8 65 */
Chris@8 66 typedef struct SordWorldImpl SordWorld;
Chris@8 67
Chris@8 68 /**
Chris@8 69 Sord Model.
Chris@8 70
Chris@8 71 A model is an indexed set of Quads (i.e. it can contain several RDF
Chris@8 72 graphs). It may be searched using various patterns depending on which
Chris@8 73 indices are enabled.
Chris@8 74 */
Chris@8 75 typedef struct SordModelImpl SordModel;
Chris@8 76
Chris@8 77 /**
Chris@8 78 Model Inserter.
Chris@8 79
Chris@8 80 An inserter is used for writing statements to a model using the Serd sink
Chris@8 81 interface. This makes it simple to write to a model directly using a
Chris@8 82 SerdReader, or any other code that writes statements to a SerdStatementSink.
Chris@8 83 */
Chris@8 84 typedef struct SordInserterImpl SordInserter;
Chris@8 85
Chris@8 86 /**
Chris@8 87 Model Iterator.
Chris@8 88 */
Chris@8 89 typedef struct SordIterImpl SordIter;
Chris@8 90
Chris@8 91 /**
Chris@8 92 RDF Node.
Chris@8 93 A Node is a component of a Quad. Nodes may be URIs, blank nodes, or
Chris@8 94 (in the case of quad objects only) string literals. Literal nodes may
Chris@8 95 have an associate language or datatype (but not both).
Chris@8 96 */
Chris@8 97 typedef struct SordNodeImpl SordNode;
Chris@8 98
Chris@8 99 /**
Chris@8 100 Quad of nodes (a statement), or a quad pattern.
Chris@8 101
Chris@8 102 Nodes are ordered (S P O G). The ID of the default graph is 0.
Chris@8 103 */
Chris@8 104 typedef const SordNode* SordQuad[4];
Chris@8 105
Chris@8 106 /**
Chris@8 107 Index into a SordQuad.
Chris@8 108 */
Chris@8 109 typedef enum {
Chris@8 110 SORD_SUBJECT = 0, /**< Subject */
Chris@8 111 SORD_PREDICATE = 1, /**< Predicate (a.k.a. "key") */
Chris@8 112 SORD_OBJECT = 2, /**< Object (a.k.a. "value") */
Chris@8 113 SORD_GRAPH = 3 /**< Graph (a.k.a. "context") */
Chris@8 114 } SordQuadIndex;
Chris@8 115
Chris@8 116 /**
Chris@8 117 Type of a node.
Chris@8 118 */
Chris@8 119 typedef enum {
Chris@8 120 SORD_URI = 1, /**< URI */
Chris@8 121 SORD_BLANK = 2, /**< Blank node identifier */
Chris@8 122 SORD_LITERAL = 3 /**< Literal (string with optional lang or datatype) */
Chris@8 123 } SordNodeType;
Chris@8 124
Chris@8 125 /**
Chris@8 126 Indexing option.
Chris@8 127 */
Chris@8 128 typedef enum {
Chris@8 129 SORD_SPO = 1, /**< Subject, Predicate, Object */
Chris@8 130 SORD_SOP = 1 << 1, /**< Subject, Object, Predicate */
Chris@8 131 SORD_OPS = 1 << 2, /**< Object, Predicate, Subject */
Chris@8 132 SORD_OSP = 1 << 3, /**< Object, Subject, Predicate */
Chris@8 133 SORD_PSO = 1 << 4, /**< Predicate, Subject, Object */
Chris@8 134 SORD_POS = 1 << 5 /**< Predicate, Object, Subject */
Chris@8 135 } SordIndexOption;
Chris@8 136
Chris@8 137 /**
Chris@8 138 @name World
Chris@8 139 @{
Chris@8 140 */
Chris@8 141
Chris@8 142 /**
Chris@8 143 Create a new Sord World.
Chris@8 144 It is safe to use multiple worlds in one process, though no data
Chris@8 145 (e.g. nodes) can be shared between worlds, and this should be avoided if
Chris@8 146 possible for performance reasons.
Chris@8 147 */
Chris@8 148 SORD_API
Chris@8 149 SordWorld*
Chris@8 150 sord_world_new(void);
Chris@8 151
Chris@8 152 /**
Chris@8 153 Free @c world.
Chris@8 154 */
Chris@8 155 SORD_API
Chris@8 156 void
Chris@8 157 sord_world_free(SordWorld* world);
Chris@8 158
Chris@8 159 /**
Chris@8 160 Set a function to be called when errors occur.
Chris@8 161
Chris@8 162 The @p error_sink will be called with @p handle as its first argument. If
Chris@8 163 no error function is set, errors are printed to stderr.
Chris@8 164 */
Chris@8 165 SORD_API
Chris@8 166 void
Chris@8 167 sord_world_set_error_sink(SordWorld* world,
Chris@8 168 SerdErrorSink error_sink,
Chris@8 169 void* handle);
Chris@8 170
Chris@8 171 /**
Chris@8 172 @}
Chris@8 173 @name Node
Chris@8 174 @{
Chris@8 175 */
Chris@8 176
Chris@8 177 /**
Chris@8 178 Get a URI node from a string.
Chris@8 179
Chris@8 180 Note this function measures @c str, which is a common bottleneck.
Chris@8 181 Use sord_node_from_serd_node instead if @c str is already measured.
Chris@8 182 */
Chris@8 183 SORD_API
Chris@8 184 SordNode*
Chris@8 185 sord_new_uri(SordWorld* world, const uint8_t* uri);
Chris@8 186
Chris@8 187 /**
Chris@8 188 Get a URI node from a relative URI string.
Chris@8 189 */
Chris@8 190 SORD_API
Chris@8 191 SordNode*
Chris@8 192 sord_new_relative_uri(SordWorld* world,
Chris@8 193 const uint8_t* str,
Chris@8 194 const uint8_t* base_uri);
Chris@8 195
Chris@8 196 /**
Chris@8 197 Get a blank node from a string.
Chris@8 198
Chris@8 199 Note this function measures @c str, which is a common bottleneck.
Chris@8 200 Use sord_node_from_serd_node instead if @c str is already measured.
Chris@8 201 */
Chris@8 202 SORD_API
Chris@8 203 SordNode*
Chris@8 204 sord_new_blank(SordWorld* world, const uint8_t* str);
Chris@8 205
Chris@8 206 /**
Chris@8 207 Get a literal node from a string.
Chris@8 208
Chris@8 209 Note this function measures @c str, which is a common bottleneck.
Chris@8 210 Use sord_node_from_serd_node instead if @c str is already measured.
Chris@8 211 */
Chris@8 212 SORD_API
Chris@8 213 SordNode*
Chris@8 214 sord_new_literal(SordWorld* world,
Chris@8 215 SordNode* datatype,
Chris@8 216 const uint8_t* str,
Chris@8 217 const char* lang);
Chris@8 218
Chris@8 219 /**
Chris@8 220 Copy a node (obtain a reference).
Chris@8 221
Chris@8 222 Node that since nodes are interned and reference counted, this does not
Chris@8 223 actually create a deep copy of @c node.
Chris@8 224 */
Chris@8 225 SORD_API
Chris@8 226 SordNode*
Chris@8 227 sord_node_copy(const SordNode* node);
Chris@8 228
Chris@8 229 /**
Chris@8 230 Free a node (drop a reference).
Chris@8 231 */
Chris@8 232 SORD_API
Chris@8 233 void
Chris@8 234 sord_node_free(SordWorld* world, SordNode* node);
Chris@8 235
Chris@8 236 /**
Chris@8 237 Return the type of a node (SORD_URI, SORD_BLANK, or SORD_LITERAL).
Chris@8 238 */
Chris@8 239 SORD_API
Chris@8 240 SordNodeType
Chris@8 241 sord_node_get_type(const SordNode* node);
Chris@8 242
Chris@8 243 /**
Chris@8 244 Return the string value of a node.
Chris@8 245 */
Chris@8 246 SORD_API
Chris@8 247 const uint8_t*
Chris@8 248 sord_node_get_string(const SordNode* node);
Chris@8 249
Chris@8 250 /**
Chris@8 251 Return the string value of a node, and set @c len to its length.
Chris@8 252 */
Chris@8 253 SORD_API
Chris@8 254 const uint8_t*
Chris@8 255 sord_node_get_string_counted(const SordNode* node, size_t* len);
Chris@8 256
Chris@8 257 /**
Chris@8 258 Return the language of a literal node (or NULL).
Chris@8 259 */
Chris@8 260 SORD_API
Chris@8 261 const char*
Chris@8 262 sord_node_get_language(const SordNode* node);
Chris@8 263
Chris@8 264 /**
Chris@8 265 Return the datatype URI of a literal node (or NULL).
Chris@8 266 */
Chris@8 267 SORD_API
Chris@8 268 SordNode*
Chris@8 269 sord_node_get_datatype(const SordNode* node);
Chris@8 270
Chris@8 271 /**
Chris@8 272 Return the flags (string attributes) of a node.
Chris@8 273 */
Chris@8 274 SORD_API
Chris@8 275 SerdNodeFlags
Chris@8 276 sord_node_get_flags(const SordNode* node);
Chris@8 277
Chris@8 278 /**
Chris@8 279 Return true iff node can be serialised as an inline object.
Chris@8 280
Chris@8 281 More specifically, this returns true iff the node is the object field
Chris@8 282 of exactly one statement, and therefore can be inlined since it needn't
Chris@8 283 be referred to by name.
Chris@8 284 */
Chris@8 285 SORD_API
Chris@8 286 bool
Chris@8 287 sord_node_is_inline_object(const SordNode* node);
Chris@8 288
Chris@8 289 /**
Chris@8 290 Return true iff @c a is equal to @c b.
Chris@8 291
Chris@8 292 Note this is much faster than comparing the node's strings.
Chris@8 293 */
Chris@8 294 SORD_API
Chris@8 295 bool
Chris@8 296 sord_node_equals(const SordNode* a,
Chris@8 297 const SordNode* b);
Chris@8 298
Chris@8 299 /**
Chris@8 300 Return a SordNode as a SerdNode.
Chris@8 301
Chris@8 302 The returned node is shared and must not be freed or modified.
Chris@8 303 */
Chris@8 304 SORD_API
Chris@8 305 const SerdNode*
Chris@8 306 sord_node_to_serd_node(const SordNode* node);
Chris@8 307
Chris@8 308 /**
Chris@8 309 Create a new SordNode from a SerdNode.
Chris@8 310
Chris@8 311 The returned node must be freed using sord_node_free.
Chris@8 312 */
Chris@8 313 SORD_API
Chris@8 314 SordNode*
Chris@8 315 sord_node_from_serd_node(SordWorld* world,
Chris@8 316 SerdEnv* env,
Chris@8 317 const SerdNode* node,
Chris@8 318 const SerdNode* datatype,
Chris@8 319 const SerdNode* lang);
Chris@8 320
Chris@8 321 /**
Chris@8 322 @}
Chris@8 323 @name Model
Chris@8 324 @{
Chris@8 325 */
Chris@8 326
Chris@8 327 /**
Chris@8 328 Create a new model.
Chris@8 329
Chris@8 330 @param world The world in which to make this model.
Chris@8 331
Chris@8 332 @param indices SordIndexOption flags (e.g. SORD_SPO|SORD_OPS). Be sure to
Chris@8 333 enable an index where the most significant node(s) are not variables in your
Chris@8 334 queries (e.g. to make (? P O) queries, enable either SORD_OPS or SORD_POS).
Chris@8 335
Chris@8 336 @param graphs If true, store (and index) graph contexts.
Chris@8 337 */
Chris@8 338 SORD_API
Chris@8 339 SordModel*
Chris@8 340 sord_new(SordWorld* world,
Chris@8 341 unsigned indices,
Chris@8 342 bool graphs);
Chris@8 343
Chris@8 344 /**
Chris@8 345 Close and free @c model.
Chris@8 346 */
Chris@8 347 SORD_API
Chris@8 348 void
Chris@8 349 sord_free(SordModel* model);
Chris@8 350
Chris@8 351 /**
Chris@8 352 Get the world associated with @c model.
Chris@8 353 */
Chris@8 354 SORD_API
Chris@8 355 SordWorld*
Chris@8 356 sord_get_world(SordModel* model);
Chris@8 357
Chris@8 358 /**
Chris@8 359 Return the number of nodes stored in @c world.
Chris@8 360
Chris@8 361 Nodes are included in this count iff they are a part of a quad in @c world.
Chris@8 362 */
Chris@8 363 SORD_API
Chris@8 364 size_t
Chris@8 365 sord_num_nodes(const SordWorld* world);
Chris@8 366
Chris@8 367 /**
Chris@8 368 Return the number of quads stored in @c model.
Chris@8 369 */
Chris@8 370 SORD_API
Chris@8 371 size_t
Chris@8 372 sord_num_quads(const SordModel* model);
Chris@8 373
Chris@8 374 /**
Chris@8 375 Return an iterator to the start of @c model.
Chris@8 376 */
Chris@8 377 SORD_API
Chris@8 378 SordIter*
Chris@8 379 sord_begin(const SordModel* model);
Chris@8 380
Chris@8 381 /**
Chris@8 382 Search for statements by a quad pattern.
Chris@8 383 @return an iterator to the first match, or NULL if no matches found.
Chris@8 384 */
Chris@8 385 SORD_API
Chris@8 386 SordIter*
Chris@8 387 sord_find(SordModel* model, const SordQuad pat);
Chris@8 388
Chris@8 389 /**
Chris@8 390 Search for statements by nodes.
Chris@8 391 @return an iterator to the first match, or NULL if no matches found.
Chris@8 392 */
Chris@8 393 SORD_API
Chris@8 394 SordIter*
Chris@8 395 sord_search(SordModel* model,
Chris@8 396 const SordNode* s,
Chris@8 397 const SordNode* p,
Chris@8 398 const SordNode* o,
Chris@8 399 const SordNode* g);
Chris@8 400 /**
Chris@8 401 Search for a single node that matches a pattern.
Chris@8 402 Exactly one of @p s, @p p, @p o must be NULL.
Chris@8 403 This function is mainly useful for predicates that only have one value.
Chris@8 404 The returned node must be freed using sord_node_free.
Chris@8 405 @return the first matching node, or NULL if no matches are found.
Chris@8 406 */
Chris@8 407 SORD_API
Chris@8 408 SordNode*
Chris@8 409 sord_get(SordModel* model,
Chris@8 410 const SordNode* s,
Chris@8 411 const SordNode* p,
Chris@8 412 const SordNode* o,
Chris@8 413 const SordNode* g);
Chris@8 414
Chris@8 415 /**
Chris@8 416 Return true iff a statement exists.
Chris@8 417 */
Chris@8 418 SORD_API
Chris@8 419 bool
Chris@8 420 sord_ask(SordModel* model,
Chris@8 421 const SordNode* s,
Chris@8 422 const SordNode* p,
Chris@8 423 const SordNode* o,
Chris@8 424 const SordNode* g);
Chris@8 425
Chris@8 426 /**
Chris@8 427 Return the number of matching statements.
Chris@8 428 */
Chris@8 429 SORD_API
Chris@8 430 uint64_t
Chris@8 431 sord_count(SordModel* model,
Chris@8 432 const SordNode* s,
Chris@8 433 const SordNode* p,
Chris@8 434 const SordNode* o,
Chris@8 435 const SordNode* g);
Chris@8 436
Chris@8 437 /**
Chris@8 438 Check if @a model contains a triple pattern.
Chris@8 439 */
Chris@8 440 SORD_API
Chris@8 441 bool
Chris@8 442 sord_contains(SordModel* model, const SordQuad pat);
Chris@8 443
Chris@8 444 /**
Chris@8 445 Add a quad to a model.
Chris@8 446 */
Chris@8 447 SORD_API
Chris@8 448 bool
Chris@8 449 sord_add(SordModel* model, const SordQuad quad);
Chris@8 450
Chris@8 451 /**
Chris@8 452 Remove a quad from a model.
Chris@8 453
Chris@8 454 Note that is it illegal to remove while iterating over @c model.
Chris@8 455 */
Chris@8 456 SORD_API
Chris@8 457 void
Chris@8 458 sord_remove(SordModel* model, const SordQuad quad);
Chris@8 459
Chris@8 460 /**
Chris@8 461 @}
Chris@8 462 @name Inserter
Chris@8 463 @{
Chris@8 464 */
Chris@8 465
Chris@8 466 /**
Chris@8 467 Create an inserter for writing statements to a model.
Chris@8 468 */
Chris@8 469 SORD_API
Chris@8 470 SordInserter*
Chris@8 471 sord_inserter_new(SordModel* model,
Chris@8 472 SerdEnv* env);
Chris@8 473
Chris@8 474 /**
Chris@8 475 Free an inserter.
Chris@8 476 */
Chris@8 477 SORD_API
Chris@8 478 void
Chris@8 479 sord_inserter_free(SordInserter* inserter);
Chris@8 480
Chris@8 481 /**
Chris@8 482 Set the current base URI for writing to the model.
Chris@8 483
Chris@8 484 Note this function can be safely casted to SerdBaseSink.
Chris@8 485 */
Chris@8 486 SORD_API
Chris@8 487 SerdStatus
Chris@8 488 sord_inserter_set_base_uri(SordInserter* inserter,
Chris@8 489 const SerdNode* uri);
Chris@8 490
Chris@8 491 /**
Chris@8 492 Set a namespace prefix for writing to the model.
Chris@8 493
Chris@8 494 Note this function can be safely casted to SerdPrefixSink.
Chris@8 495 */
Chris@8 496 SORD_API
Chris@8 497 SerdStatus
Chris@8 498 sord_inserter_set_prefix(SordInserter* inserter,
Chris@8 499 const SerdNode* name,
Chris@8 500 const SerdNode* uri);
Chris@8 501
Chris@8 502 /**
Chris@8 503 Write a statement to the model.
Chris@8 504
Chris@8 505 Note this function can be safely casted to SerdStatementSink.
Chris@8 506 */
Chris@8 507 SORD_API
Chris@8 508 SerdStatus
Chris@8 509 sord_inserter_write_statement(SordInserter* inserter,
Chris@8 510 SerdStatementFlags flags,
Chris@8 511 const SerdNode* graph,
Chris@8 512 const SerdNode* subject,
Chris@8 513 const SerdNode* predicate,
Chris@8 514 const SerdNode* object,
Chris@8 515 const SerdNode* object_datatype,
Chris@8 516 const SerdNode* object_lang);
Chris@8 517
Chris@8 518 /**
Chris@8 519 @}
Chris@8 520 @name Iteration
Chris@8 521 @{
Chris@8 522 */
Chris@8 523
Chris@8 524 /**
Chris@8 525 Set @c quad to the quad pointed to by @c iter.
Chris@8 526 */
Chris@8 527 SORD_API
Chris@8 528 void
Chris@8 529 sord_iter_get(const SordIter* iter, SordQuad quad);
Chris@8 530
Chris@8 531 /**
Chris@8 532 Return a field of the quad pointed to by @c iter.
Chris@8 533 */
Chris@8 534 SORD_API
Chris@8 535 const SordNode*
Chris@8 536 sord_iter_get_node(const SordIter* iter, SordQuadIndex index);
Chris@8 537
Chris@8 538 /**
Chris@8 539 Return the store pointed to by @c iter.
Chris@8 540 */
Chris@8 541 SORD_API
Chris@8 542 const SordModel*
Chris@8 543 sord_iter_get_model(SordIter* iter);
Chris@8 544
Chris@8 545 /**
Chris@8 546 Increment @c iter to point to the next statement.
Chris@8 547 */
Chris@8 548 SORD_API
Chris@8 549 bool
Chris@8 550 sord_iter_next(SordIter* iter);
Chris@8 551
Chris@8 552 /**
Chris@8 553 Return true iff @c iter is at the end of its range.
Chris@8 554 */
Chris@8 555 SORD_API
Chris@8 556 bool
Chris@8 557 sord_iter_end(const SordIter* iter);
Chris@8 558
Chris@8 559 /**
Chris@8 560 Free @c iter.
Chris@8 561 */
Chris@8 562 SORD_API
Chris@8 563 void
Chris@8 564 sord_iter_free(SordIter* iter);
Chris@8 565
Chris@8 566 /**
Chris@8 567 @}
Chris@8 568 @name Utilities
Chris@8 569 @{
Chris@8 570 */
Chris@8 571
Chris@8 572 /**
Chris@8 573 Match two quads (using ID comparison only).
Chris@8 574
Chris@8 575 This function is a straightforward and fast equivalence match with wildcard
Chris@8 576 support (ID 0 is a wildcard). It does not actually read node data.
Chris@8 577 @return true iff @c x and @c y match.
Chris@8 578 */
Chris@8 579 SORD_API
Chris@8 580 bool
Chris@8 581 sord_quad_match(const SordQuad x, const SordQuad y);
Chris@8 582
Chris@8 583 /**
Chris@8 584 @}
Chris@8 585 @name Serialisation
Chris@8 586 @{
Chris@8 587 */
Chris@8 588
Chris@8 589 /**
Chris@8 590 Return a reader that will read into @c model.
Chris@8 591 */
Chris@8 592 SORD_API
Chris@8 593 SerdReader*
Chris@8 594 sord_new_reader(SordModel* model,
Chris@8 595 SerdEnv* env,
Chris@8 596 SerdSyntax syntax,
Chris@8 597 SordNode* graph);
Chris@8 598
Chris@8 599 /**
Chris@8 600 Write a model to a writer.
Chris@8 601 */
Chris@8 602 SORD_API
Chris@8 603 bool
Chris@8 604 sord_write(SordModel* model,
Chris@8 605 SerdWriter* writer,
Chris@8 606 SordNode* graph);
Chris@8 607
Chris@8 608 /**
Chris@8 609 Write a range to a writer.
Chris@8 610
Chris@8 611 This increments @c iter to its end, then frees it.
Chris@8 612 */
Chris@8 613 SORD_API
Chris@8 614 bool
Chris@8 615 sord_write_iter(SordIter* iter,
Chris@8 616 SerdWriter* writer);
Chris@8 617
Chris@8 618 /**
Chris@8 619 @}
Chris@8 620 @}
Chris@8 621 */
Chris@8 622
Chris@8 623 #ifdef __cplusplus
Chris@8 624 } /* extern "C" */
Chris@8 625 #endif
Chris@8 626
Chris@8 627 #endif /* SORD_SORD_H */