-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for BDB backend for disk-based storage, closes #6
Also extends tests, exports rdf_free, minor tweaks to documentation. Attempt to install bdb on travis for testing as well.
- Loading branch information
Showing
10 changed files
with
343 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,6 @@ addons: | |
- librdf0-dev | ||
- libv8-dev | ||
- libjq-dev | ||
- libdb-dev | ||
after_success: | ||
- Rscript -e 'covr::codecov()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
library(redland) | ||
world <- new("World") | ||
|
||
## No error but null pointer returned | ||
bdb_storage <- new("Storage", world, "hashes", name = "db1", | ||
options = "new='yes',hash-type='bdb',dir='.'") | ||
model <- new("Model", world = world, storage = bdb_storage, options = "") | ||
|
||
## error: sqlite not found | ||
sqlite_storage <- new("Storage", world, "sqlite", name = "sqlite1", options = "new='yes'") | ||
## not found | ||
postgres_storage <- new("Storage", world, "postgresql", name = "postgres1", | ||
options = "new='yes',host='localhost',database='red',user='foo','password='bar'") | ||
|
||
## Works, in memory, serializes to an rdf/xml file called thing.rdf when freed. | ||
## Not indexed, so will be slow. Suitable for small models. | ||
file_storage <- new("Storage", world, "file", "thing.rdf", "") | ||
storage <- file_storage | ||
model <- new("Model", world = world, storage = storage, options = "") | ||
|
||
## Works, fast write, not indexed, good for only small models, | ||
## no reason to use this instead of hash-based memory (which is indexed) | ||
memory_storage <- new("Storage", world, "memory", "", "") | ||
storage <- memory_storage | ||
model <- new("Model", world = world, storage = storage, options = "") | ||
|
||
|
||
library(rdflib) | ||
|
||
rdf <- structure(list(world = world, model = model, storage = storage), | ||
class = "rdf") | ||
|
||
rdf_add(rdf, | ||
subject="http://www.dajobe.org/", | ||
predicate="http://purl.org/dc/elements/1.1/language", | ||
object="en") | ||
rdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | ||
<rdf:Description rdf:nodeID="b0"> | ||
<rdf:type rdf:resource="http://schema.org/Person"/> | ||
</rdf:Description> | ||
<rdf:Description rdf:nodeID="b0"> | ||
<ns0:name xmlns:ns0="http://schema.org/">Jane Doe</ns0:name> | ||
</rdf:Description> | ||
<rdf:Description rdf:nodeID="b0"> | ||
<ns0:url xmlns:ns0="http://schema.org/" rdf:resource="http://www.janedoe.com"/> | ||
</rdf:Description> | ||
<rdf:Description rdf:nodeID="b0"> | ||
<ns0:jobTitle xmlns:ns0="http://schema.org/">Professor</ns0:jobTitle> | ||
</rdf:Description> | ||
<rdf:Description rdf:nodeID="b0"> | ||
<ns0:telephone xmlns:ns0="http://schema.org/">(425) 123-4567</ns0:telephone> | ||
</rdf:Description> | ||
</rdf:RDF> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.