Giter VIP home page Giter VIP logo

Comments (4)

matko avatar matko commented on July 20, 2024 1

That's embarassing. The instructions are wrong.

When a named graph doesn't exist yet, you need to do create_named_graph/3 rather than open_named_graph/3. I'll update the readme.

from terminus_store_prolog.

matko avatar matko commented on July 20, 2024

open_directory_store won't create the directory, so if it doesn't exist, it'll throw that exception.

Try to create an empty directory, then opening that as a store. Does that work?

from terminus_store_prolog.

pmoura avatar pmoura commented on July 20, 2024

That was my first guess. I tried it moments ago but got a failure:

$ mkdir testdir

Then:

?- use_module(library(terminus_store)).                                                                                                                                          true.

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

?- trace.
true.

[trace]  ?- 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).
   Call: (11) terminus_store:open_directory_store("testdir", _5708) ? creep
   Exit: (11) terminus_store:open_directory_store("testdir", <store_blob>) ? creep
   Call: (11) terminus_store:open_write(<store_blob>, _5714) ? creep
   Exit: (11) terminus_store:open_write(<store_blob>, <layer_builder>) ? creep
   Call: (11) terminus_store:open_named_graph(<store_blob>, "sometestdb", _5730) ? creep
   Fail: (11) terminus_store:open_named_graph(<store_blob>, "sometestdb", _5730) ? creep
false.

from terminus_store_prolog.

pmoura avatar pmoura commented on July 20, 2024

Changing the called predicate indeed makes the query succeed.

from terminus_store_prolog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.