GithubHelp home page GithubHelp logo

Connecting to mongodb about cayley HOT 12 CLOSED

cayleygraph avatar cayleygraph commented on July 17, 2024
Connecting to mongodb

from cayley.

Comments (12)

miku avatar miku commented on July 17, 2024

The name under which the MongoDB backend registers itself is just mongo.

from cayley.

 avatar commented on July 17, 2024

Thanks! mongo works, but a bit confusing since the docs says mongodb.

However, now when I write the testdata.nq data and perform a query, e.g.: g.V("alice").All(), I get an empty result {"result": [{"id": ""}]} and an error: E0808 14:35:12.924594 06501 triplestore.go:257] Error: Couldn't retrieve node 48181acd22b3edaebc8a447868a7df7ce629920a not found. If I look in the mongodb collection I find the triplet data. When storing data in memory I get the correct result response and dont get the error.

from cayley.

kortschak avatar kortschak commented on July 17, 2024

Would you please post the version of cayley you are using and the complete sequence of commands you used to init and load the db.

from cayley.

barakmich avatar barakmich commented on July 17, 2024

Also, sidenote, either the documentation should be "mongo" or the registry should be "mongodb" -- I'd vote to do the latter because that's the official name.

from cayley.

barakmich avatar barakmich commented on July 17, 2024

Tried it against my docker-mongo with the config you posted, without a problem. Seconded for finding the relevant commands.

from cayley.

 avatar commented on July 17, 2024

Thought I was using version 0.3.1, but cayley version says Cayley snapshot (installed via homebrew)? Mongodb version 2.4.9. 1) Run cayley http --config=cayley.cfg.test --port=64211 with config above no init/load. 2) Load the testdata.nq through the UI, data loaded and found in mongodb. 3) Close the process. 4) restart cayley http --config=cayley.cfg.test --port=64211. 5) Run query: g.V("alice").All() -> error: E0808 22:39:21.150600 21815 triplestore.go:257] Error: Couldn't retrieve node 522b276a356bdf39013dfabea2cd43e141ecc9e8 not found. There seems to be an something going on with the parsing because the "alice" entry is stored as "\u003calice\u003e"?

from cayley.

barakmich avatar barakmich commented on July 17, 2024

Hmm. That looks like smart quotes. Which aren't special to cquads and will be part of the string.

If you use the 0.3.1 release version for OS X (darwin_amd64, I'm guessing), what happens? If it's the same issue, then there's something weird in parsing/HTTP. If it works, there's something wrong with the Homebrew package.

from cayley.

kortschak avatar kortschak commented on July 17, 2024

The http parser uses nquad which leaves N-Quad quotes in the quad.Quud strings. This must be left over from previously. I don't understand why memstore works correctly then though.

We should make this configurable in the web UI, but I have pushed something that should fix this problem in the short term.

from cayley.

steindani avatar steindani commented on July 17, 2024

For me Cayley 0.3.1 also imports nodes starting with \0003c (unicode less-than sign <) and endig with \u003e (greater-than sign >). Both using the web UI and sending the file to the Cayley server.

If the nt/nq file is loaded with the ./cayley http --dbpath= command, it is parsed correctly, without the < > characters. The nodes imported later into this DB also begin with \003c.

Both

  • web UI and HTTP load,
  • memstore and mongodb

has this problem.

(I used 0.3.0 with TTL format without problem.)

from cayley.

kortschak avatar kortschak commented on July 17, 2024

I'm not sure what you mean by HTTP load doesn't work if you say that cayley http --dbpath=<file> gives you expected results, but yes, the problem was AFAICS in the UI code, not in the mongo interface. The change at 614184b should fix this. Are you able to test whether you still have a problem if you use the current tip (aad21b0)?

from cayley.

steindani avatar steindani commented on July 17, 2024

By HTTP load I mean uploading the nt file to /api/v1/write/file/nquad. After pulling the latest version of the repository, the nt files are imported correctly. Thank you!

from cayley.

barakmich avatar barakmich commented on July 17, 2024

Closing as fixed (esp. in the next binary)

from cayley.

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.