SlideShare a Scribd company logo
Analytics and Data Summit 2019
Build Knowledge Graphs with Oracle RDF to Extract More
Value from Your Data
Souri Das Matthew Perry Melliyal Annamalai
Oracle Spatial and Graph
Spatial and Graph Summit @
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, timing, and pricing of any
features or functionality described for Oracle’s products may change and remains at the
sole discretion of Oracle Corporation.
Confidential – Oracle Internal/Restricted/Highly Restricted 2
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Agenda
3
Definition and Use Cases for Knowledge Graphs
Modeling Knowledge Graphs using W3C RDF
Using Oracle RDF Knowledge Graph
Performing Analytics with RDF Knowledge Graph Data
1
2
3
4
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Agenda
4
Definition and Use Cases for Knowledge Graphs
Modeling Knowledge Graphs using W3C RDF
Using Oracle RDF Knowledge Graph
Performing Analytics with RDF Knowledge Graph Data
1
2
3
4
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
What is a Knowledge Graph?
• Knowledge graphs are large networks of entities, their semantic types,
properties, and relationships between entities1.
• Key Features:
– Things not strings
• global unique identifiers
– Formal structure/semantics
• machine processable, unambiguous
– Linked descriptions
• resources are described by their connections
1. M. Kroetsch and G. Weikum. Journal of Web Semantics: Special Issue on Knowledge Graphs.
http://www.websemanticsjournal.org/index.php/ps/announcement/view/19 [August, 2016]
Database
Knowledge
Base
Graph
Knowledge
Graph
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Knowledge Graph Examples1
1. Heiko Paulheim. Journal of Web Semantics: Special Issue on Knowledge Graph Refinement. Preprint.
“Knowledge Graph Refinement: A Survey of Approaches and Evaluation Methods.” [September, 2016]
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Use Case: Linked Data Publishing
• Publishing data in a standard way
so that it can be more easily
consumed
• Popular way for government
agencies to publish public data
• Why RDF?
– URIs
– Flexible data model
– Standard vocabularies
– Standard protocols
Italy
National Institute of Statistics
Japan
National Statistics Center
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Use Case: Linked Data Publishing
• Publishing data in a standard way
so that it can be more easily
consumed
• Popular way for government
agencies to publish public data
• Why RDF?
– URIs
– Flexible data model
– Standard vocabularies
– Standard protocols
https://lod-cloud.net/ 1,200+ linked datasets
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Business Challenge
• Link database information on genes,
proteins, metabolic pathways, compounds,
ligands, etc. to original sources.
• Increase productivity for accessing, sharing,
searching, navigating, cross-linking,
analyzing internal /external data
Solution
• Semantic integration layer on RDF graph
• Rich domain-specific terminology (biology,
chemistry and medicine) 1.6 M terms
• Terminology Hub: 8 GB of referential data
that cross-references between data
repositories.
Use Case: Semantic Data Integration
Novartis Institutes for BioMedical Research (NIBR)
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Use Case: Smart Engineering/Construction
PDF
PDF
PDF
PDF
Build
Order
Engineering
Standards
Government
Regulations
Product
Specifications
Requirements and Specifications
Ontology
Manual assessment by
discipline-specific
engineers
Automated reasoning
and queries
Example: bolt length
error rate 15%  0.5%
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Agenda
11
Definition and Use Cases for Knowledge Graphs
Modeling Knowledge Graphs using W3C RDF
Using Oracle RDF Knowledge Graph
Performing Analytics with RDF Knowledge Graph Data
1
2
3
4
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 12
W3C Standards for Knowledge Graphs
The World Wide Web
Consortium has defined a suite
of standards to support Linked
Data and Knowledge Graphs.
Fundamental Concepts are:
• URIs
• Links to other resources
• Standard Data Model (RDF)
• Standard Ontology Language
(OWL)
• Standard Query (SPARQL)
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
What is Resource Description Framework (RDF)
• An RDF graph is a directed, labeled
graph with some syntactic restrictions
– Vertex labels are URIs or scalar values
– Edge labels are URIs
– Source vertex for an edge must be a URI
• An edge is the atomic unit of an RDF
graph – called an RDF triple
univ:university1
univ:course456
univ:professorXYZ
univ:student123
univ:employedBy
univ:offers
univ:takes
univ:teaches
"John"
univ:name
"Susan"
univ:name
univ:university1 "MIT"
univ:name
Subject Predicate Object
RDF Triple
@prefix univ: <http://univ.org#>
univ:student123 == <http://univ.org#student123>
URI prefix and prefixed name
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
What is Resource Description Framework (RDF)
• Resources can belong to types or
Classes
• Distinguish between Classes and
Instances
– Classes:
• univ:Professor, univ:University
– Instances:
• univ:professorXYZ, univ:university1
univ:university1
univ:course456
univ:professorXYZ
univ:student123
univ:employedBy
univ:offers
univ:takes
univ:teaches
"John"
univ:name
"Susan"
univ:name
univ:Professor
univ:University
rdf:type
rdf:type
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Creating an RDF Knowledge Graph
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Creating an RDF KG for the University Domain
@prefix univ: <http://univ.org#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
# Person
univ:Person rdf:type owl:Class .
# Student
univ:Student
rdf:type owl:Class ;
rdfs:subClassOf univ:Person .
# Graduate Student
univ:GraduateStudent
rdf:type owl:Class ;
rdfs:subClassOf univ:Student .
# Professor
univ:Professor
rdf:type owl:Class ;
rdfs:subClassOf univ:Person .
RDF Serialization (Turtle Format)
Defining Classes (and relationships among classes)
Person
Student Professor
Graduate
Student
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Creating an RDF KG for the University Domain
@prefix univ: <http://univ.org#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
# Course
univ:Course rdf:type owl:Class .
# Graduate Course
univ:GraduateCourse
rdf:type owl:Class ;
rdfs:subClassOf unv:Course .
# University
univ:University rdf:type owl:Class .
RDF Serialization (Turtle Format)
Defining Classes (and relationships among classes)
Person
Student Professor
Course
University
Graduate
Course
Graduate
Student
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Creating an RDF KG for the University Domain
@prefix univ: <http://univ.org#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
# takes
univ:takes
rdf:type owl:ObjectProperty ;
rdfs:domain univ:Student ;
rdfs:range univ:Course .
# teaches
univ:teaches
rdf:type owl:ObjectProperty ;
rdfs:domain univ:Professor ;
rdfs:range univ:Course .
# offers
univ:offers
rdf:type owl:ObjectProperty ;
rdfs:domain univ:University ;
rdfs:range univ:Course .
RDF Serialization (Turtle Format)
Defining Properties
Person
Student Professor
Course
University
takes teaches
offers
Graduate
Course
Graduate
Student
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
@prefix univ: <http://univ.org#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
# Graduate Students are Students who take a Graduate Course
owl:GraduateStudent owl:equivalentClass
[ rdf:type owl:Restriction ;
owl:onProperty univ:takes ;
owl:someValuesFrom univ:GraduateCourse
] .
Example: Creating an RDF KG for the University Domain
RDF Serialization (Turtle Format)
Adding More Semantics
Person
Student Professor
Course
University
takes teaches
offers
Graduate
Course
Graduate
Student
takes
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Creating an RDF KG for the University Domain
Person
Student Professor
@prefix univ: <http://univ.org#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
# Student 123 takes Graduate Course 456
univ:student123 univ:takes univ:course456 .
univ:course456 rdf:type univ:GraduateCourse .
# what can we infer?Course
University
takes teaches
offers
Graduate
Course
Graduate
Student
RDF Serialization (Turtle Format)
Creating Edges (at instance-level)
Student123
Course456
takes
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Creating an RDF KG for the University Domain
Person
Student Professor
@prefix univ: <http://univ.org#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
# Student 123 takes Graduate Course 456
univ:student123 univ:takes univ:course456 .
univ:course456 rdf:type univ:GraduateCourse .
# what can we infer?
# domain of takes is Student
univ:student123 rdf:type univ:Student .
Course
University
takes teaches
offers
Graduate
Course
Graduate
Student
RDF Serialization (Turtle Format)
Inference (at instance-level)
Student123
Course456
takes
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Creating an RDF KG for the University Domain
Person
Student Professor
@prefix univ: <http://univ.org#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
# Student 123 takes Graduate Course 456
univ:student123 univ:takes univ:course456 .
univ:course456 rdf:type univ:GraduateCourse .
# what can we infer?
# domain of takes is Student
univ:student123 rdf:type univ:Student .
# Student is a subclass of Person
univ:student123 rdf:type univ:Person .
Course
University
takes teaches
offers
Graduate
Course
Graduate
Student
RDF Serialization (Turtle Format)
Inference (at instance-level)
Student123
Course456
takes
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Creating an RDF KG for the University Domain
Person
Student Professor
@prefix univ: <http://univ.org#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
# Student 123 takes Graduate Course 456
univ:student123 univ:takes univ:course456 .
univ:course456 rdf:type univ:GraduateCourse .
# what can we infer?
# domain of takes is Student
univ:student123 rdf:type univ:Student .
# Student is a subclass of Person
univ:student123 rdf:type univ:Person .
# student123 takes a Graduate Course
univ:student123 rdf:type univ:GraduateStudent .
Course
University
takes teaches
offers
Graduate
Course
Graduate
Student
RDF Serialization (Turtle Format)
Inference (at instance-level)
Student123
Course456
takes
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Creating an RDF KG for the University Domain
Person
Student Professor
@prefix univ: <http://univ.org#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
# Student 123 takes Graduate Course 456
univ:student123 univ:takes univ:course456 .
univ:course456 rdf:type univ:GraduateCourse .
# what can we infer?
# domain of takes is Student
univ:student123 rdf:type univ:Student .
# Student is a subclass of Person
univ:student123 rdf:type univ:Person .
# student123 takes a Graduate Course
univ:student123 rdf:type univ:GraduateStudent .
# range of takes is Course and GraduateCourse subclass of Course
univ:course456 rdf:type univ:Course .
Course
University
takes teaches
offers
Graduate
Course
Graduate
Student
RDF Serialization (Turtle Format)
Inference (at instance-level)
Student123
Course456
takes
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Graphical Tools like Protégé Make Things Easier
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Agenda
26
Definition and Use Cases for Knowledge Graphs
Modeling Knowledge Graphs using W3C RDF
Using Oracle RDF Knowledge Graph
Performing Analytics with RDF Knowledge Graph Data
1
2
3
4
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Database Version and Options for
RDF Knowledge Graph
• On-premise
– Oracle Database Enterprise Edition with
Spatial & Graph and Partitioning options
• Oracle Database Cloud Services
– DBCS (OCI)
– Exadata Cloud Service
– ATP-Dedicated (planned)
27
https://blogs.oracle.com/oraclespatial has a 3-part series
on getting started with RDF on DBCS
“Using RDF Knowledge Graphs in the Oracle Public Cloud”
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 28
Oracle Spatial and Graph 18c – RDF Knowledge Graph Architecture
Generic Relational Schema
for Storing RDF Data
RDF Views of Relational Data
SPARQL-to-SQL
Query Translator
Forward-chaining
OWL Reasoner
RDF Bulk Loader SPARQL Update
Processor
SQL and PL/SQL API
Support for Apache Jena (Java API)
Protégé Plugin Fuseki Endpoint Cytoscape Plugin
SQL Developer
RDF Support
Enterprise Manager
and Other DB Tools
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Loading RDF Data
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Source for RDF data
• Formatted File
– RDF formatted files: N-Triple, N-Quad, Turtle, RDF/XML, Trig, JSON-LD, etc.
• SPARQL Update
– Incremental insert, add, copy, etc.
• (External) Tables/Views or SQL Query
– Any tabular rowsource + W3C RDB2RDF mapping
Formatted File or String, Tabular Rowsource
30
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
RDF Bulk Loader
31
Staging Table
Client DB Server
RDF Relational Schema
Parallel RDF Bulk Load
• Value Checking
• Canonicalization
• Duplicate Elimination
• Internal ID Generation
• Index Creation
Step 2
N-Triple N-Quad
N-Triple
N-Quad
Turtle
RDF/XML
Trig
JSON-LD
Others
External Table
Oracle
Protégé
Plugin
Jena Adapter
Java API
Step 1
Oracle
SQL*Loader
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Relational Data to RDF (W3C RDB2RDF)
• Direct Mapping
– Automatically generates a mapping based on an input relational schema.
– A Direct Mapping of Relational Data to RDF.
W3C Recommendation 27 September 2012
http://www.w3.org/TR/2012/REC-rdb-direct-mapping-20120927/
• R2RML (RDB to RDF Mapping Language)
– An RDF vocabulary for specifying customized relational data to RDF mapping.
– R2RML: RDB to RDF Mapping Language.
W3C Recommendation 27 September 2012.
http://www.w3.org/TR/2012/REC-r2rml-20120927/
Two types of mapping: Direct and R2RML
32
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Using Direct Mapping: Overall Flow
Direct Map
Author
RDB2RDF
Processor
SPARQL to SQL
Translator
List of Tables
and Views
R2RML map
& schema
33
RDF
Triplestore
Relational
Tables & Views
Query
Writer
SPARQL
QUERY
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Using R2RML: Overall Flow
R2RML Map
Author
RDB2RDF
Processor
SPARQL to SQL
Translator
R2RML
Mapping
R2RML map
& schema
34
RDF
Triplestore
Relational
Tables & Views
Query
Writer
SPARQL
QUERY
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
R2RML Schema (Classes and Relations)
Source: Das, Sundara, and Cyganiak.
R2RML: RDB to RDF Mapping Language. W3C Recommendation 27 September 2012.
http://www.w3.org/TR/2012/REC-r2rml-20120927/
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Mapping EMP and DEPT Tables to RDF
7782 John DB 10
constraints
EMP
ENO ENAME EXPERTISE DNO
10 Sales NYC
DNO DNAME LOC
DEPT
pkey ref. pkey
x:Department
http://x.com/Dept#{DNO}
class
Subject
Predicate-object pairs
<http://x.com/Dept#10>
rdf:type x:Department ;
<../Dept/Deptno> 10 ;
<../Dept/DeptName> “Sales” ;
<../Dept/Location> “NYC” .
TriplesMap
 DEPT
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Mapping EMP and DEPT Tables to RDF
7782 John DB 10
constraints
EMP
ENO ENAME EXPERTISE DNO
10 Sales NYC
DNO DNAME LOC
DEPT
pkey ref. pkey
x:Employee
http://x.com/Emp#{ENO}
Predicate-object pairs
Subject
class
<http://x.com/Emp#7782>
rdf:type x:Employee ;
<../Emp/Empno> 7782 ;
<../Emp/EmpName> “John” ;
<../Emp/Expertise> “DB” ;
<../Emp/DeptNum> 10 ;
<../Emp/Department> <http://x.com/Dept#10> .
TriplesMap
 EMP
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Oracle SQL Developer RDF Support
40
• R2RML Mapping Editor
– Shows a tree view of an
R2RML mapping
– Allows drill down from
Triples Map -> Subject
Map -> Predicate-Object
Map
– You can edit or delete
existing elements or add
new ones
– “Commit Mapping”
refreshes the associated
RDF view
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Performing Inference
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Core Inference Features in Oracle Database
42
• Oracle provides native inference in the database for
• RDFS, RDFS++
• OWLPRIME, OWL2RL, OWL2EL, SKOSCORE
• User-defined rules
• User-defined inferencing
• Inference done using forward chaining
• Triples inferred and stored ahead of query time
• Removes on-the-fly reasoning and results in fast query times
• Proof generation
• Shows one deduction path
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
• Option 1: Add user-defined rules
• Example: sibling rule
• Option 2: Leverage external DL reasoners
• Option 3: User-defined inferencing in Oracle Database Release 12c
Extending Semantics Supported by Native OWL Inference Engine
Antecedents

