You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,22 @@ db.put(triple, function (err) {
39
39
40
40
Returns an instance of hyper-graph-db. Arguments are passed directly to hyperdb, look at its constructor [API](https://github.com/mafintosh/hyperdb#var-db--hyperdbstorage-key-options) for configuration options.
41
41
42
+
Extra Options:
43
+
```js
44
+
{
45
+
index:'hex'||'tri', // 6 or 3 indices, default 'hex'
46
+
name: string, // name that prefixes blank nodes
47
+
prefixes: { // an object representing RDF namespace prefixes
48
+
[sorthand]: string,
49
+
},
50
+
}
51
+
```
52
+
53
+
The prefix option can be used to further reduce db size, as it will auto replace namespaced values with their prefered prefix.
54
+
55
+
For example: `{ vcard: 'http://www.w3.org/2006/vcard/ns#' }` will store `http://www.w3.org/2006/vcard/ns#given-name` as `vcard:given-name`.
56
+
57
+
**Note:**`index`, `name`, and `prefixes` can only be set when a graph db is first created. When loading an existing graph these values are also loaded from the db.
42
58
43
59
#### `db.on('ready')`
44
60
@@ -65,7 +81,7 @@ Returns a writable stream.
65
81
66
82
Returns all entries that match the triple. This allows for partial pattern-matching. For example `{ subject: 'a' })`, will return all triples with subject equal to 'a'.
67
83
68
-
Allowed options:
84
+
Options:
69
85
```js
70
86
{
71
87
limit: number, // limit number of triples returned
@@ -178,3 +194,20 @@ db.put([{
178
194
#### `var stream = db.searchStream(queries)`
179
195
180
196
Returns search results as a stream.
197
+
198
+
#### `db.graphVersion()`
199
+
200
+
Returns the version of hyper-graph-db that created the db.
201
+
202
+
#### `db.indexType()`
203
+
204
+
Returns the type of index which the graph is configured to use: `hex` or `tri`.
205
+
206
+
#### `db.name()`
207
+
208
+
Returns the name used for blank nodes when searching the db.
209
+
210
+
#### `db.prefixes()`
211
+
212
+
Returns an object representing the RDF prefixes used by the db.
0 commit comments