Sones GraphDB Query Returning Error

喜夏-厌秋 提交于 2019-12-24 05:09:07

问题


I am following their tutorial here:

http://developers.sones.de/wiki/doku.php?id=quickreference:fiveminuteguide

But when I copy and paste this command in webshell

CREATE VERTICES 
   ABSTRACT Entity ATTRIBUTES (String Name),
   University EXTENDS Entity ATTRIBUTES(SET<Student> Students),
   City EXTENDS Entity ATTRIBUTES(SET<University> Universities),
   Student EXTENDS Entity ATTRIBUTES(Integer Age) BACKWARDEDGES(University.Students StudiesAt)

The output generates error:

GraphDB@localhost [gql-mode] > CREATE VERTICES ABSTRACT Entity ATTRIBUTES (String Name), University EXTENDS Entity ATTRIBUTES(SET<Student> Students), City EXTENDS Entity ATTRIBUTES(SET<University> Universities), Student EXTENDS Entity ATTRIBUTES(Integer Age) BACKWARDEDGES(University.Students StudiesAt) {   "query": "CREATE VERTICES ABSTRACT Entity ATTRIBUTES (String Name), University EXTENDS Entity ATTRIBUTES(SET Students), City EXTENDS Entity ATTRIBUTES(SET Universities), Student EXTENDS Entity ATTRIBUTES(Integer Age) BACKWARDEDGES(University.Students StudiesAt)",   "result": "Failed",   "duration": [
    0,
    "ms"   ],   "warnings": [],   "errors": [
    {
      "code": "sones.GraphDB.Errors.Error_GqlSyntax",
      "description": "Syntax error in query: [CREATE VERTICES ABSTRACT Entity ATTRIBUTES (String Name), University EXTENDS Entity ATTRIBUTES(SET Students), City EXTENDS Entity ATTRIBUTES(SET Universities), Student EXTENDS Entity ATTRIBUTES(Integer Age) BACKWARDEDGES(University.Students StudiesAt)]\n\n gql: [Syntax error, expected: index,types,abstract,type,]\n\nAt position: 1, 8"
    }   ],   "results": [] }

instead of this expected result:

{
  "query": "CREATE VERTICES ABSTRACT Entity ATTRIBUTES (String Name), City EXTENDS Entity ATTRIBUTES(SET Universities), University EXTENDS Entity ATTRIBUTES(SET Students), Student EXTENDS Entity ATTRIBUTES(Integer Age) BACKWARDEDGES(University.Students StudiesAt)",
  "result": "Successful",
  "duration": [
    660,
    "ms"
  ],
  "warnings": [],
  "errors": [],
  "results": [
    {
      "DBType": "Entity",
      "UUID": "f1cf505d-3dc9-4ec0-b777-ca1c0075d835",
      "REVISION": "20102110.124020.0492167(8edd08775ce5754581140b203163f93d)",
      "EDITION": "DefaultEdition"
    },
    {
      "DBType": "City",
      "UUID": "89dc4d40-2046-4c0b-8599-6c0665ae62a5",
      "REVISION": "20102110.124020.1952135(8edd08775ce5754581140b203163f93d)",
      "EDITION": "DefaultEdition"
    },
    {
      "DBType": "University",
      "UUID": "274f1216-7ba0-409d-b466-668157b2a6ee",
      "REVISION": "20102110.124020.3592086(8edd08775ce5754581140b203163f93d)",
      "EDITION": "DefaultEdition"
    },
    {
      "DBType": "Student",
      "UUID": "7dec86d3-c62d-49cc-840a-93203bb821dc",
      "REVISION": "20102110.124020.5402167(8edd08775ce5754581140b203163f93d)",
      "EDITION": "DefaultEdition"
    }
  ]
}

So what's the problem (I used THEIR OWN lastest binary version I didn't even compile it by myself).

They don't even have a forum :(.


回答1:


Examples on the site is out of date. I've heard that Sones GMBH (Creators of SonesDB) is out of money, so the product may be dead.

The correct query of that sample for SonesDB 2.0+ is:

CREATE VERTEX TYPES
       ABSTRACT Entity ATTRIBUTES (String Name),
       University EXTENDS Entity ATTRIBUTES(SET<Student> Students),
       City EXTENDS Entity ATTRIBUTES(SET<University> Universities),
       Student EXTENDS Entity ATTRIBUTES(Int32 Age) INCOMINGEDGES(University.Students StudiesAt)

There is no more statement "CREATE VERTICES", now it's called "CREATE VERTEX TYPES"

Integer type - Int32

BACKWARDEDGES - INCOMINGEDGES

CheatSheet for SonesDB 2.0+ you can see here. As I see, there is correct information.



来源:https://stackoverflow.com/questions/4983455/sones-graphdb-query-returning-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!