Consequents
?z :parentOf ?x .
?z :parentOf ?y .
?x owl:differentFrom ?y .
?x :siblingOf ?y
43
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Extensible Architecture for External OWL DL Reasoners
External
In-Memory OWL
DL Reasoners
TrOWL/REL
Jena APIs
through
Adapter for
Apache Jena
Oracle’s
Native Inference
Engine for OWL 2
RL, EL & user-
defined rules
Materialized Inference
44
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
• SDO_SEM_INFERENCE.
INF_EXT_ACTION_START
• SDO_SEM_INFERENCE.
INF_EXT_ACTION_RUN
• SDO_SEM_INFERENCE.
INF_EXT_ACTION_END
User-Defined Inferencing in Oracle Database Release 12c
45
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
SPARQL Query and Update
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
What is SPARQL?
• SPARQL Protocol and RDF Query Language
– W3C standard for querying and manipulating RDF content
– Queries/updates and corresponding results are communicated via HTTP with a
SPARQL endpoint
– A SPARQL endpoint implements the SPARQL protocol and serves RDF data from a
RDF triplestore or RDF view
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
SPARQL Graph Pattern
Basic unit of SPARQL queries
univ:Student
univ:student123
univ:student456
"John Green"
"1999-06-15"^^xsd:date
"male"
"Susan Blue"
"2000-02-10"^^xsd:date
"female"
rdf:type
rdf:type
foaf:name
vcard:BDAY
foaf:gender
foaf:name
vcard:BDAY
foaf:gender
univ:Student
univ:student123
"John Green"
"1999-06-15"^^xsd:date
"male"
rdf:type
foaf:name
vcard:BDAY
foaf:gender
?t
?p
?n
?b
?g
Result 1: {?t=univ:Student, ?p=univ:student123, ?n="John Green", ?g="male", ?b="1999-06-15"^^xsd:date}
Result 2: {?t=univ:Student, ?p=univ:student456, ?n="Susan Blue", ?g="female", ?b="2000-02-10"^^xsd:date}
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
?t
?p
?n
?b
?g
SPARQL Graph Pattern
Basic unit of SPARQL queries
rdf:type
foaf:name
vcard:BDAY
foaf:gender
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
SELECT ?t ?n ?b ?g
WHERE
{ ?p rdf:type ?t .
?p foaf:name ?n .
?p vcard:BDAY ?b .
?p foaf:gender ?g }
How do we express this with SPARQL?
Basic Graph
Pattern (BGP)
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
SPARQL FILTER: Restricting Solutions
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?n ?b ?g
WHERE
{ ?p foaf:name ?n .
?p vcard:BDAY ?b .
?p foaf:gender ?g
FILTER ( ?b < "2000-01-01"^^xsd:date )}
Find all people born before 2000
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
SPARQL Subqueries & Aggregates
SELECT DISTINCT ?n ?o ?p ?st ?cnt
WHERE
{ ?s foaf:name ?n .
?s vcard:BDAY ?b .
?s foaf:gender ?g
{ SELECT ?s (COUNT(?c) AS ?cnt)
WHERE
{ ?s univ:takes ?c }
GROUP BY ?s
HAVING (COUNT(?c) > 20)
}
}
ORDER BY DESC(?cnt) ASC(?n)
Find information about Students that have taken more than 20 classes
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
SPARQL Property Path: Matching Arbitrary Length Paths
SELECT ?friend
WHERE
{ ?student foaf:name "Bill Brown" .
?student foaf:friendOf+ ?friend
}
Find all the friends of Bill Brown
Regular expression-style syntax
Syntax Matches
:predicate+ Path composed of one or more repetitions of :predicate
:predicate* Path composed of zero or more repetitions of :predicate
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
SPARQL 1.1 Update
• SPARQL 1.1 Update is intended to be a standard language for specifying and
executing updates to RDF graphs in a Graph Store.
Graph Update operations
INSERT DATA Adds some triples, given inline in the
request, into a graph.
DELETE DATA Removes some triples, given inline in the
request, if the respective graph contains those.
DELETE/INSERT Perform pattern-based actions for graph
updates
LOAD Reads the contents of a document representing a
graph into a graph in the Graph Store.
CLEAR Removes all the triples in (one or more) graphs.
Graph Management operations
CREATE Creates a new graph in stores that support empty
graphs.
DROP Removes a graph and all of its contents.
COPY Modifies a graph to contain a copy of another.
MOVE Moves all of the data from one graph into another.
ADD Reproduces all data from one graph into another.
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
SPARQL and SPARQL in SQL Architecture
Support for Apache Jena
Standard SPARQL Endpoint
Enhanced with query management control
SEM_MATCH
SEM_APIS.UPDATE_MODELSQL
Java
HTTP
SPARQL-to-SQL Core Logic
Apache Jena
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
SPARQL in SQL: SEM_MATCH
SELECT n1, n2
FROM
TABLE(
SEM_MATCH(
'PREFIX foaf: <http://...>
SELECT ?n1 ?n2
FROM <http://g1>
WHERE {?p foaf:name ?n1
OPTIONAL {?p foaf:knows ?f .
?f foaf:name ?n2 }
FILTER (REGEX(?n1, "^A")) }
ORDER BY ?n1 ?n2',
SEM_MODELS('M1'),…));
n1 n2
Alex Jerry
Alex Tom
Alice Bill
Alice Jill
Alice John
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
SPARQL in SQL: SEM_MATCH
• Extends SQL with full SPARQL 1.1 query constructs
• Benefits:
– Integrates graph data with existing enterprise data
– JOINs with other relational (and object-relational) data
– Allows SQL constructs/functions
– DDL Statements: create tables/views
– Allows use of enterprise SQL development tools
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
SPARQL Update: SEM_APIS.UPDATE_MODEL
begin
sem_apis.update_model(
apply_model=>'M1',
update_stmt=>'INSERT {?s :mbox ?n}
WHERE {?s :email ?n}'
);
end;
/
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Tools Make Things Easier
SQL Developer RDF Plugin Jena Fuseki Web Application
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Agenda
64
Definition and Use Cases for Knowledge Graphs
Modeling Knowledge Graphs using W3C RDF
Using Oracle RDF Knowledge Graph
Performing Analytics with RDF Knowledge Graph Data
1
2
3
4
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 65
Oracle RDF KG as an Integration / Analytics Platform
My SQL
SQL Server
DB2
Oracle Big
Data
Connectors
External
Table /
DB Link
Oracle
Database
Gateways
Oracle Advanced
AnalyticsOBIEE
Relational
Table/View
Property
Graph View
Property
Graph View
of RDF
RDF View
PGX
CREATE VIEW
SEM_MATCH
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Creating Property Graph Views on an RDF Graph
public static void createPropertyGraphViewOnRDF(Connection conn,
String pgGraphName,
String rdfModelName,
boolean virtualModel,
PGUtils.RDFPredicate[] predListForVertexAttrs,
PGUtils.RDFPredicate[] predListForEdges)
This method creates the property graph views (vertex and edge views) for the given RDF model.
Parameters:
conn - a connection instance to Oracle database
pgGraphName - the name of the property graph to be created
rdfModelName - the name of the RDF model
virtualModel - a flag represents if the RDF model is virtual model or not
predListForVertexAttrs - an array of RDFPredicate objects specifying how to create vertex view using these
predicates
predListForEdges - an array of RDFPredicate specifying how to create edge view using these predicates
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Creating Property Graph Views on an RDF Graph
// create PG view on RDF model
PGUtils.createPropertyGraphViewOnRDF(conn, "articles", "articles", false,
predsForVertexAttrs, predsForEdges);
// get the Property Graph instance
oracle = new Oracle(jdbcUrl, user, password);
pggraph = OraclePropertyGraph.getInstance(oracle, "articles");
// use like a normal Property Graph instance
System.err.println("------ Vertices from property graph view ------");
pggraph.getVertices();
System.err.println("------ Edges from property graph view ------");
pggraph.getEdges();
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Questions?
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 69
Build Knowledge Graphs with Oracle RDF to Extract More Value from Your Data

