SlideShare a Scribd company logo
An Algebraic Data Model for Graphs and Hypergraphs
Bonus Intro to Category Theory
November 21, 2019
Joshua Shinavier, PhD (Uber)
• Graphs
• Categories
• Data Models
• Algebraic Property Graphs
Outline
Graphs
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
TinkerFactory.createClassic() + vertex labels
Graph structure
Categories
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An object
An arrow (morphism)
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
Composition
Associativity
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
Identity
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
An isomorphism
An isomorphism: f-1
∘f = ida
, f∘f-1
= idb
An isomorphism
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
Composition of isomorphisms
A category
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
A functor
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
Graphs and graph operations
An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)
Transformations
Data models
• Property Graphs
• Resource Description Framework (RDF)
• Relational Model
• SQL, CQL, HQL, DQL, ...
• Data interchange formats
• Protocol Buffers, Apache Thrift, Apache Avro
• Mostly based on algebraic data types (ADTs)
Some data models of interest (@ Uber)
• A simple interpretation1
I of an RDF graph is:
• A non-empty set IR of resources, called the domain or universe of I
• A set IP, called the set of properties of I
• A mapping IEXT from IP into 𝒫(IR x IR), i.e. the set of sets of pairs <x, y> with
x and y in IR
• Assuming:
• Ground RDF graphs only (⇒ no blank nodes)
Resource Description Framework (RDF)
1) World Wide Web Consortium. (2014). RDF 1.1 concepts and abstract syntax.
• Simple.
• Vertices, edges, properties
• No standard
• W3C Property Graphs working group (2013)
• W3C Graph Data Workshop (March 2019)
• Next best thing?
• TinkerPop’s Graph.Features
Property Graph data model
• Many are concerned with the data model
• Vertex/edge id data types
• Numeric, string, UUID, “any”
• Property support
• Supports vertex properties? edge properties? vertex metaproperties?
• Multi-properties?
• Property data types
• Primitive: boolean, byte, double, float, integer, long, string
• Complex: array, map, list (uniform/mixed), serializable
TinkerPop’s Graph.Features
Property graph objects
v = a vertex label (e.g. Person, Place, Dataset)
e = an edge label (e.g. knows, likes, claims)
p = a property key (e.g. name, weight)
d = a data type (e.g. String, Integer, List<String>)
Edges
Vertex properties
Edge properties
Vertex meta-properties
Meta-edges: edge to vertex
Meta-edges: vertex to edge
Bonus: hyper-edges
Bonus: RDF statements
Algebraic Property Graphs
A formal data model for enterprise Property Graphs
● Things we need
○ Formal schema & mapping language for property graphs
○ Framework for graph transformation and integration
○ Means to build virtual graphs out of non-graph datasets (and vice versa)
● Algebraic Property Graphs
○ Based on algebraic data types
○ Strong connections to type theory, database theory, and category theory:
■ A familiar approach to type inference
■ Easy to reason about: all operations and proofs mechanically verified in Coq
■ Generalizes to algebraic databases
Product and sum types, identifiers, and values
● APG:
● Thrift example:
Algebraic types in common data interchange languages
Graph, schema, and data
Natural Transformations of Graphs, Schemas, and Data
● Non-natural transformations are also useful and are described in our paper.
Taxonomy of graph elements
● Vertex: “no data”.
● Edge: ordered pair of elements.
● Property: ordered pair (element, value).
○ Vertex property: element is a vertex.
○ Edge property: element is an edge
○ Meta-property: element is another property
■ Vertex / edge metaproperty, etc.
● Alias: contains another element
○ Vertex or edge “tags”
○ Aliases for primitive data types
● Hyperelement: everything else
Useful operations on Graphs, schemas, and data
● Conjunctive and disjunctive queries (select/from/where/union)
○ In: APGs and a predicate. Out: APG
● Views
○ In: APG and APG schema mapping. Out: ‘virtual’ APG
● Convert APGs to algebraic databases, and vice versa
○ In: Schema mapping and APG / algebraic database. Out: algebraic database / APG.
Thanks
● joshsh@uber.com
● ryan@conexus.ai
https://arxiv.org/abs/1909.04881
(submitted to ICDT)

More Related Content

PDF
Transpilers Gone Wild: Introducing Hydra
PDF
A Graph is a Graph is a Graph: Equivalence, Transformation, and Composition o...
PDF
Strings in Python
PPTX
Python and its Applications
PDF
What is Tuple in python? | Python Tuple Tutorial | Edureka
PDF
Evolution of the Graph Schema
PDF
What is Python Lambda Function? Python Tutorial | Edureka
PPTX
Iterarators and generators in python
Transpilers Gone Wild: Introducing Hydra
A Graph is a Graph is a Graph: Equivalence, Transformation, and Composition o...
Strings in Python
Python and its Applications
What is Tuple in python? | Python Tuple Tutorial | Edureka
Evolution of the Graph Schema
What is Python Lambda Function? Python Tutorial | Edureka
Iterarators and generators in python

