Storing and modeling data as vertices/nodes and the interconnected edges. Representing discrete data points as vertices and the relationships between them as edges
Discrete data points
The relationship between discrete data points
Moving between different data points in side the Graph for insights
Give me all vertices that are 1 edge/relationship away from Person A
[ ["Person A", "spouse", "Person B"], ["Person A", "guardian of", "Person D"] ]
Give me all vertices that are 2 edge/relationship away from Person A
[ ["Person A", "spouse", "Person B", "spouse", "Person C"], ["Person A", "spouse", "Person B", "guardian of", "Person E"] ]
aka Social Networks
https://en.wikipedia.org/wiki/Social_graph https://en.wikipedia.org/wiki/Erd%C5%91s_number
Matching items to other items based on the relationships between them
Detecting patterns that don't follow normal trends
Read queries that are likely to use a lot of memory or table lock for a prolonged time
HTTP RESTful API> >
https://console.ng.bluemix.net/catalog/services/ibm-graph/
https://console.eu-gb.bluemix.net/catalog/services/ibm-graph/
Make POST, PUT, GET & DELETE queries to manipulate the vertices
https://ibm-graph-docs.ng.bluemix.net/api.html#vertex-apis
Example:
curl $GRAPHURL/vertices -X POST -H "Content-Type: application/json" -d "{ \"key1\":\"A\", \"key2\":\"B\" }"
Make POST, PUT, GET & DELETE queries to manipulate the edges
https://ibm-graph-docs.ng.bluemix.net/api.html#edge-apis
Example:
curl $GRAPHURL/edges -X POST -H "Content-Type: application/json" -d "{ \"outV'": 256, \"label\": \"knows\", \"inV\": 512 }"
Make POST, PUT, GET & DELETE queries to manipulate the indexes
https://ibm-graph-docs.ng.bluemix.net/api.html#index-apis
Example:
curl $GRAPHURL/index?type=vertex -X POST -H "Content-Type: application/json" -d "{ \"type\": \"vertex\", \"propertyKeys'": [{\"name\": \"personName\", \"dataType\": \"String\", \"cardinality\": \"SINGLE\"}], \"indexOnly\": {\"name\": \"person\"}, \"composite\": true, \"name\": \"vByPerson\"}"
Make POST & GET queries to manipulate the schemas
https://ibm-graph-docs.ng.bluemix.net/api.html#schema-apis
Example:
curl $GRAPHURL/schema -X POST -H "Content-Type: application/json" -d "{ \"edgeindexes\": [], \"edgelabels\": [ {\"multiplicity\":\"simple\", \"name\":\"r\"} ], \"propertykeys\": [ {\"cardinality\":\"single\", \"datatype\":\"string\", \"name\":\"c\"} ], \"vertexindexes\": [ {\"composite\":false, \"name\":\"ci\", \"propertykeys\":[ \"c\" ], \"unique\":false} ], \"vertexlabels\": [ {\"name\": \"l\"} ] }"
Make POST queries to manipulate your entire Graph
https://ibm-graph-docs.ng.bluemix.net/api.html#gremlin-apis
Example:
curl $GRAPHURL/gremlin -X POST -H "Content-Type: application/json" -d "{\"gremlin\": \"def g = graph.traversal(); g.V(256).out().out()\"}"
Example of Gremlin in Social Graphs