More Related Content

What's hot

Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use Cases
Max De Marzi
 
Graph database
Graph database Graph database
Graph database
Shruti Arya
 
QGIS server: the good, the not-so-good and the ugly
QGIS server: the good, the not-so-good and the uglyQGIS server: the good, the not-so-good and the ugly
QGIS server: the good, the not-so-good and the ugly
Ross McDonald
 
Graph convolutional networks in apache spark
Graph convolutional networks in apache sparkGraph convolutional networks in apache spark
Graph convolutional networks in apache spark
Emiliano Martinez Sanchez
 
The Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
The Five Graphs of Government: How Federal Agencies can Utilize Graph TechnologyThe Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
The Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
Neo4j
 
Graph Database Meetup in Korea #2. Graph Database Usecase (그래프 데이터베이스 활용사례)
Graph Database Meetup in Korea #2. Graph Database Usecase (그래프 데이터베이스 활용사례)Graph Database Meetup in Korea #2. Graph Database Usecase (그래프 데이터베이스 활용사례)
Graph Database Meetup in Korea #2. Graph Database Usecase (그래프 데이터베이스 활용사례)
bitnineglobal
 
Introduction of Knowledge Graphs
Introduction of Knowledge GraphsIntroduction of Knowledge Graphs
Introduction of Knowledge Graphs
Jeff Z. Pan
 
