Explicit Semantics in Neo4j:
Ontologies and Knowledge
Graphs
Jesús Barrasa - Neo4j
Jesús Barrasa
@BarrasaDV
Who’s this talk for?
What is an Ontology?
Some popular ontologies...
FIBO Ontology by the EDM council
Schema.org used by Google’s knowledge graph
The Biological and Biomedical ontologies in the
OBO Foundry (i.e. Gene Ontology…)
The Open Graph Protocol
How are ontologies used?
Interoperability: Definitions of shared vocabularies
Inferencing: Actionable knowledge fragments
W3C Standards
2000: RDFS 1.0
2004: OWL 1.0
2014: RDFS 1.1
What do ontologies look like? FIBO
https://spec.edmcouncil.org/fibo/
What do ontologies look like? Schema.org
https://schema.org/
Part 1: Interoperability
Enabling Integration
Publishing my Neo4j graph’s Ontology
Creating a Linked Data endpoint…
… according to STD vocabularies
Exporting/Publishing Neo4j data as RDF
Model Mapping + Publishing
Let’s try it!
Part 2: Inferencing
Inferencing in Neo4j
Where are my Semantics?
Q: I want all accounts for clients in NY in
my Knowledge Graph
MATCH (ac)-[:ACC_ZIP]->()-[:IN_STATE]->(:State { stateCode: ‘NY’})
WHERE ac:LoanOrCreditAccount OR ac:InvestmentAccount OR
ac:TransactionDepositAccount OR ac:TimeDepositAccount ...
RETURN ac.acctBalance, ac.acctId
Explicit, declarative description of domain
semantics… (an ontology)
https://spec.edmcouncil.org/fibo/widoco/master/latest/FBC/ProductsAndServices/ClientsAndAccounts/index-en.html#classes
Where are my Semantics? (version 2)
Q: I want all accounts for clients in NY in
my Knowledge Graph
MATCH (ac)-[:ACC_ZIP]->()-[:IN_STATE]->(:State { stateCode: ‘NY’})
WHERE semantics.inference.hasLabel(ac,Account)
RETURN ac.acctBalance, ac.acctId
Implicit vs Explicit Semantics
Let’s try it!
Demo details
Dataset: Lending Club Loan data
[https://www.kaggle.com/wendykan/lending-club-loan-data]
Ontology: FIBO (Production Quickstart)
[https://spec.edmcouncil.org/fibo/OWL]
Semantic Graph Platform: Neo4j [https://neo4j.com/download/] &
NSMNTX [https://neo4j.com/labs/nsmtx-rdf/]
Code: <in Neo4j browser type> :play field/semantics.html
[source: https://github.com/jbarrasa/datasets/tree/master/ontos]
NEOSEMANTIX
What is NSMNTX?
NSMNTX is a plugin that enables the use of RDF in Neo4j
● Store RDF data in Neo4j in a lossless manner
● On-demand export property graph data from Neo4j as RDF
● model mapping
● Inferencing
https://neo4j.com/labs
https://neo4j.com/labs/nsmtx-rdf
Join the community!
https://community.neo4j.com/c/integrations/linked-data-rdf-ontology
Conclusions
RDF ≠ Semantics: RDF + RDFS/OWL are just the medium
Don’t listen to “analysts” and (triple store) vendors when they
talk about Semantics as something arcane or “RDF’s magic”
Do “Just enough semantics”
Thank you!

Neo4j GraphTour New YorkOntologies and Knowledge Graphs