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.7.6
SHA1 sum:23ff9af201d0ed879fa7d44885e0f5db8d6cce6b
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.623ff9af201d0ed879fa7d44885e0f5db8d6cce6b98https://github.com/terminusdb/terminus_store_prolog/archive/v0.7.6.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

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

open_directory_store("testdir", Store),
open_write(Store, Builder),
open_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 18 files holding a total of 134K bytes.