디지털 트윈 플랫폼 기술과 사례(LX공사 특강)
디지털 트윈 플랫폼 기술과 사례(LX공사 특강)디지털 트윈 플랫폼 기술과 사례(LX공사 특강)
디지털 트윈 플랫폼 기술과 사례(LX공사 특강)
SANGHEE SHIN
 
Converting Relational to Graph Databases
Converting Relational to Graph DatabasesConverting Relational to Graph Databases
Converting Relational to Graph Databases
Antonio Maccioni
 
Graph Analytics with ArangoDB
Graph Analytics with ArangoDBGraph Analytics with ArangoDB
Graph Analytics with ArangoDB
ArangoDB Database
 
2016 Power BI Training
2016   Power BI Training2016   Power BI Training
2016 Power BI Training
Gaston Cruz
 
Graph Gurus 15: Introducing TigerGraph 2.4
Graph Gurus 15: Introducing TigerGraph 2.4 Graph Gurus 15: Introducing TigerGraph 2.4
Graph Gurus 15: Introducing TigerGraph 2.4
TigerGraph
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
Neo4j
 
Location Intelligence: The Secret Sauce for OOH Advertising
Location Intelligence: The Secret Sauce for OOH AdvertisingLocation Intelligence: The Secret Sauce for OOH Advertising
Location Intelligence: The Secret Sauce for OOH Advertising
CARTO
 
Power BI: From the Basics
Power BI: From the BasicsPower BI: From the Basics
Power BI: From the Basics
Nikkia Carter
 
Hadoop MapReduce Fundamentals
Hadoop MapReduce FundamentalsHadoop MapReduce Fundamentals
Hadoop MapReduce Fundamentals
Lynn Langit
 
Neo4j graph database
Neo4j graph databaseNeo4j graph database
Neo4j graph database
Prashant Bhargava
 
Web mining slides
Web mining slidesWeb mining slides
Web mining slides
mahavir_a
 
Zipline - A Declarative Feature Engineering Framework
Zipline - A Declarative Feature Engineering FrameworkZipline - A Declarative Feature Engineering Framework
Zipline - A Declarative Feature Engineering Framework
Databricks
 
Natural Language Processing and Search Intent Understanding C3 Conductor 2019...
Natural Language Processing and Search Intent Understanding C3 Conductor 2019...Natural Language Processing and Search Intent Understanding C3 Conductor 2019...
Natural Language Processing and Search Intent Understanding C3 Conductor 2019...
Dawn Anderson MSc DigM
 

What's hot (20)

Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use Cases
 
Graph database
Graph database Graph database
Graph database
 
QGIS server: the good, the not-so-good and the ugly
QGIS server: the good, the not-so-good and the uglyQGIS server: the good, the not-so-good and the ugly
QGIS server: the good, the not-so-good and the ugly
 
Graph convolutional networks in apache spark
Graph convolutional networks in apache sparkGraph convolutional networks in apache spark
Graph convolutional networks in apache spark
 
The Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
The Five Graphs of Government: How Federal Agencies can Utilize Graph TechnologyThe Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
The Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
 
Graph Database Meetup in Korea #2. Graph Database Usecase (그래프 데이터베이스 활용사례)
Graph Database Meetup in Korea #2. Graph Database Usecase (그래프 데이터베이스 활용사례)Graph Database Meetup in Korea #2. Graph Database Usecase (그래프 데이터베이스 활용사례)
Graph Database Meetup in Korea #2. Graph Database Usecase (그래프 데이터베이스 활용사례)
 
Introduction of Knowledge Graphs
Introduction of Knowledge GraphsIntroduction of Knowledge Graphs
Introduction of Knowledge Graphs
 
디지털 트윈 플랫폼 기술과 사례(LX공사 특강)
디지털 트윈 플랫폼 기술과 사례(LX공사 특강)디지털 트윈 플랫폼 기술과 사례(LX공사 특강)
디지털 트윈 플랫폼 기술과 사례(LX공사 특강)
 
Converting Relational to Graph Databases
Converting Relational to Graph DatabasesConverting Relational to Graph Databases
Converting Relational to Graph Databases
 
Graph Analytics with ArangoDB
Graph Analytics with ArangoDBGraph Analytics with ArangoDB
Graph Analytics with ArangoDB
 
2016 Power BI Training
2016   Power BI Training2016   Power BI Training
2016 Power BI Training
 
Graph Gurus 15: Introducing TigerGraph 2.4
Graph Gurus 15: Introducing TigerGraph 2.4 Graph Gurus 15: Introducing TigerGraph 2.4
Graph Gurus 15: Introducing TigerGraph 2.4
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
 
Location Intelligence: The Secret Sauce for OOH Advertising
Location Intelligence: The Secret Sauce for OOH AdvertisingLocation Intelligence: The Secret Sauce for OOH Advertising
Location Intelligence: The Secret Sauce for OOH Advertising
 
Power BI: From the Basics
Power BI: From the BasicsPower BI: From the Basics
Power BI: From the Basics
 
Hadoop MapReduce Fundamentals
Hadoop MapReduce FundamentalsHadoop MapReduce Fundamentals
Hadoop MapReduce Fundamentals
 
Neo4j graph database
Neo4j graph databaseNeo4j graph database
Neo4j graph database
 
Web mining slides
Web mining slidesWeb mining slides
Web mining slides
 
Zipline - A Declarative Feature Engineering Framework
Zipline - A Declarative Feature Engineering FrameworkZipline - A Declarative Feature Engineering Framework
Zipline - A Declarative Feature Engineering Framework
 
Natural Language Processing and Search Intent Understanding C3 Conductor 2019...
Natural Language Processing and Search Intent Understanding C3 Conductor 2019...Natural Language Processing and Search Intent Understanding C3 Conductor 2019...
Natural Language Processing and Search Intent Understanding C3 Conductor 2019...
 

Similar to Build Knowledge Graphs with Oracle RDF to Extract More Value from Your Data

ISWC GoodRelations Tutorial Part 2
ISWC GoodRelations Tutorial Part 2ISWC GoodRelations Tutorial Part 2
ISWC GoodRelations Tutorial Part 2
Martin Hepp
 
GoodRelations Tutorial Part 2
GoodRelations Tutorial Part 2GoodRelations Tutorial Part 2
GoodRelations Tutorial Part 2
guestecacad2
 
Why I don't use Semantic Web technologies anymore, event if they still influe...
Why I don't use Semantic Web technologies anymore, event if they still influe...Why I don't use Semantic Web technologies anymore, event if they still influe...
Why I don't use Semantic Web technologies anymore, event if they still influe...
Gautier Poupeau
 
NISO/DCMI September 25 Webinar: Implementing Linked Data in Developing Countr...
NISO/DCMI September 25 Webinar: Implementing Linked Data in Developing Countr...NISO/DCMI September 25 Webinar: Implementing Linked Data in Developing Countr...
NISO/DCMI September 25 Webinar: Implementing Linked Data in Developing Countr...
National Information Standards Organization (NISO)
 
Linked Data Driven Data Virtualization for Web-scale Integration
Linked Data Driven Data Virtualization for Web-scale IntegrationLinked Data Driven Data Virtualization for Web-scale Integration
Linked Data Driven Data Virtualization for Web-scale Integration
rumito
 
Exploring the Semantic Web
Exploring the Semantic WebExploring the Semantic Web
Exploring the Semantic Web
Roberto García
 
Linked Data for African Libraries
Linked Data for African LibrariesLinked Data for African Libraries
Linked Data for African Libraries
Getaneh Alemu
 
Linked Data for the Masses: The approach and the Software
Linked Data for the Masses: The approach and the SoftwareLinked Data for the Masses: The approach and the Software
Linked Data for the Masses: The approach and the Software
IMC Technologies
 
Linked data HHS 2015
Linked data HHS 2015Linked data HHS 2015
Linked data HHS 2015
Cason Snow
 
Jarrar: RDFs -RDF Schema
Jarrar: RDFs -RDF SchemaJarrar: RDFs -RDF Schema
Jarrar: RDFs -RDF Schema
Mustafa Jarrar
 
