Slide 1
RDF in Oracle Spatial
Nicole Alexander, Xavier Lopez,
Siva Ravada, Susie Stephens &
Jack Wang
Oracle Corporation
October 27 – 28, 2004
RDF in Oracle Spatial
This paper is based on Oracle 10g support for RDF data storage in Oracle
Spatial.
Slide 2
Overview
"
"
"
"
"
"
"
"
"
Oracle Spatial NDM
Metadata and Namespaces
Statements
Subjects and Objects
Properties
Reification
Containers and Collections
RDF Datatypes and Constructors
Querying RDF Data
Overview
This presentation is a high-level overview of RDF data storage in the Oracle
Spatial Network Data Model.
I will first introduce the Oracle Spatial Network Data Model product, and then
describe how it has been extended to store RDF-modeled data.
At the end of this presentation you will have a good idea of how RDF data is
handled in an Oracle database.
Slide 3
Network 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.
Network Data Model (NDM)
Oracle Spatial is an option of the Oracle database, and the Network Data Model
is one of the many features provided with Oracle Spatial 10g.
A network or graph captures relationships between objects using connectivity.
NDM supports both directed and undirected networks, which can be either spatial
or logical.
Spatial networks contain both connectivity information and geometric information.
Logical Networks contain connectivity information but no geometric information.
NDM consists of two components: a network database schema, and a Java API.
The network schema contains network metadata and tables for nodes and links.
The Java API enables network representation and network analysis.
Slide 4
RDF in Oracle Spatial NDM
S1
O1
O2
S2
P2
RDF Triples:
•{S
1, P1, O1}
•{S
1, P2, O2}
•{S
2, P2, O2}
P
2
P1
"
"
"
RDF data stored in a directed, logical network
Subjects and objects mapped to nodes, and
properties to links that have subject start nodes and
object end nodes
Links represent complete RDF triples.
RDF in Oracle Spatial NDM
NDM stores RDF data using a directed, logical network.
Generally speaking, NDM maps subjects and objects of statements to nodes in a
network and properties to links. In NDM, nodes are stored in a system nodes’
table and links in a system links’ table. Each link must have a start node and and
end node. For RDF storage, the start node of a link is the subject of a statement,
and the end node of a link is the object of a statement.
A link therefore represents a complete RDF triple.
A key feature of RDF storage in NDM is that subject and object nodes are stored
only once, regardless of the number of times they participate in triples.
Subject and object nodes are reused, if they already exist in the database.
A new link, however, is always created whenever a new triple is inserted.
When a triple is deleted from the database, the corresponding link is directly
removed. However, the nodes attached to this link are not removed if there is at
least one other link
connected to them.
This is the basic storage model for RDF-modeled data. The rest of the
presentation reviews the enhancements to NDM to fully support the management
of RDF-modeled data.
Slide 5
Metadata and Namespaces
Metadata for RDF Models: RDF_MODEL$
MODEL_NAMEMODEL_ID
"
"Namespaces for RDF Models: RDF_NAMESPACE$
NAMESPACE_NAMENAMESPACE_ID
Metadata and Namespaces
Metadata for RDF Models
RDF_MODEL$ is a system level table created to store information on all the
models defined in the database.
When a new RDF model is created, an entry is made to this table.
The MODEL_ID is automatically generated and can be used instead of the
model’s name to refer to a particular model.
Namespaces for RDF Models
Namespaces are used in RDF/XML documents to make these documents
readable.
In NDM, namespaces are stored directly with their subject, properties, and
objects. However, this table can be optionally used to catalog all the namespaces
used in an RDF universe.