@@ -13,54 +13,37 @@ __LevelGraph-N3__ is a plugin for
1313[ LevelGraph] ( http://github.com/mcollina/levelgraph ) that adds the
1414ability to store, fetch and process N3 and turtle files.
1515
16- ## Install
16+ ## Install
1717
1818### Node.js
1919
2020Adding support for N3 to LevelGraph is easy:
2121``` shell
22- $ npm install levelgraph levelgraph-n3 --save
22+ $ npm install level levelgraph levelgraph-n3 --save
2323```
2424Then in your code:
2525``` js
26- var levelgraph = require (' levelgraph' ),
26+ var level = require (' level' ),
27+ levelgraph = require (' levelgraph' ),
2728 levelgraphN3 = require (' levelgraph-n3' ),
28- db = levelgraphN3 (levelgraph (' yourdb' ));
29+ db = levelgraphN3 (levelgraph (level ( ' yourdb' ) ));
2930```
3031
3132
32- At the moment it requires node v0.10.x, but the port to node v0.8.x
33- should be straighforward.
34- If you need it, just open a pull request.
3533
3634### Browser
3735
3836If you use [ browserify] ( http://browserify.org/ ) you can use this package
3937in a browser just as in node.js. Please also take a look at [ Browserify
4038section in LevelGraph package] ( https://github.com/mcollina/levelgraph#browserify )
4139
42- You can also use standalone browserified version from ` ./build `
43- directory or use [ bower] ( http://bower.io )
44-
45- ``` shell
46- $ bower install levelgraph-n3 --save
47- ```
48- It will also install its dependency levelgraph! Now you can simply:
49-
50- ``` html
51- <script src =" bower_components/levelgraph/build/levelgraph.js" ></script >
52- <script src =" bower_components/levelgraph-n3/build/levelgraph-n3.js" ></script >
53- <script >
54- var db = levelgraphN3 (levelgraph (' yourdb' ));
55- </script >
56- ```
5740
5841## Usage
5942
6043We assume in following examples that you created database as explained
6144above!
6245``` js
63- var db = levelgraphN3 (levelgraph (" yourdb" ));
46+ var db = levelgraphN3 (levelgraph (level ( " yourdb" ) ));
6447```
6548
6649### Importing n3 files
@@ -137,7 +120,7 @@ db.search([{
137120 subject: db .v (" s" ),
138121 predicate: " http://example.org/cartoons#smarterThan" ,
139122 object: db .v (" o" )
140- }], {
123+ }], {
141124 n3: {
142125 subject: db .v (" o" ),
143126 predicate: " http://example.org/cartoons#dumberThan" ,
@@ -174,7 +157,7 @@ It also supported by the `searchStream` method.
174157
175158## LICENSE - "MIT License"
176159
177- Copyright (c) 2013 Matteo Collina (http://matteocollina.com )
160+ Copyright (c) 2013-2015 Matteo Collina (http://matteocollina.com )
178161
179162Permission is hereby granted, free of charge, to any person
180163obtaining a copy of this software and associated documentation
0 commit comments