Going for GOLD - Adventures in Open Linked Geospatial Metadata
Going for GOLD - Adventures in Open Linked Geospatial MetadataGoing for GOLD - Adventures in Open Linked Geospatial Metadata
Going for GOLD - Adventures in Open Linked Geospatial Metadata
EDINA, University of Edinburgh
 
RDF Graph Data Management in Oracle Database and NoSQL Platforms
RDF Graph Data Management in Oracle Database and NoSQL PlatformsRDF Graph Data Management in Oracle Database and NoSQL Platforms
RDF Graph Data Management in Oracle Database and NoSQL Platforms
Graph-TA
 
Data Integration And Visualization
Data Integration And VisualizationData Integration And Visualization
Data Integration And Visualization
Ivan Ermilov
 
Linked Data at the OU - the story so far
Linked Data at the OU - the story so farLinked Data at the OU - the story so far
Linked Data at the OU - the story so far
Enrico Daga
 
A BASILar Approach for Building Web APIs on top of SPARQL Endpoints
A BASILar Approach for Building Web APIs on top of SPARQL EndpointsA BASILar Approach for Building Web APIs on top of SPARQL Endpoints
A BASILar Approach for Building Web APIs on top of SPARQL Endpoints
Enrico Daga
 
Wed roman tut_open_datapub
Wed roman tut_open_datapubWed roman tut_open_datapub
Wed roman tut_open_datapubeswcsummerschool
 
Wed batsakis tut_challenges of preservations
Wed batsakis tut_challenges of preservationsWed batsakis tut_challenges of preservations
Wed batsakis tut_challenges of preservationseswcsummerschool
 
Wed batsakis tut_chalasdlenges of preservations
Wed batsakis tut_chalasdlenges of preservationsWed batsakis tut_chalasdlenges of preservations
Wed batsakis tut_chalasdlenges of preservations
eswcsummerschool
 
RDFa: an introduction
RDFa: an introductionRDFa: an introduction
RDFa: an introduction
Kai Li
 
Usage of Linked Data: Introduction and Application Scenarios
Usage of Linked Data: Introduction and Application ScenariosUsage of Linked Data: Introduction and Application Scenarios
Usage of Linked Data: Introduction and Application Scenarios
EUCLID project
 

Similar to Build Knowledge Graphs with Oracle RDF to Extract More Value from Your Data (20)

ISWC GoodRelations Tutorial Part 2
ISWC GoodRelations Tutorial Part 2ISWC GoodRelations Tutorial Part 2
ISWC GoodRelations Tutorial Part 2
 
GoodRelations Tutorial Part 2
GoodRelations Tutorial Part 2GoodRelations Tutorial Part 2
GoodRelations Tutorial Part 2
 
Why I don't use Semantic Web technologies anymore, event if they still influe...
Why I don't use Semantic Web technologies anymore, event if they still influe...Why I don't use Semantic Web technologies anymore, event if they still influe...
Why I don't use Semantic Web technologies anymore, event if they still influe...
 
NISO/DCMI September 25 Webinar: Implementing Linked Data in Developing Countr...
NISO/DCMI September 25 Webinar: Implementing Linked Data in Developing Countr...NISO/DCMI September 25 Webinar: Implementing Linked Data in Developing Countr...
NISO/DCMI September 25 Webinar: Implementing Linked Data in Developing Countr...
 
Linked Data Driven Data Virtualization for Web-scale Integration
Linked Data Driven Data Virtualization for Web-scale IntegrationLinked Data Driven Data Virtualization for Web-scale Integration
Linked Data Driven Data Virtualization for Web-scale Integration
 
Exploring the Semantic Web
Exploring the Semantic WebExploring the Semantic Web
Exploring the Semantic Web
 
Linked Data for African Libraries
Linked Data for African LibrariesLinked Data for African Libraries
Linked Data for African Libraries
 
Linked Data for the Masses: The approach and the Software
Linked Data for the Masses: The approach and the SoftwareLinked Data for the Masses: The approach and the Software
Linked Data for the Masses: The approach and the Software
 
Linked data HHS 2015
Linked data HHS 2015Linked data HHS 2015
Linked data HHS 2015
 
Jarrar: RDFs -RDF Schema
Jarrar: RDFs -RDF SchemaJarrar: RDFs -RDF Schema
Jarrar: RDFs -RDF Schema
 
Going for GOLD - Adventures in Open Linked Geospatial Metadata
Going for GOLD - Adventures in Open Linked Geospatial MetadataGoing for GOLD - Adventures in Open Linked Geospatial Metadata
Going for GOLD - Adventures in Open Linked Geospatial Metadata
 
RDF Graph Data Management in Oracle Database and NoSQL Platforms
RDF Graph Data Management in Oracle Database and NoSQL PlatformsRDF Graph Data Management in Oracle Database and NoSQL Platforms
RDF Graph Data Management in Oracle Database and NoSQL Platforms
 
Data Integration And Visualization
Data Integration And VisualizationData Integration And Visualization
Data Integration And Visualization
 
Linked Data at the OU - the story so far
Linked Data at the OU - the story so farLinked Data at the OU - the story so far
Linked Data at the OU - the story so far
 
A BASILar Approach for Building Web APIs on top of SPARQL Endpoints
A BASILar Approach for Building Web APIs on top of SPARQL EndpointsA BASILar Approach for Building Web APIs on top of SPARQL Endpoints
A BASILar Approach for Building Web APIs on top of SPARQL Endpoints
 
Wed roman tut_open_datapub
Wed roman tut_open_datapubWed roman tut_open_datapub
Wed roman tut_open_datapub
 
Wed batsakis tut_challenges of preservations
Wed batsakis tut_challenges of preservationsWed batsakis tut_challenges of preservations
Wed batsakis tut_challenges of preservations
 
Wed batsakis tut_chalasdlenges of preservations
Wed batsakis tut_chalasdlenges of preservationsWed batsakis tut_chalasdlenges of preservations
Wed batsakis tut_chalasdlenges of preservations
 
RDFa: an introduction
RDFa: an introductionRDFa: an introduction
RDFa: an introduction
 
Usage of Linked Data: Introduction and Application Scenarios
Usage of Linked Data: Introduction and Application ScenariosUsage of Linked Data: Introduction and Application Scenarios
Usage of Linked Data: Introduction and Application Scenarios
 

More from Jean Ihm

Oracle Spatial Studio: Fast and Easy Spatial Analytics and Maps
Oracle Spatial Studio:  Fast and Easy Spatial Analytics and MapsOracle Spatial Studio:  Fast and Easy Spatial Analytics and Maps
Oracle Spatial Studio: Fast and Easy Spatial Analytics and Maps
Jean Ihm
 
Icde2019 improving rdf query performance using in-memory virtual columns in o...
Icde2019 improving rdf query performance using in-memory virtual columns in o...Icde2019 improving rdf query performance using in-memory virtual columns in o...
Icde2019 improving rdf query performance using in-memory virtual columns in o...
Jean Ihm
 
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Jean Ihm
 
When Graphs Meet Machine Learning
When Graphs Meet Machine LearningWhen Graphs Meet Machine Learning
When Graphs Meet Machine Learning
Jean Ihm
 
PGQL: A Language for Graphs
PGQL: A Language for GraphsPGQL: A Language for Graphs
PGQL: A Language for Graphs
Jean Ihm
 
How To Visualize Graphs
How To Visualize GraphsHow To Visualize Graphs
How To Visualize Graphs
Jean Ihm
 
Gain Insights with Graph Analytics
Gain Insights with Graph Analytics Gain Insights with Graph Analytics
Gain Insights with Graph Analytics
Jean Ihm
 
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
Jean Ihm
 
Introduction to Property Graph Features (AskTOM Office Hours part 1)
Introduction to Property Graph Features (AskTOM Office Hours part 1) Introduction to Property Graph Features (AskTOM Office Hours part 1)
Introduction to Property Graph Features (AskTOM Office Hours part 1)
Jean Ihm
 
An Introduction to Graph: Database, Analytics, and Cloud Services
An Introduction to Graph:  Database, Analytics, and Cloud ServicesAn Introduction to Graph:  Database, Analytics, and Cloud Services
An Introduction to Graph: Database, Analytics, and Cloud Services
Jean Ihm
 

More from Jean Ihm (10)

