SlideShare a Scribd company logo
GQLcheatsheet
GQL The sones Graph Query Language (GQL) allows you to create, modify, administrate and query a graph (database).
CREATE VERTEXCREATE VERTEXCREATE VERTEXCREATE VERTEX Create a user-defined vertex type
CREATE [ABSTRACT] VERTEX vertex_type_def
CREATE VERTICESCREATE VERTICESCREATE VERTICESCREATE VERTICES Create user-defined vertices having circular dependencies
CREATE VERTICES [ABSTRACT] vertex_type_def [, [ABSTRACT] vertex_type_def]]
ALTER VERTEXALTER VERTEXALTER VERTEXALTER VERTEX Manipulates a user-defined vertex
ALTER VERTEX vertex
ADD ATTRIBUTES(attr_definition [,attr_definition])|
DROP ATTRIBUTES (identifier [,identifier]) |
ADD BACKWARDEDGES (backward_edge_def [,backward_edge_def]) |
DROP BACKWARDEDGES (identifier [,identifier]) |
RENAME ATTRIBUTE identifier TO identifier |
RENAME TO identifier |
RENAME BACKWARDEDGE identifier TO identifier |
UNIQUE (identifier [,identifier]) |
DROP UNIQUE |
DROP MANDATORY |
MANDATORY (identifier [,identifier]) |
DEFINE ATTRIBUTES (identifier [,identifier]) |
UNDEFINE ATTRIBUTES (identifier [,identifier]) |
COMMENT = "<string>"
DROP VERTEXDROP VERTEXDROP VERTEXDROP VERTEX Deletes a user-defined vertex
DROP VERTEX vertex
CREATE INDEXCREATE INDEXCREATE INDEXCREATE INDEX Creates an index on a user-defined vertex
CREATE INDEX [identifier] [EDITION edition_identifier]
ON VERTEX identifier (index_attribute_list) [INDEXTYPE identifier]
REBUILD INDICESREBUILD INDICESREBUILD INDICESREBUILD INDICES rebuilds all or specific index of a user-defined vertex
REBUILD INDICES [vertex [,vertex]]
DROP INDEXDROP INDEXDROP INDEXDROP INDEX Deletes an index of a user-defined vertex
FROM vertex DROP INDEX index_identifier [EDITION edition_identifier]
INSERTINSERTINSERTINSERT Insert an object into a graph
INSERT INTO Identifier VALUES (attr_assign [,attr_assign]) [WHERE where_condition]
INSERTORUPDATEINSERTORUPDATEINSERTORUPDATEINSERTORUPDATE Inserts or Updates an object into a graph
INSERTORUPDATE vertex VALUES (attr_assign [,attr_assign]) [WHERE where_condition]
INSERTORREPLACEINSERTORREPLACEINSERTORREPLACEINSERTORREPLACE Inserts or Replaces an object into a graph
INSERTORREPLACE vertex VALUES (attr_assign [,attr_assign]) [WHERE where_condition]
UPDATEUPDATEUPDATEUPDATE Updates an object within a graph
UPDATE vertex SET (attr_update [,attr_update]) [WHERE where_condition]
REPLACEREPLACEREPLACEREPLACE Replaces an object within a graph
REPLACE vertex VALUES (attr_assign [,attr_assign]) WHERE where_condition
DELETEDELETEDELETEDELETE Deletes attributes from an vertex or the vertex itself
FROM vertex DELETE [identifier [,identifier] ] [WHERE where_condition]
EXPORTEXPORTEXPORTEXPORT Create a complete (query) dump in different formats
EXPORT [VERTICES vertex [,vertex]] [{GDDL|GDML|ALL}] [AS {GQL}]
[TO {‘file:...‘ | ‘http://...‘}]
IMPORTIMPORTIMPORTIMPORT Import queries
IMPORT FROM {‘file:...‘ | ‘http://...‘} FORMAT {GQL}
[PARALLELTASKS(number)] [COMMENTS(‘value‘ [,‘value‘])]
LINKLINKLINKLINK Add edges between vertices
LINK vertex (identifier=value [,identifier=value])
TO vertex (identifier=value [,identifier=value]) VIA edge_attribute
UNLINKUNLINKUNLINKUNLINK Remove edges between vertices
UNLINK vertex (identifier=value [,identifier=value])
FROM vertex (identifier=value [,identifier=value]) VIA edge_attribute
TRUNCATETRUNCATETRUNCATETRUNCATE Removes all records from a user-defined vertex
TRUNCATE vertex
DESCRIBEDESCRIBEDESCRIBEDESCRIBE Get information on items within the database
DESCRIBE AGGREGATES |
DESCRIBE AGGREGATE identifier |
DESCRIBE EDGES |
DESCRIBE EDGE identifier |
DESCRIBE FUNCTIONS |
DESCRIBE FUNCTION identifier |
DESCRIBE INDICES |
DESCRIBE INDEX identifier [edition] |
DESCRIBE SETTINGS [ON VERTEX vertex | ON ATTRIBUTE attr_definition | ON DB | ON SESSION] |
DESCRIBE SETTING identifier [ON VERTEX vertex | ON ATTRIBUTE attribute | ON DB | ON SESSION]
DESCRIBE TYPES |
DESCRIBE VERTEX vertex
SETTINGSETTINGSETTINGSETTING Set, get or remove a setting (in a session or global)
SETTING DB setting_operation |
SETTING SESSION setting_operation |
SETTING [TYPE | VERTEX] identifier setting_operation |
SETTING ATTRIBUTE identifier setting_operation
SELECTSELECTSELECTSELECT Retrieve objects or their data from a graph
FROM identifier [reference] [,identifier [= <value>] [reference]]
SELECT * | # | - | > | < | selection [,selection] |
@Primitive-Datatype [,@Primitive-Datatype]
[WHERE where_condition] [GROUP BY identifier] [ORDER BY identifier]
[OFFSET <number>] [LIMIT <number>] [DEPTH <number>]
BUILTBUILTBUILTBUILT----IN Datatypes (case sensitive)IN Datatypes (case sensitive)IN Datatypes (case sensitive)IN Datatypes (case sensitive)
Integer, UnsignedInteger, Double, String, Boolean, DateTime, List<Primitive-Datatype>,
SET<Primitive-Datatype>, SET<Userdefined-Datatype>
Aggregates / FunctionsAggregates / FunctionsAggregates / FunctionsAggregates / Functions
COUNT | AVG | CONCAT | TOUPPER | MAXWEIGHT | SUBSTRING | TOP | PATH | ...
CommentsCommentsCommentsComments
sonesLogin and Access sones graphDB can be accessed through a number of different
interfaces like SOAP WebService, REST - even a WebShell running inside every browser is
available.
WebShell sones graphDB WebShell is a unix-like shell in a web browser allowing the
user to interact with an instance of a sones graphDB. It is based on well-known technologies
and libraries like HTML, JavaScript, JQuery and our RESTRESTRESTREST APIAPIAPIAPI. Authentication is mandatory.
Anyone can gain access to a personalized instance by logging on to http://www.sones.com.
useful commands:
sample json output:
{
"query": "FROM User u SELECT *",
"result": "Successful",
"warnings": [],
"errors": [],
"results":
[{
"Username": "User1",
"Age": "25"
}],
"Duration": ["1","ms"]
}
commandcommandcommandcommand parametersparametersparametersparameters descriptiondescriptiondescriptiondescription
help n/a displays help text
clear n/a clears the screen
format xml | json | text by default results are displays as xml. Output
REST The REST API can be used to run GQL queries. The query is encapsulated
into the URL (URL encoded) and data then is returned in the specified format (xml / json /
text). Basic authentication is mandatory.
based on latest GQL specification — comments to info@sones.com are welcome — Last Update: Oct 25th, 2010 © sones GmbH
vertex_type_def = identifier [EXTENDS Identifier] [ATTRIBUTES(attr_definition
[,attr_definition])] [BACKWARDEDGES(backward_edge_def [,backward_edge_def])] [UNIQUE
(identifier [,identifier])] [MANDATORY(identifier [,identifier])] [INDICES
(index_on_create)] [COMMENT = "<string>"]
attr_definition = built-in_type <attribute_name> [=DefaultValue]
attr_assign = identifier=value |
identifier={REF(identifier=value) | REFUUID(uuid) | SETOF(identifier=value
[,identifier=value]) | LISTOF(value [,value]) | SETOFUUIDS(uuid [,uuid])}
attr_update = identifier={value | REF(identifier=value) | REFUUID(uuid)} |
identifier {= | += | -=} {SETOF(identifier=value [,identifier=value]) | LISTOF(value
[,value]) | SETOFUUIDS(uuid [,uuid])}
vertex = case-sensitive name of any existing vertex
setting_operation = SET ("SettingName"=value [,"SettingName"=value]) | GET
("SettingName" [,"SettingName"]) | REMOVE ("SettingName" [,"SettingName"]
SettingName = (DEPTH, SETREADONLY, TYPE, UUID, SHOWREVISION, SELECTTIMEOUT, ...)
selection = [reference.]identifier [= <value> | ?= <value>] [AS alias]
GQLcheatsheet examples
Examples
CREATE VERTEXCREATE VERTEXCREATE VERTEXCREATE VERTEX
CREATE VERTEX UserProfile
ATTRIBUTES (String Username, Integer Age, SET<UserProfile> Friends)
BACKWARDEDGES (UserProfile.Friends FriendOf)
UNIQUE (Username) MANDATORY (Username)
INDICES ( (Idx_Age ON ATTRIBUTES Age), (Username) )
COMMENT = "The UserProfile vertex"
CREATE VERTEX SecondUserProfile EXTENDS UserProfile
ATTRIBUTES (SET<UserProfile> Enemies, String Language = "en")
CREATE VERTEX ThirdUserProfile EXTENDS SecondUserProfile
ATTRIBUTES (LIST<String> Hobbies)
INDICES (Language)
CREATE VERTEX WeightedProfile
ATTRIBUTES (SET<WEIGHTED(Double, DEFAULT = 1.0, SORTED = DESC)<WeightedProfile>> Friends)
CREATE VERTICESCREATE VERTICESCREATE VERTICESCREATE VERTICES
CREATE VERTICES
Tag ATTRIBUTES (String Name) BACKWARDEDGES (Website.Tags TaggedSite) INDICES (Name)
Website ATTRIBUTES (String Name, String URL, SET<Tag> Tags) INDICES (Name)
ALTER VERTEXALTER VERTEXALTER VERTEXALTER VERTEX
ALTER VERTEX UserProfile
ADD ATTRIBUTES (SET<UserProfile> Enemies, UserProfile Father)
ADD INDICES ( (Idx_Age ON ATTRIBUTES Age), (Username) )
RENAME ATTRIBUTE Friends TO AllFriends
MANDATORY(Username, Age)
DEFINE(Double UndefinedProp)
UNDEFINE(DefinedProp)
COMMENT = "The UserProfile vertex"
ALTER VERTEX UserProfile
ADD BACKWARDEDGES (UserProfile.Enemies EnemyOf)
ALTER VERTEX UserProfile
ADD ATTRIBUTES (SET<WEIGHTED(Double, DEFAULT = 1.5, SORTED = ASC)<UserProfile>> WeightedFriends )
DROP MANDATORY
ALTER VERTEX UserProfile
DROP ATTRIBUTES (Enemies, Father)
DROP VERTEXDROP VERTEXDROP VERTEXDROP VERTEX
DROP VERTEX SecondUserProfile
DROP INDEXDROP INDEXDROP INDEXDROP INDEX
FROM UserProfile DROP INDEX IDX_Name
CREATE INDEXCREATE INDEXCREATE INDEXCREATE INDEX
CREATE INDEX ON UserProfile(City)
CREATE INDEX IDX_Name ON VERTEX UserProfile (Name) INDEXTYPE Hashtable
TRUNCATETRUNCATETRUNCATETRUNCATE
TRUNCATE UserProfile
INSERTORUPDATEINSERTORUPDATEINSERTORUPDATEINSERTORUPDATE
INSERTORUPDATE
UserProfile VALUES (Name = "User1", Age = 40) WHERE Name = "User1"
INSERTORUPDATE
UserProfile VALUES (Name = "User5") WHERE Name = "User5"
INSERTORREPLACEINSERTORREPLACEINSERTORREPLACEINSERTORREPLACE
INSERTORREPLACE
UserProfile VALUES (Name = "User1-new", Age = 50) WHERE Name = "User1"
INSERTINSERTINSERTINSERT
INSERT INTO UserProfile VALUES (Name = "User1", Age = 25, UUID = "ID1")
INSERT INTO UserProfile VALUES (Name = "User2", Age = 22, Friends = SETOF(Name = "User1"), UUID = "ID2")
INSERT INTO UserProfile VALUES (Name = "User3" Father = REF(Name = "User1"), Enemies = SETOF(Name = "User2"))
INSERT INTO UserProfile VALUES (Name = "User4", WeightedFriends = SETOF(Name = "User1":(1.2)))
INSERT INTO UserProfile VALUES (Name = "User5", Hobbies = LISTOF("Books","Music"))
INSERT INTO UserProfile VALUES (Name = "UndefinedAttributeUser", Weight = 70.1) /* Undefined Attribute */
INSERT INTO UserProfile VALUES (Name = "User2", Age = 22, Friends = SETOFUUIDS("ID1", "ID2"), Father = REFUUID("ID1")))
UPDATEUPDATEUPDATEUPDATE
UPDATE UserProfile SET (Friends += SETOF(Name="User2", Name="User4") ) WHERE Name = "User3"
UPDATE UserProfile SET (Friends -= SETOF(Name="User4") ) WHERE Name = "User3"
UPDATE UserProfile SET (Friends = SETOF(Name="User2"), Enemies += SETOFUUIDS("ID1") ) WHERE Name = "User3"
SELECTSELECTSELECTSELECT
FROM UserProfile U SELECT U.Friends.Friends.Name WHERE U.Name = "User1"
FROM UserProfile SELECT Name WHERE Friends.Friends.Name = "User1"
FROM UserProfile SELECT Friends.TOP(10)
DESCRIBEDESCRIBEDESCRIBEDESCRIBE
DESCRIBE TYPES
DESCRIBE VERTEX UserProfile
DESCRIBE SETTING Depth ON VERTEX UserProfile
DESCRIBE SETTING Depth ON ATTRIBUTE UserProfile.Friends
DESCRIBE SETTINGS ON DB
DESCRIBE INDEX Tag.Name
DESCRIBE FUNCTION CONCAT
REPLACEREPLACEREPLACEREPLACE
REPLACE
UserProfile VALUES (Name = "User1", Age = 50)
WHERE Name= "User1-new"
DELETEDELETEDELETEDELETE
FROM UserProfile DELETE WHERE Name = "User1"
EXPORTEXPORTEXPORTEXPORT
EXPORT AS GQL
EXPORT GDDL AS GQL
EXPORT GDML AS GQL TO "file:gdml_export.gql"
IMPORTIMPORTIMPORTIMPORT
IMPORT FROM "http://developers.sones.de/gdml_export.gql" FORMAT GQL
IMPORT FROM "file:gdml_export.gql" FORMAT GQL PARALLELTASKS(3) COMMENTS("#", "-")
LINKLINKLINKLINK
LINK UserProfile (Name = "User1") TO UserProfile (Name = "User2")
VIA Friends
UNLINKUNLINKUNLINKUNLINK
UNLINK UserProfile (Name = "User1") FROM UserProfile (Name = "User2")
VIA Friends
SETTINGSETTINGSETTINGSETTING
SETTING VERTEX User SET („DEPTH“=2)
sones
based on latest GQL specification — comments to info@sones.com are welcome — Last Update: Oct 25th, 2010 © sones
FunctionsFunctionsFunctionsFunctions
FROM UserProfile U
SELECT U.Name.CONCAT("-> Age:", U.Age) AS "Name"
FROM UserProfile U
SELECT U.Name, CURRENTDATE()
FROM UserProfile U
SELECT U.WeightedFriends.MAXWEIGHT()
FROM UserProfile U
SELECT U.Name.SUBSTRING(2,3)
FROM UserProfile U
SELECT U.Friends.Path(S.Name = "User1", 10, 10, "true", "false")
WHERE U.Name = "User2" DEPTH 1
AggregatesAggregatesAggregatesAggregates
FROM UserProfile U
SELECT AVG(U.Age)
FROM UserProfile U
SELECT AVG(U.Age), U.Name
GROUP BY U.Name
OFFSET 10
LIMIT 10

More Related Content

What's hot

Structuring React.js Components
Structuring React.js ComponentsStructuring React.js Components
Structuring React.js Components
Bartek Witczak
 
4Developers 2018: Structuring React components (Bartłomiej Witczak)
4Developers 2018: Structuring React components (Bartłomiej Witczak)4Developers 2018: Structuring React components (Bartłomiej Witczak)
4Developers 2018: Structuring React components (Bartłomiej Witczak)
PROIDEA
 
J query
J queryJ query
J query
Manav Prasad
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
ghnash
 
DOM and Events
DOM and EventsDOM and Events
DOM and Events
Julie Iskander
 
Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»e-Legion
 
Doctrator Symfony Live 2011 San Francisco
Doctrator Symfony Live 2011 San FranciscoDoctrator Symfony Live 2011 San Francisco
Doctrator Symfony Live 2011 San Franciscopablodip
 
supporting t-sql scripts for Heap vs clustered table
supporting t-sql scripts for Heap vs clustered tablesupporting t-sql scripts for Heap vs clustered table
supporting t-sql scripts for Heap vs clustered table
Mahabubur Rahaman
 
Drupal Entities - Emerging Patterns of Usage
Drupal Entities - Emerging Patterns of UsageDrupal Entities - Emerging Patterns of Usage
Drupal Entities - Emerging Patterns of Usage
Ronald Ashri
 
Better Bullshit Driven Development [SeleniumCamp 2017]
Better Bullshit Driven Development [SeleniumCamp 2017]Better Bullshit Driven Development [SeleniumCamp 2017]
Better Bullshit Driven Development [SeleniumCamp 2017]
automician
 
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
Sencha
 
Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernate
Muhammad Zeeshan
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
Allegient
 
Sqlalchemy sqlの錬金術
Sqlalchemy  sqlの錬金術Sqlalchemy  sqlの錬金術
Sqlalchemy sqlの錬金術Atsushi Odagiri
 

What's hot (18)

Structuring React.js Components
Structuring React.js ComponentsStructuring React.js Components
Structuring React.js Components
 
4Developers 2018: Structuring React components (Bartłomiej Witczak)
4Developers 2018: Structuring React components (Bartłomiej Witczak)4Developers 2018: Structuring React components (Bartłomiej Witczak)
4Developers 2018: Structuring React components (Bartłomiej Witczak)
 
J query
J queryJ query
J query
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
DOM and Events
DOM and EventsDOM and Events
DOM and Events
 
Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»
 
Mpg Dec07 Gian Lorenzetto
Mpg Dec07 Gian Lorenzetto Mpg Dec07 Gian Lorenzetto
Mpg Dec07 Gian Lorenzetto
 
Prototype Framework
Prototype FrameworkPrototype Framework
Prototype Framework
 
Doctrator Symfony Live 2011 San Francisco
Doctrator Symfony Live 2011 San FranciscoDoctrator Symfony Live 2011 San Francisco
Doctrator Symfony Live 2011 San Francisco
 
supporting t-sql scripts for Heap vs clustered table
supporting t-sql scripts for Heap vs clustered tablesupporting t-sql scripts for Heap vs clustered table
supporting t-sql scripts for Heap vs clustered table
 
Drupal Entities - Emerging Patterns of Usage
Drupal Entities - Emerging Patterns of UsageDrupal Entities - Emerging Patterns of Usage
Drupal Entities - Emerging Patterns of Usage
 
Better Bullshit Driven Development [SeleniumCamp 2017]
Better Bullshit Driven Development [SeleniumCamp 2017]Better Bullshit Driven Development [SeleniumCamp 2017]
Better Bullshit Driven Development [SeleniumCamp 2017]
 
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
 
Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernate
 
jquery
jqueryjquery
jquery
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
 
Sqlalchemy sqlの錬金術
Sqlalchemy  sqlの錬金術Sqlalchemy  sqlの錬金術
Sqlalchemy sqlの錬金術
 
Dartprogramming
DartprogrammingDartprogramming
Dartprogramming
 

Similar to GQL cheat sheet latest

Introducción rápida a SQL
Introducción rápida a SQLIntroducción rápida a SQL
Introducción rápida a SQL
Carlos Hernando
 
A Tour to MySQL Commands
A Tour to MySQL CommandsA Tour to MySQL Commands
A Tour to MySQL Commands
Hikmat Dhamee
 
Building DSLs with the Spoofax Language Workbench
Building DSLs with the Spoofax Language WorkbenchBuilding DSLs with the Spoofax Language Workbench
Building DSLs with the Spoofax Language Workbench
Eelco Visser
 
Lobos Introduction
Lobos IntroductionLobos Introduction
Lobos Introduction
Nicolas Buduroi
 
Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015
StampedeCon
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSON
Alexandre Victoor
 
Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02
Charles Ferentchak
 
Using Scala Slick at FortyTwo
Using Scala Slick at FortyTwoUsing Scala Slick at FortyTwo
Using Scala Slick at FortyTwo
Eishay Smith
 
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Eelco Visser
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
scalaconfjp
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
Ngoc Dao
 
Svcc 2013-d3
Svcc 2013-d3Svcc 2013-d3
Svcc 2013-d3
Oswald Campesato
 
SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)
Oswald Campesato
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
Daniel Cukier
 
Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02
Lalit009kumar
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
Tugdual Grall
 
JBossWS Project by Alessio Soldano
JBossWS Project by Alessio SoldanoJBossWS Project by Alessio Soldano
JBossWS Project by Alessio Soldano
Java User Group Roma
 
April 2010 - JBoss Web Services
April 2010 - JBoss Web ServicesApril 2010 - JBoss Web Services
April 2010 - JBoss Web ServicesJBug Italy
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009
Robbie Cheng
 
Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTP
Mustafa TURAN
 

Similar to GQL cheat sheet latest (20)

Introducción rápida a SQL
Introducción rápida a SQLIntroducción rápida a SQL
Introducción rápida a SQL
 
A Tour to MySQL Commands
A Tour to MySQL CommandsA Tour to MySQL Commands
A Tour to MySQL Commands
 
Building DSLs with the Spoofax Language Workbench
Building DSLs with the Spoofax Language WorkbenchBuilding DSLs with the Spoofax Language Workbench
Building DSLs with the Spoofax Language Workbench
 
Lobos Introduction
Lobos IntroductionLobos Introduction
Lobos Introduction
 
Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSON
 
Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02
 
Using Scala Slick at FortyTwo
Using Scala Slick at FortyTwoUsing Scala Slick at FortyTwo
Using Scala Slick at FortyTwo
 
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
Model-Driven Software Development - Pretty-Printing, Editor Services, Term Re...
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
Svcc 2013-d3
Svcc 2013-d3Svcc 2013-d3
Svcc 2013-d3
 
SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
 
JBossWS Project by Alessio Soldano
JBossWS Project by Alessio SoldanoJBossWS Project by Alessio Soldano
JBossWS Project by Alessio Soldano
 
April 2010 - JBoss Web Services
April 2010 - JBoss Web ServicesApril 2010 - JBoss Web Services
April 2010 - JBoss Web Services
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009
 
Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTP
 

More from sones GmbH

sones company presentation
sones company presentationsones company presentation
sones company presentation
sones GmbH
 
sones NoSQL GraphDatenbank für Bilderportale
sones NoSQL GraphDatenbank für Bilderportalesones NoSQL GraphDatenbank für Bilderportale
sones NoSQL GraphDatenbank für Bilderportalesones GmbH
 
sones auf windows azure whitepaper (german)
sones auf windows azure whitepaper (german)sones auf windows azure whitepaper (german)
sones auf windows azure whitepaper (german)sones GmbH
 
sones on windows azure whitepaper (english)
sones on windows azure whitepaper (english)sones on windows azure whitepaper (english)
sones on windows azure whitepaper (english)sones GmbH
 
Whitepaper sones GraphDB (ger)
Whitepaper sones GraphDB (ger)Whitepaper sones GraphDB (ger)
Whitepaper sones GraphDB (ger)sones GmbH
 
Whitepaper sones GraphDB (eng)
Whitepaper sones GraphDB (eng)Whitepaper sones GraphDB (eng)
Whitepaper sones GraphDB (eng)sones GmbH
 

More from sones GmbH (6)

sones company presentation
sones company presentationsones company presentation
sones company presentation
 
sones NoSQL GraphDatenbank für Bilderportale
sones NoSQL GraphDatenbank für Bilderportalesones NoSQL GraphDatenbank für Bilderportale
sones NoSQL GraphDatenbank für Bilderportale
 
sones auf windows azure whitepaper (german)
sones auf windows azure whitepaper (german)sones auf windows azure whitepaper (german)
sones auf windows azure whitepaper (german)
 
sones on windows azure whitepaper (english)
sones on windows azure whitepaper (english)sones on windows azure whitepaper (english)
sones on windows azure whitepaper (english)
 
Whitepaper sones GraphDB (ger)
Whitepaper sones GraphDB (ger)Whitepaper sones GraphDB (ger)
Whitepaper sones GraphDB (ger)
 
Whitepaper sones GraphDB (eng)
Whitepaper sones GraphDB (eng)Whitepaper sones GraphDB (eng)
Whitepaper sones GraphDB (eng)
 

Recently uploaded

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 

Recently uploaded (20)

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 

GQL cheat sheet latest

  • 1. GQLcheatsheet GQL The sones Graph Query Language (GQL) allows you to create, modify, administrate and query a graph (database). CREATE VERTEXCREATE VERTEXCREATE VERTEXCREATE VERTEX Create a user-defined vertex type CREATE [ABSTRACT] VERTEX vertex_type_def CREATE VERTICESCREATE VERTICESCREATE VERTICESCREATE VERTICES Create user-defined vertices having circular dependencies CREATE VERTICES [ABSTRACT] vertex_type_def [, [ABSTRACT] vertex_type_def]] ALTER VERTEXALTER VERTEXALTER VERTEXALTER VERTEX Manipulates a user-defined vertex ALTER VERTEX vertex ADD ATTRIBUTES(attr_definition [,attr_definition])| DROP ATTRIBUTES (identifier [,identifier]) | ADD BACKWARDEDGES (backward_edge_def [,backward_edge_def]) | DROP BACKWARDEDGES (identifier [,identifier]) | RENAME ATTRIBUTE identifier TO identifier | RENAME TO identifier | RENAME BACKWARDEDGE identifier TO identifier | UNIQUE (identifier [,identifier]) | DROP UNIQUE | DROP MANDATORY | MANDATORY (identifier [,identifier]) | DEFINE ATTRIBUTES (identifier [,identifier]) | UNDEFINE ATTRIBUTES (identifier [,identifier]) | COMMENT = "<string>" DROP VERTEXDROP VERTEXDROP VERTEXDROP VERTEX Deletes a user-defined vertex DROP VERTEX vertex CREATE INDEXCREATE INDEXCREATE INDEXCREATE INDEX Creates an index on a user-defined vertex CREATE INDEX [identifier] [EDITION edition_identifier] ON VERTEX identifier (index_attribute_list) [INDEXTYPE identifier] REBUILD INDICESREBUILD INDICESREBUILD INDICESREBUILD INDICES rebuilds all or specific index of a user-defined vertex REBUILD INDICES [vertex [,vertex]] DROP INDEXDROP INDEXDROP INDEXDROP INDEX Deletes an index of a user-defined vertex FROM vertex DROP INDEX index_identifier [EDITION edition_identifier] INSERTINSERTINSERTINSERT Insert an object into a graph INSERT INTO Identifier VALUES (attr_assign [,attr_assign]) [WHERE where_condition] INSERTORUPDATEINSERTORUPDATEINSERTORUPDATEINSERTORUPDATE Inserts or Updates an object into a graph INSERTORUPDATE vertex VALUES (attr_assign [,attr_assign]) [WHERE where_condition] INSERTORREPLACEINSERTORREPLACEINSERTORREPLACEINSERTORREPLACE Inserts or Replaces an object into a graph INSERTORREPLACE vertex VALUES (attr_assign [,attr_assign]) [WHERE where_condition] UPDATEUPDATEUPDATEUPDATE Updates an object within a graph UPDATE vertex SET (attr_update [,attr_update]) [WHERE where_condition] REPLACEREPLACEREPLACEREPLACE Replaces an object within a graph REPLACE vertex VALUES (attr_assign [,attr_assign]) WHERE where_condition DELETEDELETEDELETEDELETE Deletes attributes from an vertex or the vertex itself FROM vertex DELETE [identifier [,identifier] ] [WHERE where_condition] EXPORTEXPORTEXPORTEXPORT Create a complete (query) dump in different formats EXPORT [VERTICES vertex [,vertex]] [{GDDL|GDML|ALL}] [AS {GQL}] [TO {‘file:...‘ | ‘http://...‘}] IMPORTIMPORTIMPORTIMPORT Import queries IMPORT FROM {‘file:...‘ | ‘http://...‘} FORMAT {GQL} [PARALLELTASKS(number)] [COMMENTS(‘value‘ [,‘value‘])] LINKLINKLINKLINK Add edges between vertices LINK vertex (identifier=value [,identifier=value]) TO vertex (identifier=value [,identifier=value]) VIA edge_attribute UNLINKUNLINKUNLINKUNLINK Remove edges between vertices UNLINK vertex (identifier=value [,identifier=value]) FROM vertex (identifier=value [,identifier=value]) VIA edge_attribute TRUNCATETRUNCATETRUNCATETRUNCATE Removes all records from a user-defined vertex TRUNCATE vertex DESCRIBEDESCRIBEDESCRIBEDESCRIBE Get information on items within the database DESCRIBE AGGREGATES | DESCRIBE AGGREGATE identifier | DESCRIBE EDGES | DESCRIBE EDGE identifier | DESCRIBE FUNCTIONS | DESCRIBE FUNCTION identifier | DESCRIBE INDICES | DESCRIBE INDEX identifier [edition] | DESCRIBE SETTINGS [ON VERTEX vertex | ON ATTRIBUTE attr_definition | ON DB | ON SESSION] | DESCRIBE SETTING identifier [ON VERTEX vertex | ON ATTRIBUTE attribute | ON DB | ON SESSION] DESCRIBE TYPES | DESCRIBE VERTEX vertex SETTINGSETTINGSETTINGSETTING Set, get or remove a setting (in a session or global) SETTING DB setting_operation | SETTING SESSION setting_operation | SETTING [TYPE | VERTEX] identifier setting_operation | SETTING ATTRIBUTE identifier setting_operation SELECTSELECTSELECTSELECT Retrieve objects or their data from a graph FROM identifier [reference] [,identifier [= <value>] [reference]] SELECT * | # | - | > | < | selection [,selection] | @Primitive-Datatype [,@Primitive-Datatype] [WHERE where_condition] [GROUP BY identifier] [ORDER BY identifier] [OFFSET <number>] [LIMIT <number>] [DEPTH <number>] BUILTBUILTBUILTBUILT----IN Datatypes (case sensitive)IN Datatypes (case sensitive)IN Datatypes (case sensitive)IN Datatypes (case sensitive) Integer, UnsignedInteger, Double, String, Boolean, DateTime, List<Primitive-Datatype>, SET<Primitive-Datatype>, SET<Userdefined-Datatype> Aggregates / FunctionsAggregates / FunctionsAggregates / FunctionsAggregates / Functions COUNT | AVG | CONCAT | TOUPPER | MAXWEIGHT | SUBSTRING | TOP | PATH | ... CommentsCommentsCommentsComments sonesLogin and Access sones graphDB can be accessed through a number of different interfaces like SOAP WebService, REST - even a WebShell running inside every browser is available. WebShell sones graphDB WebShell is a unix-like shell in a web browser allowing the user to interact with an instance of a sones graphDB. It is based on well-known technologies and libraries like HTML, JavaScript, JQuery and our RESTRESTRESTREST APIAPIAPIAPI. Authentication is mandatory. Anyone can gain access to a personalized instance by logging on to http://www.sones.com. useful commands: sample json output: { "query": "FROM User u SELECT *", "result": "Successful", "warnings": [], "errors": [], "results": [{ "Username": "User1", "Age": "25" }], "Duration": ["1","ms"] } commandcommandcommandcommand parametersparametersparametersparameters descriptiondescriptiondescriptiondescription help n/a displays help text clear n/a clears the screen format xml | json | text by default results are displays as xml. Output REST The REST API can be used to run GQL queries. The query is encapsulated into the URL (URL encoded) and data then is returned in the specified format (xml / json / text). Basic authentication is mandatory. based on latest GQL specification — comments to info@sones.com are welcome — Last Update: Oct 25th, 2010 © sones GmbH vertex_type_def = identifier [EXTENDS Identifier] [ATTRIBUTES(attr_definition [,attr_definition])] [BACKWARDEDGES(backward_edge_def [,backward_edge_def])] [UNIQUE (identifier [,identifier])] [MANDATORY(identifier [,identifier])] [INDICES (index_on_create)] [COMMENT = "<string>"] attr_definition = built-in_type <attribute_name> [=DefaultValue] attr_assign = identifier=value | identifier={REF(identifier=value) | REFUUID(uuid) | SETOF(identifier=value [,identifier=value]) | LISTOF(value [,value]) | SETOFUUIDS(uuid [,uuid])} attr_update = identifier={value | REF(identifier=value) | REFUUID(uuid)} | identifier {= | += | -=} {SETOF(identifier=value [,identifier=value]) | LISTOF(value [,value]) | SETOFUUIDS(uuid [,uuid])} vertex = case-sensitive name of any existing vertex setting_operation = SET ("SettingName"=value [,"SettingName"=value]) | GET ("SettingName" [,"SettingName"]) | REMOVE ("SettingName" [,"SettingName"] SettingName = (DEPTH, SETREADONLY, TYPE, UUID, SHOWREVISION, SELECTTIMEOUT, ...) selection = [reference.]identifier [= <value> | ?= <value>] [AS alias]
  • 2. GQLcheatsheet examples Examples CREATE VERTEXCREATE VERTEXCREATE VERTEXCREATE VERTEX CREATE VERTEX UserProfile ATTRIBUTES (String Username, Integer Age, SET<UserProfile> Friends) BACKWARDEDGES (UserProfile.Friends FriendOf) UNIQUE (Username) MANDATORY (Username) INDICES ( (Idx_Age ON ATTRIBUTES Age), (Username) ) COMMENT = "The UserProfile vertex" CREATE VERTEX SecondUserProfile EXTENDS UserProfile ATTRIBUTES (SET<UserProfile> Enemies, String Language = "en") CREATE VERTEX ThirdUserProfile EXTENDS SecondUserProfile ATTRIBUTES (LIST<String> Hobbies) INDICES (Language) CREATE VERTEX WeightedProfile ATTRIBUTES (SET<WEIGHTED(Double, DEFAULT = 1.0, SORTED = DESC)<WeightedProfile>> Friends) CREATE VERTICESCREATE VERTICESCREATE VERTICESCREATE VERTICES CREATE VERTICES Tag ATTRIBUTES (String Name) BACKWARDEDGES (Website.Tags TaggedSite) INDICES (Name) Website ATTRIBUTES (String Name, String URL, SET<Tag> Tags) INDICES (Name) ALTER VERTEXALTER VERTEXALTER VERTEXALTER VERTEX ALTER VERTEX UserProfile ADD ATTRIBUTES (SET<UserProfile> Enemies, UserProfile Father) ADD INDICES ( (Idx_Age ON ATTRIBUTES Age), (Username) ) RENAME ATTRIBUTE Friends TO AllFriends MANDATORY(Username, Age) DEFINE(Double UndefinedProp) UNDEFINE(DefinedProp) COMMENT = "The UserProfile vertex" ALTER VERTEX UserProfile ADD BACKWARDEDGES (UserProfile.Enemies EnemyOf) ALTER VERTEX UserProfile ADD ATTRIBUTES (SET<WEIGHTED(Double, DEFAULT = 1.5, SORTED = ASC)<UserProfile>> WeightedFriends ) DROP MANDATORY ALTER VERTEX UserProfile DROP ATTRIBUTES (Enemies, Father) DROP VERTEXDROP VERTEXDROP VERTEXDROP VERTEX DROP VERTEX SecondUserProfile DROP INDEXDROP INDEXDROP INDEXDROP INDEX FROM UserProfile DROP INDEX IDX_Name CREATE INDEXCREATE INDEXCREATE INDEXCREATE INDEX CREATE INDEX ON UserProfile(City) CREATE INDEX IDX_Name ON VERTEX UserProfile (Name) INDEXTYPE Hashtable TRUNCATETRUNCATETRUNCATETRUNCATE TRUNCATE UserProfile INSERTORUPDATEINSERTORUPDATEINSERTORUPDATEINSERTORUPDATE INSERTORUPDATE UserProfile VALUES (Name = "User1", Age = 40) WHERE Name = "User1" INSERTORUPDATE UserProfile VALUES (Name = "User5") WHERE Name = "User5" INSERTORREPLACEINSERTORREPLACEINSERTORREPLACEINSERTORREPLACE INSERTORREPLACE UserProfile VALUES (Name = "User1-new", Age = 50) WHERE Name = "User1" INSERTINSERTINSERTINSERT INSERT INTO UserProfile VALUES (Name = "User1", Age = 25, UUID = "ID1") INSERT INTO UserProfile VALUES (Name = "User2", Age = 22, Friends = SETOF(Name = "User1"), UUID = "ID2") INSERT INTO UserProfile VALUES (Name = "User3" Father = REF(Name = "User1"), Enemies = SETOF(Name = "User2")) INSERT INTO UserProfile VALUES (Name = "User4", WeightedFriends = SETOF(Name = "User1":(1.2))) INSERT INTO UserProfile VALUES (Name = "User5", Hobbies = LISTOF("Books","Music")) INSERT INTO UserProfile VALUES (Name = "UndefinedAttributeUser", Weight = 70.1) /* Undefined Attribute */ INSERT INTO UserProfile VALUES (Name = "User2", Age = 22, Friends = SETOFUUIDS("ID1", "ID2"), Father = REFUUID("ID1"))) UPDATEUPDATEUPDATEUPDATE UPDATE UserProfile SET (Friends += SETOF(Name="User2", Name="User4") ) WHERE Name = "User3" UPDATE UserProfile SET (Friends -= SETOF(Name="User4") ) WHERE Name = "User3" UPDATE UserProfile SET (Friends = SETOF(Name="User2"), Enemies += SETOFUUIDS("ID1") ) WHERE Name = "User3" SELECTSELECTSELECTSELECT FROM UserProfile U SELECT U.Friends.Friends.Name WHERE U.Name = "User1" FROM UserProfile SELECT Name WHERE Friends.Friends.Name = "User1" FROM UserProfile SELECT Friends.TOP(10) DESCRIBEDESCRIBEDESCRIBEDESCRIBE DESCRIBE TYPES DESCRIBE VERTEX UserProfile DESCRIBE SETTING Depth ON VERTEX UserProfile DESCRIBE SETTING Depth ON ATTRIBUTE UserProfile.Friends DESCRIBE SETTINGS ON DB DESCRIBE INDEX Tag.Name DESCRIBE FUNCTION CONCAT REPLACEREPLACEREPLACEREPLACE REPLACE UserProfile VALUES (Name = "User1", Age = 50) WHERE Name= "User1-new" DELETEDELETEDELETEDELETE FROM UserProfile DELETE WHERE Name = "User1" EXPORTEXPORTEXPORTEXPORT EXPORT AS GQL EXPORT GDDL AS GQL EXPORT GDML AS GQL TO "file:gdml_export.gql" IMPORTIMPORTIMPORTIMPORT IMPORT FROM "http://developers.sones.de/gdml_export.gql" FORMAT GQL IMPORT FROM "file:gdml_export.gql" FORMAT GQL PARALLELTASKS(3) COMMENTS("#", "-") LINKLINKLINKLINK LINK UserProfile (Name = "User1") TO UserProfile (Name = "User2") VIA Friends UNLINKUNLINKUNLINKUNLINK UNLINK UserProfile (Name = "User1") FROM UserProfile (Name = "User2") VIA Friends SETTINGSETTINGSETTINGSETTING SETTING VERTEX User SET („DEPTH“=2) sones based on latest GQL specification — comments to info@sones.com are welcome — Last Update: Oct 25th, 2010 © sones FunctionsFunctionsFunctionsFunctions FROM UserProfile U SELECT U.Name.CONCAT("-> Age:", U.Age) AS "Name" FROM UserProfile U SELECT U.Name, CURRENTDATE() FROM UserProfile U SELECT U.WeightedFriends.MAXWEIGHT() FROM UserProfile U SELECT U.Name.SUBSTRING(2,3) FROM UserProfile U SELECT U.Friends.Path(S.Name = "User1", 10, 10, "true", "false") WHERE U.Name = "User2" DEPTH 1 AggregatesAggregatesAggregatesAggregates FROM UserProfile U SELECT AVG(U.Age) FROM UserProfile U SELECT AVG(U.Age), U.Name GROUP BY U.Name OFFSET 10 LIMIT 10