Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "terminus_store_prolog"

Title:Use the Terminus-Store Rust library from Prolog
Rating:Not rated. Create the first rating!
Latest version:0.9.9
SHA1 sum:e36c2cef146b07a135f7b95ef40620f8901a9ddb
Home page:https://github.com/terminusdb/terminus_store_prolog

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.4.2d9112fcec4ebc6494a66a1f33268cd0725a24d6d1https://github.com/terminusdb/terminus_store_prolog/archive/v0.4.2.zip
0.4.31199a64c22bb0a05e7d4cc57abb13829bcaab0051https://github.com/terminusdb/terminus_store_prolog.git
4fbe2a3bd0eeeaef829756452a26ef6704a435672https://github.com/terminusdb/terminus_store_prolog/archive/v0.4.3.zip
0.4.4077c078fa50212fc16a6e8733a89b318c048a0b91https://github.com/terminusdb/terminus_store_prolog/archive/v0.4.4.zip
ceabddc1849ef6356dd5665c3be7d620da229d4b1https://github.com/terminusdb/terminus_store_prolog.git
0.6.01c93469d8032addbe0c48e0c6d04b423d1c5aff01https://github.com/terminusdb/terminus_store_prolog/archive/v0.6.0.zip
297c24bce6299be31c73e27d65068dcedcf805c93https://github.com/terminusdb/terminus_store_prolog/archive/v0.6.0.zip
0.7.0e41a00fc253f3b6b221b90149b38e82517c3200c3https://github.com/terminusdb/terminus_store_prolog/archive/v0.7.0.zip
0.7.1320ad8be1be2be80bdca9245017fea0288e568103https://github.com/terminusdb/terminus_store_prolog/archive/v0.7.1.zip
0.7.2ec70c4abd4c1472e2ceb7e333a89592279d6319a21https://github.com/terminusdb/terminus_store_prolog/archive/v0.7.2.zip
0.7.3532c85afe465e349615176f6c22359d657c0bd9a5https://github.com/terminusdb/terminus_store_prolog/archive/v0.7.3.zip
0.7.4f575a235292fe58108c8a436a48ba9cdeca20c621https://github.com/terminusdb/terminus_store_prolog/archive/v0.7.4.zip
0.7.5942cf4b4a85ac2303b5207cd14ba2ca68952973e37https://github.com/terminusdb/terminus_store_prolog/archive/v0.7.5.zip
0.7.623ff9af201d0ed879fa7d44885e0f5db8d6cce6b117https://github.com/terminusdb/terminus_store_prolog/archive/v0.7.6.zip
0.8.067916bcd264712d351e01f50963ff5f66e105b7b254https://github.com/terminusdb/terminus_store_prolog/archive/v0.8.0.zip
0.8.25e56b6fca002222a9a3d154c7e6234efb897c6c52https://github.com/terminusdb/terminus_store_prolog/archive/v0.8.2.zip
0.9.04ca446acd037da046bec9739f6bd8c5622d4d2551https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.0.zip
0.9.1fa1a5ea87d9c80ec57517f6a96784622671b7d505https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.1.zip
0.9.2fa2eba44ae6039ab89bd323855ed18e4f753240e1https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.2.zip
0.9.37ee8eff824f5359897cdada49dc3f9264f1f0ef03https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.3.zip
0.9.4bdaca502465bdfdfb2775ae123b2682d0bc69dbc2https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.4.zip
0.9.583e0046d40babba0abfbf2fa21a5babb7a6c95f317https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.5.zip
0.9.62cc2474261aadc06d9acdf022bbe820723f347571https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.6.zip
0.9.71a1fdccf734af02467430c19efb6e75be7e6bddd1https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.7.zip
0.9.83ccd43d60374443ef1b9d4adc2930f1d02c0780d1https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.8.zip
4a664aa6778a95f17fd4f8f7264617dfe89592373https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.8.zip
0.9.9e36c2cef146b07a135f7b95ef40620f8901a9ddb1https://github.com/terminusdb/terminus_store_prolog/archive/v0.9.9.zip

terminus-store prolog bindings

![Build Status](https://travis-ci.com/terminusdb/terminus_store_prolog)

Prolog bindings for the terminus-store Rust library.

Requirements

  • cargo
  • gcc
  • swi-prolog (with the include headers)

Installing

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)).

Compiling and running without installing (for testing purposes)

If you need to compile manually, for example to test a change without reinstalling the pack, follow these instructions.

Use the wrapper script `./make` rather than the Makefile directly. The wrapper script will set up swipl environment variables which the build needs.

Also, use the provided `./run_swipl` script to start a test instance. This will ensure the foreign library will be located properly.

./make
./run_swipl

Running the tests

./make
./run_swipl -g run_tests -g halt

Examples

Creating a named graph and adding a triple

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).

Add a triple to an existing named graph

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),

Query triples

open_directory_store("testdir", Store),
open_named_graph(Store, "sometestdb", DB),
head(DB, Layer),
triple(Layer, Subject, Predicate, Object).

Convert strings to ids and query by id

open_directory_store("testdir", Store),
open_named_graph(Store, "sometestdb", DB),
head(DB, Layer),
subject_id("Subject", S_Id),
id_triple(Layer, S_Id, P_Id, O_Id),
predicate_id(Predicate, P_Id),
object_id(Object, O_Id).

Contents of pack "terminus_store_prolog"

Pack contains 22 files holding a total of 169K bytes.