Oracle Spatial Studio: Fast and Easy Spatial Analytics and Maps
Oracle Spatial Studio:  Fast and Easy Spatial Analytics and MapsOracle Spatial Studio:  Fast and Easy Spatial Analytics and Maps
Oracle Spatial Studio: Fast and Easy Spatial Analytics and Maps
 
Icde2019 improving rdf query performance using in-memory virtual columns in o...
Icde2019 improving rdf query performance using in-memory virtual columns in o...Icde2019 improving rdf query performance using in-memory virtual columns in o...
Icde2019 improving rdf query performance using in-memory virtual columns in o...
 
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
 
When Graphs Meet Machine Learning
When Graphs Meet Machine LearningWhen Graphs Meet Machine Learning
When Graphs Meet Machine Learning
 
PGQL: A Language for Graphs
PGQL: A Language for GraphsPGQL: A Language for Graphs
PGQL: A Language for Graphs
 
How To Visualize Graphs
How To Visualize GraphsHow To Visualize Graphs
How To Visualize Graphs
 
Gain Insights with Graph Analytics
Gain Insights with Graph Analytics Gain Insights with Graph Analytics
Gain Insights with Graph Analytics
 
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
 
Introduction to Property Graph Features (AskTOM Office Hours part 1)
Introduction to Property Graph Features (AskTOM Office Hours part 1) Introduction to Property Graph Features (AskTOM Office Hours part 1)
Introduction to Property Graph Features (AskTOM Office Hours part 1)
 
An Introduction to Graph: Database, Analytics, and Cloud Services
An Introduction to Graph:  Database, Analytics, and Cloud ServicesAn Introduction to Graph:  Database, Analytics, and Cloud Services
An Introduction to Graph: Database, Analytics, and Cloud Services
 

Recently uploaded

一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
mzpolocfi
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Subhajit Sahu
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
jerlynmaetalle
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
John Andrews
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
u86oixdj
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
vikram sood
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
g4dpvqap0
 
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Subhajit Sahu
 
Nanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdfNanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdf
eddie19851
 
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdfEnhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
GetInData
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
jerlynmaetalle
 

Recently uploaded (20)

一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
 
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
 
Nanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdfNanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdf
 
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdfEnhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
 