What's hot (20)

PDF
Python Programming Language | Python Classes | Python Tutorial | Python Train...
PDF
Python libraries
PPT
Generics in java
PDF
Python Collections Tutorial | Edureka
PPTX
Chapter 05 classes and objects
PPTX
String Builder & String Buffer (Java Programming)
PDF
Data Visualization in Python
PDF
pandas - Python Data Analysis
PPT
Python ppt
ODP
Python Modules
PDF
Python Variable Types, List, Tuple, Dictionary
PDF
JavaScript - Chapter 4 - Types and Statements
PPT
Java 8 Streams
PPTX
Advanced Python : Decorators
PDF
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
PDF
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
PPTX
Java script
PPTX
Chapter 03 python libraries
PDF
Datatypes in python
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python libraries
Generics in java
Python Collections Tutorial | Edureka
Chapter 05 classes and objects
String Builder & String Buffer (Java Programming)
Data Visualization in Python
pandas - Python Data Analysis
Python ppt
Python Modules
Python Variable Types, List, Tuple, Dictionary
JavaScript - Chapter 4 - Types and Statements
Java 8 Streams
Advanced Python : Decorators
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Java script
Chapter 03 python libraries
Datatypes in python
Ad

Similar to An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019) (20)

PPTX
Algebraic Property Graphs (GQL Community Update, oct. 9, 2019)
PDF
Multi-Model Data Query Languages and Processing Paradigms
PDF
Stream processing: The Matrix Revolutions
PDF
Category calculus and algebra for multi-model databases
PDF
Graph database in sv meetup
PPTX
Machine learning with Spark
PDF
Functional and Algebraic Domain Modeling
PPTX
Graph Databases
PDF
Essentials of R
PDF
Graph technology meetup slides
PPTX
Graph Databases & OrientDB
PPT
HyperGraphDb
PPTX
Inductive Triple Graphs: A purely functional approach to represent RDF
PDF
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...
PDF
Graph Abstractions Matter by Ora Lassila
PDF
AgensGraph Presentation at PGConf.us 2017
PDF
week1 - What_Is_A_Knowledge_Graphs_S.pdf
PPTX
Introduction to datastructures presentation
PPTX
Graph Databases
Algebraic Property Graphs (GQL Community Update, oct. 9, 2019)
Multi-Model Data Query Languages and Processing Paradigms
Stream processing: The Matrix Revolutions
Category calculus and algebra for multi-model databases
Graph database in sv meetup
Machine learning with Spark
Functional and Algebraic Domain Modeling
Graph Databases
Essentials of R
Graph technology meetup slides
Graph Databases & OrientDB
HyperGraphDb
Inductive Triple Graphs: A purely functional approach to represent RDF
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...
Graph Abstractions Matter by Ora Lassila
AgensGraph Presentation at PGConf.us 2017
week1 - What_Is_A_Knowledge_Graphs_S.pdf
Introduction to datastructures presentation
Graph Databases
Ad

More from Joshua Shinavier (13)

PDF
Anything-to-Graph
PDF
TinkerPop 2020
PDF
In Search of the Universal Data Model (ISWC 2019 Minute Madness)
PDF
In Search of the Universal Data Model (Connected Data London 2019)
PDF
Building an Enterprise Knowledge Graph @Uber: Lessons from Reality
PDF
TinkerPop: a story of graphs, DBs, and graph DBs
PDF
Semantics and Sensors
PDF
semantic markup using schema.org
PDF
The Real-time Web in the Age of Agents
PDF
Linked Process
PDF
Real-time Semantic Web with Twitter Annotations
PDF
Real-time #SemanticWeb in 140 chars
PDF
The state of the art in Linked Data
Anything-to-Graph
TinkerPop 2020
In Search of the Universal Data Model (ISWC 2019 Minute Madness)
In Search of the Universal Data Model (Connected Data London 2019)
Building an Enterprise Knowledge Graph @Uber: Lessons from Reality
TinkerPop: a story of graphs, DBs, and graph DBs
Semantics and Sensors
semantic markup using schema.org
The Real-time Web in the Age of Agents
Linked Process
Real-time Semantic Web with Twitter Annotations
Real-time #SemanticWeb in 140 chars
The state of the art in Linked Data

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Approach and Philosophy of On baking technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Programs and apps: productivity, graphics, security and other tools
Mobile App Security Testing_ A Comprehensive Guide.pdf
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
Per capita expenditure prediction using model stacking based on satellite ima...
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Approach and Philosophy of On baking technology
Digital-Transformation-Roadmap-for-Companies.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Building Integrated photovoltaic BIPV_UPV.pdf
Spectral efficient network and resource selection model in 5G networks
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Agricultural_Statistics_at_a_Glance_2022_0.pdf

An Algebraic Data Model for Graphs and Hypergraphs (Category Theory meetup, November 2019)