Dev07
Once You Go Graph
Nathan T Freeman
Nathan T Freeman
@ntf
redpillnow.comwww
Acapulco, Mexico
Nathanfreeman.wordpress.com
Challenge the way you think about Notes data
Change the way you approach your next project
Bring you faster, better results with your own data
Whatis a graph?
a database in which relationships are records
Does notuse indexes
for relationships
Records are key value pairs
An entity is called aVertex (or Node)
A Relationship is called an
Edge
Edges have
label properties* almost always verbs
Graph Database
VertexConnects
Records-Data-In
Property
Has Has
Edge
Key-Value PairIs-A
Can-Be-A
Whyuse a graph?
Flexibility
Scalability
Performancibility
Whouses graphs?
Open G
raph
Microsoft G
raph
Know
ledge Graph
By 2017 25% of enterprises will be
using graph databases
Market Overview: Graph Databases - Forrester Research, May 2015
Whatare graphs used for?
The World Today
Social Networks
FraudDetection
Network&
IT Operations
Real Time Suggestions
Master Data Management
Howdo you use graphs?
CustomerName: Red Pill Now Add a vertex
with some properties
CustomerName: Red Pill Now
Purchase OrderOrderNumber: 003256
Add another
vertex with some properties
CustomerName: Red Pill Now
Orders
Purchase OrderOrderNumber: 003256
Add an edge between them
CustomerName: Red Pill Now
Orders
Purchase OrderOrderNumber: 003256
ProductProductName: Surface Pro 4Description: Window tablet computer
ContainsUnit Price: $999Quantity: 4
Repeat
CustomerName: Red Pill Now
Orders
ProductProductName: Surface Pro 4Description: Window tablet computer
ContainsUnit Price: $999Quantity: 4
Find a Vertex
Purchase OrderOrderNumber: 003256
CustomerName: Red Pill Now
ProductProductName: Surface Pro 4Description: Window tablet computer
Iterate itsEdges
Orders
Purchase OrderOrderNumber: 003256
ContainsUnit Price: $999Quantity: 4
CustomerName: Red Pill Now
Orders
Purchase OrderOrderNumber: 003256
ProductProductName: Surface Pro 4Description: Window tablet computer
ContainsUnit Price: $999Quantity: 4
Repeat
Whatare some graphs?
Graph D
atabases
ClusterableGreat licensing
Transactional Sharded
Multi-modal: all records are simultaneously graph elements, documents and maps
Domino API
Great licensingClusterable
Transactional Sharded
Multi-modal: all records are simultaneously graph elements, documents and maps
Is the Penny Dropping?
Frames
Pipes
Furnace
Blueprints
RexsterGremlin
JDBCFor Graphs
What Are Frames?
Java objects stored in graphs
Interfacecentric
Annotation based
VertexFrame: LikeableVertexFrame: LikerEdgeFrame: Likes
Example 1 – Simple Social Graph
VertexFrame: Replica extends Likeablereplicaid, title
VertexFrame: Databaseserver, filepath
EdgeFrame: InstanceOf Replica <-> Database
VertexFrame: Viewtitle, isCalendar
EdgeFrame: FoundIn Replica <-> View
EdgeFrame: IndexedIn Database <-> View isBuilt
Example 2 – Red Pill Now Forensics
VertexFrame: PersonfirstName, lastName
VertexFrame: Organizationname, website
EdgeFrame: WorksAt Person <-> Organizationtitle, startDate, endDate
Nathan Freeman WorksAt Red Pill NowSoftware Architect, Oct 2013
Nathan Freeman WorksAt OpenNTF.orgCo-founder, Jan 2001
Nathan Freeman WorksAt GBSSoftware Engineer, Sep 2009, Oct 2013
Example 3 – Contacts
Frames Builtins
Identity graph
Social graph
Conference graph
Workflow graph
Spotlight: Conference Graph
Conference
Attendee
Presentation
Sponsor
Social
TimeSlot
MeetingLocation
Includes
Attending
HappeningIn HappeningAt
HasLocations
Includes
RegisteredFor Sponsoring
Presenting
HappeningIn
HappeningIn
HappeningAt
IncludesSchedules
Roll Your Own
Any NSF can be
included in a graph
Any number of NSFs can
be included
Any form can be used to define a frame
Any document can be a vertex
Any view can be a
vertex
Any view entry can be an
edge
• DAS Extension• Currently only provides Frames, but
Vertex/Edge is coming• Base URL - http://server/api/oda/• /frames/ for collections• /frame/ for elements• /[name of graph]/
REST API Routes
• id=• type=• key=• filterkey=, filtervalue=• partialkey=, partialvalue=• start=, count=• orderby=
REST API Parameters
http://server/api/oda/frames/now?type=Database…/frames/now?type=Item&filterkey=type&filtervalue=Author.../frame/now?id=86257F15006F1DE952B9E3E57D3E34AA837F200B4D2D0E5A…/frame/now?id=86257F15006F1DE9E4656D86A5C03FDA8F4E138F18F2C5E4&edges…/frame/now?id=…&label=foundIn
Postman demos
Documentation available at
https://github.com/OpenNTF/org.openntf.domino/wiki
REST API Examples – Red Pill Now