Title: Corporate PPT Template
1This presentation is for informational purposes
only and may not be incorporated into a contract
or agreement.
2RDF Data Management In Oracle10g Jayant
Sharma Technical Director, SpatialOracle Server
Technologies
3Overview
- Network Data Model
- RDF Technology Background
- RDF Data Model, Query, Rulebases
- Summary
4Managing Spatial Types in Oracle10g
Road Networks (directed graph)
Zip Codes Boundaries (polygons)
Annotation (text)
Oracle10g Spatial
Data
Aerial Imagery (raster)
Business Addresses (geocoded points)
Structured Topology (parcels)
5Network Data Model (NDM)
- Feature of Oracle Spatial 10g
- Tool for managing graphs (networks) in the
database - Supports directed and undirected networks
- spatial networks
- logical networks
- Consists of a network database schema, and a Java
API for representation and analysis.
6Network Schema
- Network Metadata
- Name, Type, Node/Link/Path Table Information
- Network Tables
- Node Table
- Node_ID, Node_Type, Geometry,
- Link Table
- Link_ID, Link_Type, Start_Node_ID, End_Node_ID,
Cost, Geometry, - Path Table
- Path_ID, Start_Node_ID, End_Node_ID, Cost,
Geometry, Path Links, - Application Information is added to network
schema - Add additional columns in node, link, and path
tables directly - Add foreign key(s) to node, link, and path tables
7Network Data Model APIs
- PL/SQL Package (server-side)
- Network data query and management
- Maintains referential integrity and validation
- Supports link/node/path updates
- Java API (mid-tier or client side)
- Network loading/storage
- Network analysis
- Network Creation/Editing
- Java Functional Extensibility
- Network, Node, Link, Path are Java Interfaces
- Application-based network analysis extensions
8Oracle 10g RDF Approach
- Extended existing Oracle10g network (graph) data
model (NDM) to support RDF object types - Support for user-defined rules, rulebases, rules
indexes - RDF data model with (user-defined) rules to
support inferencing - Enable combined SQL query of enterprise database
and RDF graphs - Support large, complex models (10s of millions
statements) - Easily extensible by 3rd party tools/apps
9RDF Graph
- Types of elements URIs, Blank Nodes, and
Literals - URIs http//www.oracle.com/peopleJohn
- Blank Nodes _r1
- Plain Literals John, color_at_en-us
- Typed Literals 16xsdint, Johnxsdstring
- RDF Triples ltsubject predicate objectgt
- Subject URIs or Blank Nodes
- Predicate URIs
- Objects URIs, Blank Nodes, or Literals
- A set of RDF triples constitute an RDF graph
10Family Schema
Male
fatherOf
brotherOf
siblingOf
Person
parentOf
motherOf
sisterOf
Female
rdfssubClassOf
rdfsrange
rdfsdomain
rdfssubPropertyOf
11RDF Graph Example
- Family Classes and Properties
- (Male rdfssubClassOf Person)
- (Female rdfssubClassOf Person)
- (fatherOf rdfssubPropertyOf parentOf)
- (motherOf rdfssubPropertyOf parentOf)
- (brotherOf rdfssubPropertyOf siblingOf)
- (sisterOf rdfssubPropertyOf siblingOf)
12RDF Graph Example
- Family Domains and Ranges of Properties
- (fatherOf rdfsdomain Male)
- (fatherOf rdfsrange
Person) - (motherOf rdfsdomain Female)
- (motherOf rdfsrange Person)
- (brotherOf rdfsdomain Male)
- (brotherOf rdfsrange Person)
- (sisterOf rdfsdomain Female)
- (sisterOf rdfsrange
Person)
13Family Data
Janice
John
Martha
Matt
Suzie
Sammy
Cindy
Tom
Jack
Cathy
Female
Male
fatherOf
motherOf
rdftype
sisterOf
14Components
Appl. Tables
Rulebase 1
Rulebase 2
Rulebase m
A1
Model 1
RDF Query
DDL Load DML
Rules Index 1
Rules Index 2
Model 2
A2
Rules Index p
An
Model n
15Querying RDF data
16RDF Querying Problem
- Given
- An RDF dataset (graphs) to be searched
- A graph-pattern containing a set of variables
- Find
- Subgraphs that match the graph-pattern
- Return
- Sets of variable bindings
- each set corresponds to a matching subgraph
(substitution in graph-pattern produces subgraph)
17RDF Querying Approach
- SQL-based approach
- Introduces a SQL table function SDO_RDF_MATCH
that accepts RDF queries - Benefits
- Leverage powerful constructs of SQL to process
RDF Query results - Combine with SQL queries without staging
- Alternate approach
- Create new (declarative, SQL-like) languages
e.g., RQL, SeRQL, TRIPLE, Versa, SPARQL, RDQL,
RDFQL, SquishQL
18Embedding RDF Query in SQL
- SELECT
- FROM , TABLE (
- ) t,
- WHERE
RDF Query (expressed via SDO_RDF_MATCH invocation)
19SDO_RDF_MATCH Table Func
- Input Parameters
- SDO_RDF_MATCH (
- Query, ? graph-pattern (with variables)
- Models, ? set of RDF models
- Rulebases, ? set of rulebases (e.g., RDFS)
- Aliases, ? aliases for namespaces
- Filter ? additional selection criteria
- )
- Return type in definition is AnyDataSet
- Actual return type is determined at compile time
based on the arguments for each specific
invocation
20Query Example
- select m from TABLE(SDO_RDF_MATCH(
- '(?m rdftype Male)',
- SDO_RDF_Models('family'),
- null,
- SDO_RDF_Aliases(
- SDO_RDF_Alias('', 'http//www.example.org/f
amily/')), - null))
- M
- --------------------------------------------------
------------------------------ - http//www.example.org/family/Jack
- http//www.example.org/family/Tom
- Table function returns a single-column table M
21Join with SQL tables Example
- Find salary and hiredate of Matts grandfather(s)
- SELECT emp.name, emp.salary, emp.hiredateFROM
emp, TABLE(SDO_RDF_MATCH(
(?x fatherOf ?y)
(?y parentOf Matt)
(?x name ?name),
SDO_RDF_Models(family'),
)) tWHERE emp.namet.name
22Inference
23Rulebase Overview
- Each rulebase consists of a set of rules
- Each rule consists of
- antecedent graph-pattern
- filter condition (optional)
- consequent graph-pattern
- One or more rulebases may be used with relevant
RDF models (graphs) to infer new data
24Rulebase Example
- Oracle supplied, pre-loaded rulebases e.g., RDFS
- rdfssubClassOf is transitive and reflexive
- Antecedent (?x rdftype ?y) (?y
rdfssubClassOf ?c) - Consequent (?x rdftype ?c)
- Antecedent (?x ?p ?y) (?p rdfsdomain ?c)
- Consequent (?x rdftype ?c)
- Rules in a rulebase family_rb
- Antecedent (?x parentOf ?y) (?y parentOf
?z) - Consequent (?x grandParentOf ?z)
25Rules Index Overview
- A rules index is created on an RDF dataset
(consisting of a set of RDF models and a set of
RDF rulebases) - A rules index contains RDF triples inferred from
the model-rulebase combination
26Rules Index Example
- A rules index may be created on a dataset
consisting of - family RDF data, and
- family_rb rulebase (shown earlier)
- The rules index will contain inferred triples
showing grandParentOf relationship
27RDF Query with Inference
28Query w/ RDFSFamily Inference
- select x, y from TABLE(SDO_RDF_MATCH(
- '(?x grandParentOf ?y) (?x rdftype
Male)', - SDO_RDF_Models('family'),
- SDO_RDF_Rulebases('RDFS', 'family_rb'),
- SDO_RDF_Aliases(
- SDO_RDF_Alias('','http//www.example.org/fa
mily/')), - null))
- X Y
- --------------------------------------------------
---- ---------------------------------------------
-------- - http//www.example.org/family/John http//www.exam
ple.org/family/Cindy - http//www.example.org/family/John http//www.exam
ple.org/family/Tom - http//www.example.org/family/John http//www.exam
ple.org/family/Jack - http//www.example.org/family/John http//www.exam
ple.org/family/Cathy
29Some Oracle10g RDF Partners
- Cerebra
- Cognia
- Siderean
- Tom Sawyer
- Top Quadrant
30Summary
- Comprehensive, fully integrated into SQL RDF
support in Oracle 10g Release 2 - Models (Graphs)
- Rulebases
- Rules Indexes
- Query using SDO_RDF_MATCH table function
- Documentation and White Papers
- http//www.oracle.com/technology/tech/semantic_tec
hnologies/index.html