Build Knowledge Graphs with Oracle RDF to Extract More Value from Your Data

  • 1. Analytics and Data Summit 2019 Build Knowledge Graphs with Oracle RDF to Extract More Value from Your Data Souri Das Matthew Perry Melliyal Annamalai Oracle Spatial and Graph Spatial and Graph Summit @
  • 2. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Confidential – Oracle Internal/Restricted/Highly Restricted 2
  • 3. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Agenda 3 Definition and Use Cases for Knowledge Graphs Modeling Knowledge Graphs using W3C RDF Using Oracle RDF Knowledge Graph Performing Analytics with RDF Knowledge Graph Data 1 2 3 4
  • 4. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Agenda 4 Definition and Use Cases for Knowledge Graphs Modeling Knowledge Graphs using W3C RDF Using Oracle RDF Knowledge Graph Performing Analytics with RDF Knowledge Graph Data 1 2 3 4
  • 5. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | What is a Knowledge Graph? • Knowledge graphs are large networks of entities, their semantic types, properties, and relationships between entities1. • Key Features: – Things not strings • global unique identifiers – Formal structure/semantics • machine processable, unambiguous – Linked descriptions • resources are described by their connections 1. M. Kroetsch and G. Weikum. Journal of Web Semantics: Special Issue on Knowledge Graphs. http://www.websemanticsjournal.org/index.php/ps/announcement/view/19 [August, 2016] Database Knowledge Base Graph Knowledge Graph
  • 6. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Knowledge Graph Examples1 1. Heiko Paulheim. Journal of Web Semantics: Special Issue on Knowledge Graph Refinement. Preprint. “Knowledge Graph Refinement: A Survey of Approaches and Evaluation Methods.” [September, 2016]
  • 7. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Use Case: Linked Data Publishing • Publishing data in a standard way so that it can be more easily consumed • Popular way for government agencies to publish public data • Why RDF? – URIs – Flexible data model – Standard vocabularies – Standard protocols Italy National Institute of Statistics Japan National Statistics Center
  • 8. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Use Case: Linked Data Publishing • Publishing data in a standard way so that it can be more easily consumed • Popular way for government agencies to publish public data • Why RDF? – URIs – Flexible data model – Standard vocabularies – Standard protocols https://lod-cloud.net/ 1,200+ linked datasets
  • 9. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Business Challenge • Link database information on genes, proteins, metabolic pathways, compounds, ligands, etc. to original sources. • Increase productivity for accessing, sharing, searching, navigating, cross-linking, analyzing internal /external data Solution • Semantic integration layer on RDF graph • Rich domain-specific terminology (biology, chemistry and medicine) 1.6 M terms • Terminology Hub: 8 GB of referential data that cross-references between data repositories. Use Case: Semantic Data Integration Novartis Institutes for BioMedical Research (NIBR)
  • 10. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Use Case: Smart Engineering/Construction PDF PDF PDF PDF Build Order Engineering Standards Government Regulations Product Specifications Requirements and Specifications Ontology Manual assessment by discipline-specific engineers Automated reasoning and queries Example: bolt length error rate 15%  0.5%
  • 11. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Agenda 11 Definition and Use Cases for Knowledge Graphs Modeling Knowledge Graphs using W3C RDF Using Oracle RDF Knowledge Graph Performing Analytics with RDF Knowledge Graph Data 1 2 3 4
  • 12. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 12 W3C Standards for Knowledge Graphs The World Wide Web Consortium has defined a suite of standards to support Linked Data and Knowledge Graphs. Fundamental Concepts are: • URIs • Links to other resources • Standard Data Model (RDF) • Standard Ontology Language (OWL) • Standard Query (SPARQL)
  • 13. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | What is Resource Description Framework (RDF) • An RDF graph is a directed, labeled graph with some syntactic restrictions – Vertex labels are URIs or scalar values – Edge labels are URIs – Source vertex for an edge must be a URI • An edge is the atomic unit of an RDF graph – called an RDF triple univ:university1 univ:course456 univ:professorXYZ univ:student123 univ:employedBy univ:offers univ:takes univ:teaches "John" univ:name "Susan" univ:name univ:university1 "MIT" univ:name Subject Predicate Object RDF Triple @prefix univ: <http://univ.org#> univ:student123 == <http://univ.org#student123> URI prefix and prefixed name
  • 14. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | What is Resource Description Framework (RDF) • Resources can belong to types or Classes • Distinguish between Classes and Instances – Classes: • univ:Professor, univ:University – Instances: • univ:professorXYZ, univ:university1 univ:university1 univ:course456 univ:professorXYZ univ:student123 univ:employedBy univ:offers univ:takes univ:teaches "John" univ:name "Susan" univ:name univ:Professor univ:University rdf:type rdf:type
  • 15. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Creating an RDF Knowledge Graph
  • 16. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Creating an RDF KG for the University Domain @prefix univ: <http://univ.org#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . # Person univ:Person rdf:type owl:Class . # Student univ:Student rdf:type owl:Class ; rdfs:subClassOf univ:Person . # Graduate Student univ:GraduateStudent rdf:type owl:Class ; rdfs:subClassOf univ:Student . # Professor univ:Professor rdf:type owl:Class ; rdfs:subClassOf univ:Person . RDF Serialization (Turtle Format) Defining Classes (and relationships among classes) Person Student Professor Graduate Student
  • 17. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Creating an RDF KG for the University Domain @prefix univ: <http://univ.org#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . # Course univ:Course rdf:type owl:Class . # Graduate Course univ:GraduateCourse rdf:type owl:Class ; rdfs:subClassOf unv:Course . # University univ:University rdf:type owl:Class . RDF Serialization (Turtle Format) Defining Classes (and relationships among classes) Person Student Professor Course University Graduate Course Graduate Student
  • 18. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Creating an RDF KG for the University Domain @prefix univ: <http://univ.org#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . # takes univ:takes rdf:type owl:ObjectProperty ; rdfs:domain univ:Student ; rdfs:range univ:Course . # teaches univ:teaches rdf:type owl:ObjectProperty ; rdfs:domain univ:Professor ; rdfs:range univ:Course . # offers univ:offers rdf:type owl:ObjectProperty ; rdfs:domain univ:University ; rdfs:range univ:Course . RDF Serialization (Turtle Format) Defining Properties Person Student Professor Course University takes teaches offers Graduate Course Graduate Student
  • 19. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | @prefix univ: <http://univ.org#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . # Graduate Students are Students who take a Graduate Course owl:GraduateStudent owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty univ:takes ; owl:someValuesFrom univ:GraduateCourse ] . Example: Creating an RDF KG for the University Domain RDF Serialization (Turtle Format) Adding More Semantics Person Student Professor Course University takes teaches offers Graduate Course Graduate Student takes
  • 20. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Creating an RDF KG for the University Domain Person Student Professor @prefix univ: <http://univ.org#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . # Student 123 takes Graduate Course 456 univ:student123 univ:takes univ:course456 . univ:course456 rdf:type univ:GraduateCourse . # what can we infer?Course University takes teaches offers Graduate Course Graduate Student RDF Serialization (Turtle Format) Creating Edges (at instance-level) Student123 Course456 takes
  • 21. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Creating an RDF KG for the University Domain Person Student Professor @prefix univ: <http://univ.org#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . # Student 123 takes Graduate Course 456 univ:student123 univ:takes univ:course456 . univ:course456 rdf:type univ:GraduateCourse . # what can we infer? # domain of takes is Student univ:student123 rdf:type univ:Student . Course University takes teaches offers Graduate Course Graduate Student RDF Serialization (Turtle Format) Inference (at instance-level) Student123 Course456 takes
  • 22. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Creating an RDF KG for the University Domain Person Student Professor @prefix univ: <http://univ.org#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . # Student 123 takes Graduate Course 456 univ:student123 univ:takes univ:course456 . univ:course456 rdf:type univ:GraduateCourse . # what can we infer? # domain of takes is Student univ:student123 rdf:type univ:Student . # Student is a subclass of Person univ:student123 rdf:type univ:Person . Course University takes teaches offers Graduate Course Graduate Student RDF Serialization (Turtle Format) Inference (at instance-level) Student123 Course456 takes
  • 23. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Creating an RDF KG for the University Domain Person Student Professor @prefix univ: <http://univ.org#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . # Student 123 takes Graduate Course 456 univ:student123 univ:takes univ:course456 . univ:course456 rdf:type univ:GraduateCourse . # what can we infer? # domain of takes is Student univ:student123 rdf:type univ:Student . # Student is a subclass of Person univ:student123 rdf:type univ:Person . # student123 takes a Graduate Course univ:student123 rdf:type univ:GraduateStudent . Course University takes teaches offers Graduate Course Graduate Student RDF Serialization (Turtle Format) Inference (at instance-level) Student123 Course456 takes
  • 24. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Creating an RDF KG for the University Domain Person Student Professor @prefix univ: <http://univ.org#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . # Student 123 takes Graduate Course 456 univ:student123 univ:takes univ:course456 . univ:course456 rdf:type univ:GraduateCourse . # what can we infer? # domain of takes is Student univ:student123 rdf:type univ:Student . # Student is a subclass of Person univ:student123 rdf:type univ:Person . # student123 takes a Graduate Course univ:student123 rdf:type univ:GraduateStudent . # range of takes is Course and GraduateCourse subclass of Course univ:course456 rdf:type univ:Course . Course University takes teaches offers Graduate Course Graduate Student RDF Serialization (Turtle Format) Inference (at instance-level) Student123 Course456 takes
  • 25. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Graphical Tools like Protégé Make Things Easier
  • 26. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Agenda 26 Definition and Use Cases for Knowledge Graphs Modeling Knowledge Graphs using W3C RDF Using Oracle RDF Knowledge Graph Performing Analytics with RDF Knowledge Graph Data 1 2 3 4
  • 27. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Database Version and Options for RDF Knowledge Graph • On-premise – Oracle Database Enterprise Edition with Spatial & Graph and Partitioning options • Oracle Database Cloud Services – DBCS (OCI) – Exadata Cloud Service – ATP-Dedicated (planned) 27 https://blogs.oracle.com/oraclespatial has a 3-part series on getting started with RDF on DBCS “Using RDF Knowledge Graphs in the Oracle Public Cloud”
  • 28. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 28 Oracle Spatial and Graph 18c – RDF Knowledge Graph Architecture Generic Relational Schema for Storing RDF Data RDF Views of Relational Data SPARQL-to-SQL Query Translator Forward-chaining OWL Reasoner RDF Bulk Loader SPARQL Update Processor SQL and PL/SQL API Support for Apache Jena (Java API) Protégé Plugin Fuseki Endpoint Cytoscape Plugin SQL Developer RDF Support Enterprise Manager and Other DB Tools
  • 29. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Loading RDF Data
  • 30. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Source for RDF data • Formatted File – RDF formatted files: N-Triple, N-Quad, Turtle, RDF/XML, Trig, JSON-LD, etc. • SPARQL Update – Incremental insert, add, copy, etc. • (External) Tables/Views or SQL Query – Any tabular rowsource + W3C RDB2RDF mapping Formatted File or String, Tabular Rowsource 30
  • 31. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | RDF Bulk Loader 31 Staging Table Client DB Server RDF Relational Schema Parallel RDF Bulk Load • Value Checking • Canonicalization • Duplicate Elimination • Internal ID Generation • Index Creation Step 2 N-Triple N-Quad N-Triple N-Quad Turtle RDF/XML Trig JSON-LD Others External Table Oracle Protégé Plugin Jena Adapter Java API Step 1 Oracle SQL*Loader
  • 32. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Relational Data to RDF (W3C RDB2RDF) • Direct Mapping – Automatically generates a mapping based on an input relational schema. – A Direct Mapping of Relational Data to RDF. W3C Recommendation 27 September 2012 http://www.w3.org/TR/2012/REC-rdb-direct-mapping-20120927/ • R2RML (RDB to RDF Mapping Language) – An RDF vocabulary for specifying customized relational data to RDF mapping. – R2RML: RDB to RDF Mapping Language. W3C Recommendation 27 September 2012. http://www.w3.org/TR/2012/REC-r2rml-20120927/ Two types of mapping: Direct and R2RML 32
  • 33. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Using Direct Mapping: Overall Flow Direct Map Author RDB2RDF Processor SPARQL to SQL Translator List of Tables and Views R2RML map & schema 33 RDF Triplestore Relational Tables & Views Query Writer SPARQL QUERY
  • 34. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Using R2RML: Overall Flow R2RML Map Author RDB2RDF Processor SPARQL to SQL Translator R2RML Mapping R2RML map & schema 34 RDF Triplestore Relational Tables & Views Query Writer SPARQL QUERY
  • 35. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | R2RML Schema (Classes and Relations) Source: Das, Sundara, and Cyganiak. R2RML: RDB to RDF Mapping Language. W3C Recommendation 27 September 2012. http://www.w3.org/TR/2012/REC-r2rml-20120927/
  • 36. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Mapping EMP and DEPT Tables to RDF 7782 John DB 10 constraints EMP ENO ENAME EXPERTISE DNO 10 Sales NYC DNO DNAME LOC DEPT pkey ref. pkey x:Department http://x.com/Dept#{DNO} class Subject Predicate-object pairs <http://x.com/Dept#10> rdf:type x:Department ; <../Dept/Deptno> 10 ; <../Dept/DeptName> “Sales” ; <../Dept/Location> “NYC” . TriplesMap  DEPT
  • 37. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Mapping EMP and DEPT Tables to RDF 7782 John DB 10 constraints EMP ENO ENAME EXPERTISE DNO 10 Sales NYC DNO DNAME LOC DEPT pkey ref. pkey x:Employee http://x.com/Emp#{ENO} Predicate-object pairs Subject class <http://x.com/Emp#7782> rdf:type x:Employee ; <../Emp/Empno> 7782 ; <../Emp/EmpName> “John” ; <../Emp/Expertise> “DB” ; <../Emp/DeptNum> 10 ; <../Emp/Department> <http://x.com/Dept#10> . TriplesMap  EMP
  • 38. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Oracle SQL Developer RDF Support 40 • R2RML Mapping Editor – Shows a tree view of an R2RML mapping – Allows drill down from Triples Map -> Subject Map -> Predicate-Object Map – You can edit or delete existing elements or add new ones – “Commit Mapping” refreshes the associated RDF view
  • 39. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Performing Inference
  • 40. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Core Inference Features in Oracle Database 42 • Oracle provides native inference in the database for • RDFS, RDFS++ • OWLPRIME, OWL2RL, OWL2EL, SKOSCORE • User-defined rules • User-defined inferencing • Inference done using forward chaining • Triples inferred and stored ahead of query time • Removes on-the-fly reasoning and results in fast query times • Proof generation • Shows one deduction path
  • 41. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | • Option 1: Add user-defined rules • Example: sibling rule • Option 2: Leverage external DL reasoners • Option 3: User-defined inferencing in Oracle Database Release 12c Extending Semantics Supported by Native OWL Inference Engine Antecedents  Consequents ?z :parentOf ?x . ?z :parentOf ?y . ?x owl:differentFrom ?y . ?x :siblingOf ?y 43
  • 42. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Extensible Architecture for External OWL DL Reasoners External In-Memory OWL DL Reasoners TrOWL/REL Jena APIs through Adapter for Apache Jena Oracle’s Native Inference Engine for OWL 2 RL, EL & user- defined rules Materialized Inference 44
  • 43. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | • SDO_SEM_INFERENCE. INF_EXT_ACTION_START • SDO_SEM_INFERENCE. INF_EXT_ACTION_RUN • SDO_SEM_INFERENCE. INF_EXT_ACTION_END User-Defined Inferencing in Oracle Database Release 12c 45
  • 44. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | SPARQL Query and Update
  • 45. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | What is SPARQL? • SPARQL Protocol and RDF Query Language – W3C standard for querying and manipulating RDF content – Queries/updates and corresponding results are communicated via HTTP with a SPARQL endpoint – A SPARQL endpoint implements the SPARQL protocol and serves RDF data from a RDF triplestore or RDF view
  • 46. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | SPARQL Graph Pattern Basic unit of SPARQL queries univ:Student univ:student123 univ:student456 "John Green" "1999-06-15"^^xsd:date "male" "Susan Blue" "2000-02-10"^^xsd:date "female" rdf:type rdf:type foaf:name vcard:BDAY foaf:gender foaf:name vcard:BDAY foaf:gender univ:Student univ:student123 "John Green" "1999-06-15"^^xsd:date "male" rdf:type foaf:name vcard:BDAY foaf:gender ?t ?p ?n ?b ?g Result 1: {?t=univ:Student, ?p=univ:student123, ?n="John Green", ?g="male", ?b="1999-06-15"^^xsd:date} Result 2: {?t=univ:Student, ?p=univ:student456, ?n="Susan Blue", ?g="female", ?b="2000-02-10"^^xsd:date}
  • 47. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | ?t ?p ?n ?b ?g SPARQL Graph Pattern Basic unit of SPARQL queries rdf:type foaf:name vcard:BDAY foaf:gender PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#> SELECT ?t ?n ?b ?g WHERE { ?p rdf:type ?t . ?p foaf:name ?n . ?p vcard:BDAY ?b . ?p foaf:gender ?g } How do we express this with SPARQL? Basic Graph Pattern (BGP)
  • 48. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | SPARQL FILTER: Restricting Solutions PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?n ?b ?g WHERE { ?p foaf:name ?n . ?p vcard:BDAY ?b . ?p foaf:gender ?g FILTER ( ?b < "2000-01-01"^^xsd:date )} Find all people born before 2000
  • 49. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | SPARQL Subqueries & Aggregates SELECT DISTINCT ?n ?o ?p ?st ?cnt WHERE { ?s foaf:name ?n . ?s vcard:BDAY ?b . ?s foaf:gender ?g { SELECT ?s (COUNT(?c) AS ?cnt) WHERE { ?s univ:takes ?c } GROUP BY ?s HAVING (COUNT(?c) > 20) } } ORDER BY DESC(?cnt) ASC(?n) Find information about Students that have taken more than 20 classes
  • 50. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | SPARQL Property Path: Matching Arbitrary Length Paths SELECT ?friend WHERE { ?student foaf:name "Bill Brown" . ?student foaf:friendOf+ ?friend } Find all the friends of Bill Brown Regular expression-style syntax Syntax Matches :predicate+ Path composed of one or more repetitions of :predicate :predicate* Path composed of zero or more repetitions of :predicate
  • 51. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | SPARQL 1.1 Update • SPARQL 1.1 Update is intended to be a standard language for specifying and executing updates to RDF graphs in a Graph Store. Graph Update operations INSERT DATA Adds some triples, given inline in the request, into a graph. DELETE DATA Removes some triples, given inline in the request, if the respective graph contains those. DELETE/INSERT Perform pattern-based actions for graph updates LOAD Reads the contents of a document representing a graph into a graph in the Graph Store. CLEAR Removes all the triples in (one or more) graphs. Graph Management operations CREATE Creates a new graph in stores that support empty graphs. DROP Removes a graph and all of its contents. COPY Modifies a graph to contain a copy of another. MOVE Moves all of the data from one graph into another. ADD Reproduces all data from one graph into another.
  • 52. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | SPARQL and SPARQL in SQL Architecture Support for Apache Jena Standard SPARQL Endpoint Enhanced with query management control SEM_MATCH SEM_APIS.UPDATE_MODELSQL Java HTTP SPARQL-to-SQL Core Logic Apache Jena
  • 53. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | SPARQL in SQL: SEM_MATCH SELECT n1, n2 FROM TABLE( SEM_MATCH( 'PREFIX foaf: <http://...> SELECT ?n1 ?n2 FROM <http://g1> WHERE {?p foaf:name ?n1 OPTIONAL {?p foaf:knows ?f . ?f foaf:name ?n2 } FILTER (REGEX(?n1, "^A")) } ORDER BY ?n1 ?n2', SEM_MODELS('M1'),…)); n1 n2 Alex Jerry Alex Tom Alice Bill Alice Jill Alice John
  • 54. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | SPARQL in SQL: SEM_MATCH • Extends SQL with full SPARQL 1.1 query constructs • Benefits: – Integrates graph data with existing enterprise data – JOINs with other relational (and object-relational) data – Allows SQL constructs/functions – DDL Statements: create tables/views – Allows use of enterprise SQL development tools
  • 55. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | SPARQL Update: SEM_APIS.UPDATE_MODEL begin sem_apis.update_model( apply_model=>'M1', update_stmt=>'INSERT {?s :mbox ?n} WHERE {?s :email ?n}' ); end; /
  • 56. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Tools Make Things Easier SQL Developer RDF Plugin Jena Fuseki Web Application
  • 57. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Agenda 64 Definition and Use Cases for Knowledge Graphs Modeling Knowledge Graphs using W3C RDF Using Oracle RDF Knowledge Graph Performing Analytics with RDF Knowledge Graph Data 1 2 3 4
  • 58. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 65 Oracle RDF KG as an Integration / Analytics Platform My SQL SQL Server DB2 Oracle Big Data Connectors External Table / DB Link Oracle Database Gateways Oracle Advanced AnalyticsOBIEE Relational Table/View Property Graph View Property Graph View of RDF RDF View PGX CREATE VIEW SEM_MATCH
  • 59. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Creating Property Graph Views on an RDF Graph public static void createPropertyGraphViewOnRDF(Connection conn, String pgGraphName, String rdfModelName, boolean virtualModel, PGUtils.RDFPredicate[] predListForVertexAttrs, PGUtils.RDFPredicate[] predListForEdges) This method creates the property graph views (vertex and edge views) for the given RDF model. Parameters: conn - a connection instance to Oracle database pgGraphName - the name of the property graph to be created rdfModelName - the name of the RDF model virtualModel - a flag represents if the RDF model is virtual model or not predListForVertexAttrs - an array of RDFPredicate objects specifying how to create vertex view using these predicates predListForEdges - an array of RDFPredicate specifying how to create edge view using these predicates
  • 60. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Creating Property Graph Views on an RDF Graph // create PG view on RDF model PGUtils.createPropertyGraphViewOnRDF(conn, "articles", "articles", false, predsForVertexAttrs, predsForEdges); // get the Property Graph instance oracle = new Oracle(jdbcUrl, user, password); pggraph = OraclePropertyGraph.getInstance(oracle, "articles"); // use like a normal Property Graph instance System.err.println("------ Vertices from property graph view ------"); pggraph.getVertices(); System.err.println("------ Edges from property graph view ------"); pggraph.getEdges();
  • 61. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Questions?
  • 62. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 69