summaryrefslogtreecommitdiffstats
path: root/sord
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-02-04 20:16:47 +0000
committerDavid Robillard <d@drobilla.net>2011-02-04 20:16:47 +0000
commit3e1a25af1cc2aab02b6d1a3e982d04e7e995e189 (patch)
tree3726cc754ad92634e658208afb61d5032604f683 /sord
parent7528971844b737988af552fa62bbe42b354e2407 (diff)
downloadsord-3e1a25af1cc2aab02b6d1a3e982d04e7e995e189.tar.gz
sord-3e1a25af1cc2aab02b6d1a3e982d04e7e995e189.tar.bz2
sord-3e1a25af1cc2aab02b6d1a3e982d04e7e995e189.zip
Remove sord_set_option and sord_open, just pass options to sord_new instead.
git-svn-id: http://svn.drobilla.net/sord/trunk@22 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'sord')
-rw-r--r--sord/sord.h50
1 files changed, 13 insertions, 37 deletions
diff --git a/sord/sord.h b/sord/sord.h
index 8b1cb1c..8c92a5c 100644
--- a/sord/sord.h
+++ b/sord/sord.h
@@ -64,6 +64,7 @@ typedef int SordCount; ///< Count of nodes or triples
*/
typedef SordID SordQuad[4];
+/** Index into a SordQuad. */
typedef enum {
SORD_SUBJECT = 0,
SORD_PREDICATE = 1,
@@ -71,13 +72,23 @@ typedef enum {
SORD_GRAPH = 3
} SordQuadIndex;
-/** Type of a node */
+/** Type of a node. */
typedef enum {
SORD_URI = 1, ///< URI
SORD_BLANK = 2, ///< Blank node identifier
SORD_LITERAL = 3 ///< Literal (string with optional lang and/or type)
} SordNodeType;
+/** Indexing option. */
+typedef enum {
+ SORD_SPO = 1, ///< Subject, Predicate, Object
+ SORD_SOP = 1 << 1, ///< Subject, Object, Predicate
+ SORD_OPS = 1 << 2, ///< Object, Predicate, Subject
+ SORD_OSP = 1 << 3, ///< Object, Subject, Predicate
+ SORD_PSO = 1 << 4, ///< Predicate, Subject, Object
+ SORD_POS = 1 << 5 ///< Predicate, Object, Subject
+} SordIndexOption;
+
/** @name Initialisation and Cleanup
* @{
*/
@@ -85,42 +96,7 @@ typedef enum {
/** Create a new store. */
SORD_API
Sord
-sord_new(void);
-
-/** Set a store option.
- * Options are RDF properties (with the store as the subject), with the
- * restriction that each has at most one value.
- * If @a value is NULL, the option is unset (i.e. the property is removed).
- *
- * Known options (with acceptable types):
- * - http://drobilla.net/ns/sord#index-spo :: xsd:boolean
- * - http://drobilla.net/ns/sord#index-sop :: xsd:boolean
- * - http://drobilla.net/ns/sord#index-ops :: xsd:boolean
- * - http://drobilla.net/ns/sord#index-osp :: xsd:boolean
- * - http://drobilla.net/ns/sord#index-pso :: xsd:boolean
- * - http://drobilla.net/ns/sord#index-pos :: xsd:boolean
- *
- * @param sord Store
- * @param key URI of this option (predicate)
- * @param value String of option value (object)
- * @param type Type of @a value
- * @param datatype Data type of @a value (if @a type is SORD_LITERAL), or NULL
- * @param lang Language of @a value (if @a type is SORD_LITERAL), or NULL
- */
-SORD_API
-void
-sord_set_option(Sord sord, const char* key, const char* value,
- SordNodeType type, const char* datatype, const char* lang);
-
-/** Open store on disk. */
-SORD_API
-bool
-sord_open(Sord sord);
-
-/** Close store on disk. */
-SORD_API
-void
-sord_close(Sord sord);
+sord_new(unsigned indices, bool graphs);
/** Close and free @a sord, leaving disk data intact. */
SORD_API