Did you know ... | Search Documentation: |
Packs (add-ons) for SWI-Prolog |
Title: | Use the Terminus-Store Rust library from Prolog |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 0.19.8 |
SHA1 sum: | 5e6bfc207a242ad4f26fa83b8818d91dd3fe6f36 |
Home page: | https://github.com/terminusdb/terminus_store_prolog |
No reviews. Create the first review!.
![Actions Status](https://github.com/terminusdb/terminus_store_prolog/actions)
Prolog bindings for the terminus-store Rust library.
This library is downloadable through SWI-Prolog's package management system. In a swipl instance, run
pack_install(terminus_store_prolog).
Then you can use the library with
use_module(library(terminus_store)).
If you need to compile manually, for example to test a change without reinstalling the pack, follow these instructions.
Also, use the provided `./script/swipl` script to start a test instance. This will ensure the foreign library will be located properly.
make ./script/swipl
make ./script/test
Create a new directory (testdir
in this example), then do the following:
open_directory_store("testdir", Store), open_write(Store, Builder), create_named_graph(Store, "sometestdb", DB), nb_add_triple(Builder, "Subject", "Predicate", value("Object")), nb_commit(Builder, Layer), nb_set_head(DB, Layer).
open_directory_store("testdir", Store), open_named_graph(Store, "sometestdb", DB), open_write(DB, Builder), nb_add_triple(Builder, "Subject2", "Predicate2", value("Object2")), nb_commit(Builder, Layer), nb_set_head(DB, Layer),
open_directory_store("testdir", Store), open_named_graph(Store, "sometestdb", DB), head(DB, Layer), triple(Layer, Subject, Predicate, Object).
open_directory_store("testdir", Store), open_named_graph(Store, "sometestdb", DB), head(DB, Layer), subject_id(Layer, "Subject", S_Id), id_triple(Layer, S_Id, P_Id, O_Id), predicate_id(Layer, Predicate, P_Id), object_id(Layer, Object, O_Id).
Pack contains 27 files holding a total of 192K bytes.