SlideShare uma empresa Scribd logo
1 de 63
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
DATAVERSITY
 
Ifw framework for banking industry presentation
Ifw framework for banking industry presentationIfw framework for banking industry presentation
Ifw framework for banking industry presentation
Ravi Sarkar
 
Data Mesh in Azure using Cloud Scale Analytics (WAF)
Data Mesh in Azure using Cloud Scale Analytics (WAF)Data Mesh in Azure using Cloud Scale Analytics (WAF)
Data Mesh in Azure using Cloud Scale Analytics (WAF)
Nathan Bijnens
 
Designing An Enterprise Data Fabric
Designing An Enterprise Data FabricDesigning An Enterprise Data Fabric
Designing An Enterprise Data Fabric
Alan McSweeney
 

Mais procurados (20)

Intro to Neo4j
Intro to Neo4jIntro to Neo4j
Intro to Neo4j
 
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
 
Using AWS IoT for Industrial Applications - AWS Online Tech Talks
Using AWS IoT for Industrial Applications - AWS Online Tech TalksUsing AWS IoT for Industrial Applications - AWS Online Tech Talks
Using AWS IoT for Industrial Applications - AWS Online Tech Talks
 
Data Lake Architecture – Modern Strategies & Approaches
Data Lake Architecture – Modern Strategies & ApproachesData Lake Architecture – Modern Strategies & Approaches
Data Lake Architecture – Modern Strategies & Approaches
 
Ifw framework for banking industry presentation
Ifw framework for banking industry presentationIfw framework for banking industry presentation
Ifw framework for banking industry presentation
 
Slides: Knowledge Graphs vs. Property Graphs
Slides: Knowledge Graphs vs. Property GraphsSlides: Knowledge Graphs vs. Property Graphs
Slides: Knowledge Graphs vs. Property Graphs
 
Leveraging Generative AI to Accelerate Graph Innovation for National Security...
Leveraging Generative AI to Accelerate Graph Innovation for National Security...Leveraging Generative AI to Accelerate Graph Innovation for National Security...
Leveraging Generative AI to Accelerate Graph Innovation for National Security...
 
Modernizing to a Cloud Data Architecture
Modernizing to a Cloud Data ArchitectureModernizing to a Cloud Data Architecture
Modernizing to a Cloud Data Architecture
 
Azure Synapse 101 Webinar Presentation
Azure Synapse 101 Webinar PresentationAzure Synapse 101 Webinar Presentation
Azure Synapse 101 Webinar Presentation
 
Data Mesh in Azure using Cloud Scale Analytics (WAF)
Data Mesh in Azure using Cloud Scale Analytics (WAF)Data Mesh in Azure using Cloud Scale Analytics (WAF)
Data Mesh in Azure using Cloud Scale Analytics (WAF)
 
Designing An Enterprise Data Fabric
Designing An Enterprise Data FabricDesigning An Enterprise Data Fabric
Designing An Enterprise Data Fabric
 
Introduction to Knowledge Graphs and Semantic AI
Introduction to Knowledge Graphs and Semantic AIIntroduction to Knowledge Graphs and Semantic AI
Introduction to Knowledge Graphs and Semantic AI
 
安全SD-WAN-Fortinet-AWS Summit2022.pptx
安全SD-WAN-Fortinet-AWS Summit2022.pptx安全SD-WAN-Fortinet-AWS Summit2022.pptx
安全SD-WAN-Fortinet-AWS Summit2022.pptx
 
Hybrid cloud and azure stack
Hybrid cloud and azure stackHybrid cloud and azure stack
Hybrid cloud and azure stack
 
Data Mesh
Data MeshData Mesh
Data Mesh
 
#MSCollabMTL 2019: Mettre en place une gouvernance pour la power platform. #P...
#MSCollabMTL 2019: Mettre en place une gouvernance pour la power platform. #P...#MSCollabMTL 2019: Mettre en place une gouvernance pour la power platform. #P...
#MSCollabMTL 2019: Mettre en place une gouvernance pour la power platform. #P...
 
Big Data Processing With Spark
Big Data Processing With SparkBig Data Processing With Spark
Big Data Processing With Spark
 
Introduction to PySpark
Introduction to PySparkIntroduction to PySpark
Introduction to PySpark
 
Knowledge Graph Generation from Wikipedia in the Age of ChatGPT: Knowledge ...
Knowledge Graph Generation  from Wikipedia in the Age of ChatGPT:  Knowledge ...Knowledge Graph Generation  from Wikipedia in the Age of ChatGPT:  Knowledge ...
Knowledge Graph Generation from Wikipedia in the Age of ChatGPT: Knowledge ...
 
A Cloud Journey - Move to the Oracle Cloud
A Cloud Journey - Move to the Oracle CloudA Cloud Journey - Move to the Oracle Cloud
A Cloud Journey - Move to the Oracle Cloud
 

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

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)
 
Wed roman tut_open_datapub
Wed roman tut_open_datapubWed roman tut_open_datapub
Wed roman tut_open_datapub
eswcsummerschool
 
Wed batsakis tut_challenges of preservations
Wed batsakis tut_challenges of preservationsWed batsakis tut_challenges of preservations
Wed batsakis tut_challenges of preservations
eswcsummerschool
 
Wed batsakis tut_chalasdlenges of preservations
Wed batsakis tut_chalasdlenges of preservationsWed batsakis tut_chalasdlenges of preservations
Wed batsakis tut_chalasdlenges of preservations
eswcsummerschool
 

Semelhante a 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
 

Mais de Jean Ihm

Mais de 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
 

Último

Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
karishmasinghjnh
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 

Último (20)

Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
hybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptxhybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptx
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 

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