- Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use...
Transcript of - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use...
![Page 1: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/1.jpg)
![Page 2: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/2.jpg)
![Page 3: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/3.jpg)
<Insert Picture Here>
Why, When, and How to Use Oracle Database 11g Semantic TechnologiesXavier Lopez, Ph.D, Director, Oracle Server TechnologiesSouripriya Das, Ph.D, Consultant Member, Oracle Server Technologies
![Page 4: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/4.jpg)
Semantic Data Management Characteristics
• Discovery of data relationships across…• Structured data (database, apps, web services)• Unstructured data (email, office documents) Multi-data types
(graphs, spatial, text, sensors)
• Text Mining & Web Mining infrastructure• Terabytes of structured & unstructured data
• Queries are not defined in advance• Schemas are continuously evolving• Overcome isolated systems design• Built on open, industry standards:
• SQL, XML, RDF, OWL, SPARQL
![Page 5: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/5.jpg)
Why is this Useful?
• Designed to represent knowledge in a distributed world
• A method to decompose knowledge into small pieces, with rules about the semantics of those pieces
• RDF data is self-describing; it “means” something
• Allows you to model and integrate DBMS schemas• Allows you to integrate data from different sources
without custom programming
• Supports decentralized data management
• Infer implicit relationships across data
![Page 6: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/6.jpg)
Application Integration
User
Data Ontologies
RDF/OWL
Query & results
Structured & Unstructured Data Sources
![Page 7: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/7.jpg)
Areas of Applicability
• Intelligence, Law Enforcement: • Threat analysis, asset tracking, integrated justice
• Integrated BioInformatics: • Bio-Pathway analysis, protein interaction
• Finance• Fraud detection, Compliance Management
• Web and Social Network Solutions • Recommender, Social Network Analysis, Activity Analysis
• Enterprise Business Applications• Grid resource mgmt, EII, BI, Configuration mgmt.
![Page 8: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/8.jpg)
Integrated Bioinformatics
Source: Siderean Software
![Page 9: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/9.jpg)
Common Information Model (CIM) A Federation of Ontologies
![Page 10: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/10.jpg)
Analytic IntelligenceContext-Specific Access to Knowledge
hasMemberperpetrator
hasMember
alliedWith
perpetrator
hasAlias
hasMember
hasMember
perpetrator
alliedWith
perpetrator
EventPerson
Group
Person
EventPerson
Group
Event
Person
Group
Group
Event
![Page 11: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/11.jpg)
Analytic IntelligenceContext-Specific Access to Knowledge
hasMemberperpetrator
hasMember
alliedWith
perpetrator
hasAlias
hasMember
hasMember
perpetrator
alliedWith
perpetrator
EventPerson
Group
Person
EventPerson
Group
Event
Person
Group
Group
Event
![Page 12: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/12.jpg)
Analytic IntelligenceContext-Specific Access to Knowledge
hasMemberperpetrator
hasMember
alliedWith
perpetrator
hasAlias
hasMember
hasMember
perpetrator
alliedWith
perpetrator
EventPerson
Group
Person
EventPerson
Group
Event
Person
Group
Group
Event
![Page 13: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/13.jpg)
Analytic IntelligenceContext-Specific Access to Knowledge
hasMemberperpetrator
hasMember
alliedWith
perpetrator
hasAlias
hasMember
hasMember
perpetrator
alliedWith
perpetrator
EventPerson
Group
Person
EventPerson
Group
Event
Person
Group
Group
Event
![Page 14: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/14.jpg)
Analytic IntelligenceContext-Specific Access to Knowledge
hasMemberperpetrator
hasMember
alliedWith
perpetrator
hasAlias
hasMember
hasMember
perpetrator
alliedWith
perpetrator
EventPerson
Group
Person
EventPerson
Group
Event
Person
Group
Group
EventW3C RDF & OWL standards
![Page 15: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/15.jpg)
Knowledge Mining Workflows
Information Extraction
Categorization, Feature/term Extraction
Web Resources
News, Email, RSS
Content Mgmt. Systems
Processed Document Collection
Knowledge Mining & Analysis
• Text Indexing using Oracle Text
• Non-Obvious Relationship Discovery
• Pattern Discovery
• Text Mining
• Faceted Search
AnalystBrowsing, Presentation, Reporting, Visualization, Query
SQL/SPARQL Query
Explore
Domain Specific
Knowledge Base
OWL
Ontologies
Ontology Engineering Modeling Process
RDF/OWL
![Page 16: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/16.jpg)
Edit & Transform
• RDF/OWL Data Management
• SQL & SPARQL Query
• Reasoning
• Semantic Rules
• Scalability & Security
• Graph Visualization
• Link Analysis
• Statistical Analysis
• Faceted Search
• Pattern Discovery
• Text Mining
Load, Query
& Inference
Applications &
Analysis
Semantic Data Management Workflow
Other Data Formats
RSS, email
TransactionSystems
Data Sources
Unstructured Content • Entity
Extraction & Transform
• Ontology Engineering
• Categorization
• Custom Scripting
![Page 17: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/17.jpg)
Knowledge Management PlatformAnalyzing Patterns, Trends & Relationships
Entity Matching
Categorization
Non-obvious
Relationship
Analysis
Search and
Text Indexing
Faceted Search
& Discovery
Graph Analysis
Link Analysis
Centrality
Inferencing
(RDFS, OWL)
INFORMATION EXTRACTIONEntity Extraction, Categorization, ETL, Ontology Engineering
PRESENTATION LAYERGraph, Timeline, Metadata, Spatial
Structured DBMS, Unstructured, Spatial, RSS, email, Documents
SPARQL/SQL
APIs
Oracle 11g
RDF/OWL
Knowledge Base
National Security
Financial Risk Analysis
Regulatory Compliance
Life SciencesDrug Discovery
ManufacturingConfiguration Mgmt
Health SciencesBioSurveillance
On
tolo
gy
Ser
vice
s fo
r B
usi
nes
s M
etad
ata
Customer Solutions
Oracle Technologies
Partner Technologies
![Page 18: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/18.jpg)
<Insert Picture Here>
DB Semantic Technology in Oracle 11gTechnical Overview
![Page 19: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/19.jpg)
Semantic Technology: Building Blocks
• Representation• RDF (Resource Description Framework)• Vocabularies
• RDFS (RDF Schema Language)• OWL (Web Ontology Language)
• Inference• Implicit rules that capture semantics of each vocabulary• RDF, RDFS, OWL-Lite, OWL-DL, OWL-Full
• Query• Using graph-patterns in languages such as SPARQL
![Page 20: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/20.jpg)
Semantic Technology Stack
Standards
based
http://www.w3.org/2007/03/layerCake.svg
![Page 21: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/21.jpg)
RDF
• Originally created to encode metadata such as ‘author’, ‘date’, etc. for web resources.
• Recently, it has become popular to relate things in the real-world such as people, places, concepts etc.
• The basic unit of information (fact) is represented as <subject, predicate, object> triple
• Triples together form a graph, connecting pieces of data
subject objectpredicate
:John “32”^^xsd:decimal:age
:Mary:friendOf
![Page 22: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/22.jpg)
Vocabularies (RDFS and OWL)
• RDFS (RDF Schema)• Structuring of resources and properties
• rdfs:class Class of resources
• rdfs:subClassOf hierarchy of classes
• rdfs:subPropertyOf hierarchy of properties
• OWL (Web Ontology Language)• Builds on RDF(S) …
• Property Characteristics: transitivity, symmetry, functional, inverse functional, inverse
• Class construction via set operations and property restrictions • Separate layers have been defined balancing expressibility vs.
implementability: OWL Lite, OWL DL, OWL Full
![Page 23: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/23.jpg)
RDF(S) Example
:John rdf:type :SWcompanyEmployee
Derived Facts
:OracleHQemployee :SWcompanyEmployeerdfs:subClassOf
:John :California
:corpOfficeLocrdf:type
:OracleHQemployee rdfs:subClassOf :SWcompanyEmployee:OracleHQemployee :corpOfficeLoc :California:John rdf:type :Oracle HQ Employee
Asserted Facts <http://example.org/emp>
rdf:type
![Page 24: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/24.jpg)
Graph Pattern Based Query (SPARQL)
SELECT x, yFROM <http://example.org/emp> WHERE { ?x rdf:type ?y }
x y ----------- ------------------------------- :John :OracleHQemployee :John :SWcompanyEmployee
:OracleHQemployee :SWcompanyEmployeerdfs:subClassOf
:John :California
:corpOfficeLocrdf:type
rdf:type
![Page 25: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/25.jpg)
OWL Example
:California
:partOf rdf:type owl:TransitiveProperty :California :partOf :USA:USA :partOf :NorthAmerica
:USA :NorthAmerica:partOf :partOf
Asserted Facts (referencing OWL) <http://example.org/gmap>
:partOf owl:TransitivePropertyrdf:type
:California :partOf :NorthAmerica
Derived Facts
:partOf
![Page 26: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/26.jpg)
Advancing W3C Semantic Standards
• Our implementation entirely based on W3C standards (RDF, RDFS, OWL)• Native SPARQL support is planned
• Members of following W3C Web Semantic Activities:• W3C Data Access Working Group (DAWG)• W3C OWL 1.1 Working group• W3C Semantic Web Education & Outreach (SWEO)• W3C Health Care & Life Sciences Interest Group (HCLS) • W3C Multimedia Semantics Incubator group
22
![Page 27: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/27.jpg)
Technical Features
• Storage model, loading, and management for data represented in RDF/OWL
• SQL-based query of RDF/OWL data• Ontology-assisted query of Relational data
• Native inferencing engine to infer new relationships from RDF/OWL data
![Page 28: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/28.jpg)
Functionality: Overview
RDF/OWL data and
ontologies & rulebases
Enterprise (Relational)
data
Query RDF/OWL data
and ontologies
INFERS
TO
RE
QUERY
RD
F/S
Use
r-de
f.
Bat
ch-
Load
Incr
. D
ML
![Page 29: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/29.jpg)
Functionality: Overview
RDF/OWL data and
ontologies & rulebases
Enterprise (Relational)
data
Query RDF/OWL data
and ontologies
INFERS
TO
RE
QUERY
RD
F/S
Use
r-de
f.
Bat
ch-
Load
Bul
k-Lo
ad
Incr
. D
ML
![Page 30: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/30.jpg)
Functionality: Overview
RDF/OWL data and
ontologies & rulebases
Enterprise (Relational)
data
Query RDF/OWL data
and ontologies
INFERS
TO
RE
QUERY
RD
F/S
Use
r-de
f.
Bat
ch-
Load
OW
Lsub
sets
Bul
k-Lo
ad
Incr
. D
ML
![Page 31: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/31.jpg)
Functionality: Overview
RDF/OWL data and
ontologies & rulebases
Enterprise (Relational)
data
Query RDF/OWL data
and ontologies
INFERS
TO
RE
Ontology-Assisted Query of
Enterprise Data
QUERY
RD
F/S
Use
r-de
f.
Bat
ch-
Load
OW
Lsub
sets
Bul
k-Lo
ad
Incr
. D
ML
![Page 32: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/32.jpg)
Storage: Overview
Model 1
Model 2
Model n
…
OWL subset
RDF / RDFS
Rulebase m
…
Inferred Triple Set 1
Inferred Triple Set 2
Inferred Triple Set p
A1
A2
An
Application Tables with RDF object
type columns
…
RDF/OWL data
and ontologies
Vocabularies and Rulebases
Rules Indexes
(Derived data)R
R
R
her
man
sco
ttsc
ott
![Page 33: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/33.jpg)
Storage: Overview
Model 1
Model 2
Model n
…
OWL subset
RDF / RDFS
Rulebase m
…
Inferred Triple Set 1
Inferred Triple Set 2
Inferred Triple Set p
A1
A2
An
Application Tables with RDF object
type columns
…
RDF/OWL data
and ontologies
Vocabularies and Rulebases
Rules Indexes
(Derived data)R
R
R
Oracle DB Semantic Network (inside MDSYS)
her
man
sco
ttsc
ott
![Page 34: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/34.jpg)
Major Steps for building semantic app.
![Page 35: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/35.jpg)
Major Steps for building semantic app.
• Create Semantic Network in Oracle
![Page 36: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/36.jpg)
Major Steps for building semantic app.
• Create Semantic Network in Oracle• Create an RDF/OWL model associating with a table column of
type SDO_RDF_TRIPLE_S
![Page 37: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/37.jpg)
Major Steps for building semantic app.
• Create Semantic Network in Oracle• Create an RDF/OWL model associating with a table column of
type SDO_RDF_TRIPLE_S
• Store new RDF/OWL data into Oracle via bulk-load, batch-load, or SQL INSERT; Also, perform any DML
![Page 38: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/38.jpg)
Major Steps for building semantic app.
• Create Semantic Network in Oracle• Create an RDF/OWL model associating with a table column of
type SDO_RDF_TRIPLE_S
• Store new RDF/OWL data into Oracle via bulk-load, batch-load, or SQL INSERT; Also, perform any DML
• Optionally, create user-defined rulebases
![Page 39: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/39.jpg)
Major Steps for building semantic app.
• Create Semantic Network in Oracle• Create an RDF/OWL model associating with a table column of
type SDO_RDF_TRIPLE_S
• Store new RDF/OWL data into Oracle via bulk-load, batch-load, or SQL INSERT; Also, perform any DML
• Optionally, create user-defined rulebases• Infer new RDF/OWL data using Oracle’s native inference engine
(OWLPRIME, OWLSIF, RDFS++, RDFS & User-defined Rules)
![Page 40: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/40.jpg)
Major Steps for building semantic app.
• Create Semantic Network in Oracle• Create an RDF/OWL model associating with a table column of
type SDO_RDF_TRIPLE_S
• Store new RDF/OWL data into Oracle via bulk-load, batch-load, or SQL INSERT; Also, perform any DML
• Optionally, create user-defined rulebases• Infer new RDF/OWL data using Oracle’s native inference engine
(OWLPRIME, OWLSIF, RDFS++, RDFS & User-defined Rules)
• Query RDF/OWL data and ontologies via SQL using SEM_MATCH table function; optionally combine with SQL operations such as join, order by, group by, filter conditions, etc.
![Page 41: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/41.jpg)
Major Steps for building semantic app.
• Create Semantic Network in Oracle• Create an RDF/OWL model associating with a table column of
type SDO_RDF_TRIPLE_S
• Store new RDF/OWL data into Oracle via bulk-load, batch-load, or SQL INSERT; Also, perform any DML
• Optionally, create user-defined rulebases• Infer new RDF/OWL data using Oracle’s native inference engine
(OWLPRIME, OWLSIF, RDFS++, RDFS & User-defined Rules)
• Query RDF/OWL data and ontologies via SQL using SEM_MATCH table function; optionally combine with SQL operations such as join, order by, group by, filter conditions, etc.
• Perform Ontology-assisted Query against enterprise (relational) data using SEM_RELATED and SEM_DISTANCE operators
![Page 42: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/42.jpg)
Creating Semantic Network and Semantic Models
![Page 43: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/43.jpg)
Creating Semantic Network and Semantic Models
Creating a semantic network1. SEM_APIS.CREATE_SEM_NETWORK (<tablespace>);
![Page 44: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/44.jpg)
Creating Semantic Network and Semantic Models
Creating a semantic network1. SEM_APIS.CREATE_SEM_NETWORK (<tablespace>);
![Page 45: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/45.jpg)
Creating Semantic Network and Semantic Models
Creating a semantic network1. SEM_APIS.CREATE_SEM_NETWORK (<tablespace>);
Creating a semantic model2. Create an application table with an SDO_RDF_TRIPLE_S type col
CREATE TABLE ATAB (ID int, TRI SDO_RDF_TRIPLE_S) compress;
3. Create a model associated with the SDO_RDF_TRIPLE_S column
SEM_APIS.CREATE_SEM_MODEL (‘MODEL1’, -- <model_name> ‘ATAB’, -- <app_table_name> ‘TRI’ -- <RDF type col name>
);
![Page 46: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/46.jpg)
Access Control
![Page 47: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/47.jpg)
Access Control
• Models• A database view owned by MDSYS gets created at model creation• The creator gets SELECT privilege with GRANT option• DML on a model is done via DML on the associated RDF object type
column and requires invoker to have appropriate privileges on the associated application table
![Page 48: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/48.jpg)
Access Control
• Models• A database view owned by MDSYS gets created at model creation• The creator gets SELECT privilege with GRANT option• DML on a model is done via DML on the associated RDF object type
column and requires invoker to have appropriate privileges on the associated application table
• Rulebases• A database view owned by MDSYS gets created at rulebase creation• The creator gets SELECT and DML privilege with GRANT option
![Page 49: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/49.jpg)
Access Control
• Models• A database view owned by MDSYS gets created at model creation• The creator gets SELECT privilege with GRANT option• DML on a model is done via DML on the associated RDF object type
column and requires invoker to have appropriate privileges on the associated application table
• Rulebases• A database view owned by MDSYS gets created at rulebase creation• The creator gets SELECT and DML privilege with GRANT option
• Rules Indexes (Inferred Triple Sets)• A database view owned by MDSYS gets created at rules index creation• Creator must have SELECT privilege on underlying model and rulebase
views• The creator gets SELECT privilege with GRANT option
![Page 50: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/50.jpg)
Storage: Highlights
![Page 51: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/51.jpg)
Storage: Highlights
• Stores <subject, predicate, object> triples• Removes duplicates to ensure RDF/OWL graph is a set• Uses RDF-specific compression for tables and indexes
![Page 52: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/52.jpg)
Storage: Highlights
• Stores <subject, predicate, object> triples• Removes duplicates to ensure RDF/OWL graph is a set• Uses RDF-specific compression for tables and indexes
• No limits on amount of data that can be stored• Current users: Swissprot: 800million triples, UTH: 600million+
![Page 53: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/53.jpg)
Storage: Highlights
• Stores <subject, predicate, object> triples• Removes duplicates to ensure RDF/OWL graph is a set• Uses RDF-specific compression for tables and indexes
• No limits on amount of data that can be stored• Current users: Swissprot: 800million triples, UTH: 600million+
• Can handle multiple lexical forms of the same value• Ex: “00123”^^xsd:decimal and “123”^^xsd:decimal• Ex: “2004-12-21T22:00:00-08:00”^^xsd:dateTime and
“2004-12-22T01:00:00-05:00”^^xsd:dateTime
![Page 54: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/54.jpg)
Storage: Highlights
• Stores <subject, predicate, object> triples• Removes duplicates to ensure RDF/OWL graph is a set• Uses RDF-specific compression for tables and indexes
• No limits on amount of data that can be stored• Current users: Swissprot: 800million triples, UTH: 600million+
• Can handle multiple lexical forms of the same value• Ex: “00123”^^xsd:decimal and “123”^^xsd:decimal• Ex: “2004-12-21T22:00:00-08:00”^^xsd:dateTime and
“2004-12-22T01:00:00-05:00”^^xsd:dateTime
• Maintains fidelity (user-specified lexical form)
![Page 55: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/55.jpg)
Storage: Highlights
• Stores <subject, predicate, object> triples• Removes duplicates to ensure RDF/OWL graph is a set• Uses RDF-specific compression for tables and indexes
• No limits on amount of data that can be stored• Current users: Swissprot: 800million triples, UTH: 600million+
• Can handle multiple lexical forms of the same value• Ex: “00123”^^xsd:decimal and “123”^^xsd:decimal• Ex: “2004-12-21T22:00:00-08:00”^^xsd:dateTime and
“2004-12-22T01:00:00-05:00”^^xsd:dateTime
• Maintains fidelity (user-specified lexical form)• Provides access control for models, rulebases, and rules indexes
![Page 56: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/56.jpg)
Storage: Highlights
• Stores <subject, predicate, object> triples• Removes duplicates to ensure RDF/OWL graph is a set• Uses RDF-specific compression for tables and indexes
• No limits on amount of data that can be stored• Current users: Swissprot: 800million triples, UTH: 600million+
• Can handle multiple lexical forms of the same value• Ex: “00123”^^xsd:decimal and “123”^^xsd:decimal• Ex: “2004-12-21T22:00:00-08:00”^^xsd:dateTime and
“2004-12-22T01:00:00-05:00”^^xsd:dateTime
• Maintains fidelity (user-specified lexical form)• Provides access control for models, rulebases, and rules indexes
• Supports long literal values
![Page 57: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/57.jpg)
Loading RDF/OWL data
![Page 58: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/58.jpg)
Loading RDF/OWL data
Load data using
![Page 59: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/59.jpg)
Loading RDF/OWL data
Load data using
• Bulk-load (very fast)• Load data into a staging table (using SQL*Loader from a file
or Named Pipe containing N-Triple formatted data)• Invoke PL/SQL API to invoke bulk load from the staging table
![Page 60: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/60.jpg)
Loading RDF/OWL data
Load data using
• Bulk-load (very fast)• Load data into a staging table (using SQL*Loader from a file
or Named Pipe containing N-Triple formatted data)• Invoke PL/SQL API to invoke bulk load from the staging table
• Batch-load (fast, can handle long literals as well)• Invoke Java-based API to load from file containing N-Triple
formatted data
![Page 61: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/61.jpg)
Loading RDF/OWL data
Load data using
• Bulk-load (very fast)• Load data into a staging table (using SQL*Loader from a file
or Named Pipe containing N-Triple formatted data)• Invoke PL/SQL API to invoke bulk load from the staging table
• Batch-load (fast, can handle long literals as well)• Invoke Java-based API to load from file containing N-Triple
formatted data
• SQL INSERT (for loading small amounts of data)
![Page 62: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/62.jpg)
Loading APIs: Bulk-Load
![Page 63: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/63.jpg)
Loading APIs: Bulk-Load
• Use SQL*Loader to load staging table• Control file template is available in 11g companion CD
• Only the Staging Table name may need to be changed• Staging Table definition is shown in documentation
• Use COMPRESS option, if available• Input file must be N-Triple formatted
• Named Pipe may be used to save disk space
![Page 64: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/64.jpg)
Loading APIs: Bulk-Load
• Use SQL*Loader to load staging table• Control file template is available in 11g companion CD
• Only the Staging Table name may need to be changed• Staging Table definition is shown in documentation
• Use COMPRESS option, if available• Input file must be N-Triple formatted
• Named Pipe may be used to save disk space
• SEM_APIS.BULK_LOAD_FROM_STAGING_TABLE• Model_owner• Table_owner• Table_name• Flags (default NULL): ‘ VALUES_TABLE_INDEX_REBUILD ‘
![Page 65: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/65.jpg)
Loading APIs: Batch-Load
• Batch-load uses the oracle.spatial.rdf.client.BatchLoader class packaged in <ORACLE_HOME>/md/jlib/sdordf.jar
• Example (on Linux)• java
-Ddb.user=scott -Ddb.password=password -Ddb.host=127.0.0.1 -Ddb.port=1522 -Ddb.sid=orcl -classpath ${ORACLE_HOME}/md/jlib/sdordf.jar:${ORACLE_HOME}/jdbc/lib/ojdbc5.jar oracle.spatial.rdf.client.BatchLoader <N-TripleFile> <tablename> <tablespaceName> <modelName>
![Page 66: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/66.jpg)
• SPARQL-like graph pattern embedded in SQL query• Matches RDF/OWL graph patterns with patterns in stored data
• Returns a table of results
• Can use SQL operators/functions to process results• Avoids staging when combined with queries on relational data
SELECT t.x …
FROM …, TABLE (SEM_MATCH invocation
) t, …
WHERE …
Query RDF Data
![Page 67: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/67.jpg)
• SPARQL-like graph pattern embedded in SQL query• Matches RDF/OWL graph patterns with patterns in stored data
• Returns a table of results
• Can use SQL operators/functions to process results• Avoids staging when combined with queries on relational data
SELECT t.x …
FROM …, TABLE (SEM_MATCH invocation
) t, …
WHERE …
Query RDF Data
SEM_MATCH ( '(?x :partOf :NorthAmerica)', -- pattern: all parts of N.A. SEM_Models(‘gmap'), -- RDF/OWL data models
SEM_Rulebases(‘OWLPRIME'), -- rulebases SEM_Aliases(…) -- aliases null -- no filter condition)
![Page 68: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/68.jpg)
• SPARQL-like graph pattern embedded in SQL query• Matches RDF/OWL graph patterns with patterns in stored data
• Returns a table of results
• Can use SQL operators/functions to process results• Avoids staging when combined with queries on relational data
SELECT t.x …
FROM …, TABLE (SEM_MATCH invocation
) t, …
WHERE …
Query RDF Data
![Page 69: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/69.jpg)
Table Columns returned by SEM_MATCH
Each returned row contains one (or more) of the following cols for eachvariable ?x in the graph-pattern:
Column Name Type Description
x varchar2 Value matched with ?x
x$rdfVTYP varchar2 Value TYPe: URI, Literal, or Blank Node
x$rdfLTYP varchar2 Literal TYPe: e.g., xsd:integer
x$rdfCLOB CLOB CLOB value matched with ?x
x$rdfLANG varchar2 LANGuage tag: e.g., “en-us”
Projection Optimization: Only the columns referred to by the containing query are returned.
![Page 70: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/70.jpg)
RDF Query in SQL
:OracleHQemployee :SWcompanyEmployeerdfs:subClassOf
:John :California
:corpOfficeLocrdf:type
:USA :NorthAmerica:partOf :partOf
SELECT e, p FROM TABLE(SEM_MATCH( ‘(?e rdf:type ?empCategory) (?empCategory :corpOfficeLoc ?loc) (?loc :partOf ?p)’, SEM_Models(‘emp’, ‘gmap’), SEM_Rulebases(‘OWLPRIME’), SEM_ALIASES(SEM_ALIAS('', 'http://www.example.org/')),NULL));
:partOf
E P
:John :USA
:John :NorthAmerica
![Page 71: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/71.jpg)
Ontology-Assisted Query: Overview
• Motivation• Traditionally relationship between two terms is checked only
in a syntactic manner• Need a new operator which can do semantic relationship
check by consulting an ontology
• Introduces two operators• SEM_RELATED (<col>,<pred>, <ontologyTerm>,
<ontologyName> [,<invoc_id>])• SEM_DISTANCE (<invoc_id>) Ancillary Oper.
![Page 72: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/72.jpg)
Example: Query using Semantic Operators
Finger_Fracture
Arm_Fracture
Upper_Extremity_Fracture
Hand_FractureElbow_FractureForearm_Fracture
rdfs:subClassOf
rdfs:subClassOf
rdfs:subClassOf
rdfs:subClassOf
ID DIAGNOSIS
1 Hand_Fracture
2 Rheumatoid_Arthritis
Patients
“Find all entries in diagnosis column that are related to ‘Upper_Extremity_Fracture’”
Syntactic query will not work:SELECT p_id, diagnosis FROMPatients WHERE diagnosis = ‘Upper_Extremity_Fracture;
![Page 73: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/73.jpg)
Example: Query using Semantic Operators
Finger_Fracture
Arm_Fracture
Upper_Extremity_Fracture
Hand_FractureElbow_FractureForearm_Fracture
rdfs:subClassOf
rdfs:subClassOf
rdfs:subClassOf
rdfs:subClassOf
ID DIAGNOSIS
1 Hand_Fracture
2 Rheumatoid_Arthritis
Patients
“Find all entries in diagnosis column that are related to ‘Upper_Extremity_Fracture’”
Syntactic query will not work:SELECT p_id, diagnosis FROMPatients WHERE diagnosis = ‘Upper_Extremity_Fracture;
SELECT p_id, diagnosis FROM PatientsWHERE SEM_RELATED (diagnosis, ‘rdfs:subClassOf’,‘Upper_Extremity_Fracture’, sem_models(‘NCI’), sem_rulebases(‘OWLPRIME’), …) = 1;
![Page 74: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/74.jpg)
Example: Query using Semantic Operators
Finger_Fracture
Arm_Fracture
Upper_Extremity_Fracture
Hand_FractureElbow_FractureForearm_Fracture
rdfs:subClassOf
rdfs:subClassOf
rdfs:subClassOf
rdfs:subClassOf
ID DIAGNOSIS
1 Hand_Fracture
2 Rheumatoid_Arthritis
Patients
“Find all entries in diagnosis column that are related to ‘Upper_Extremity_Fracture’”
Syntactic query will not work:SELECT p_id, diagnosis FROMPatients WHERE diagnosis = ‘Upper_Extremity_Fracture;
![Page 75: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/75.jpg)
Example: Query using Semantic Operators
Finger_Fracture
Arm_Fracture
Upper_Extremity_Fracture
Hand_FractureElbow_FractureForearm_Fracture
rdfs:subClassOf
rdfs:subClassOf
rdfs:subClassOf
rdfs:subClassOf
ID DIAGNOSIS
1 Hand_Fracture
2 Rheumatoid_Arthritis
Patients
“Find all entries in diagnosis column that are related to ‘Upper_Extremity_Fracture’”
Syntactic query will not work:SELECT p_id, diagnosis FROMPatients WHERE diagnosis = ‘Upper_Extremity_Fracture;
SELECT p_id, diagnosis FROM PatientsWHERE SEM_RELATED (diagnosis, ‘rdfs:subClassOf’,‘Upper_Extremity_Fracture’, sem_models(‘NCI’), sem_rulebases(‘OWLPRIME’),… , 777) = 1 AND SEM_DISTANCE(777) <= 2;
![Page 76: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/76.jpg)
Example: Query using Semantic Operators
Finger_Fracture
Arm_Fracture
Upper_Extremity_Fracture
Hand_FractureElbow_FractureForearm_Fracture
rdfs:subClassOf
rdfs:subClassOf
rdfs:subClassOf
rdfs:subClassOf
ID DIAGNOSIS
1 Hand_Fracture
2 Rheumatoid_Arthritis
Patients
“Find all entries in diagnosis column that are related to ‘Upper_Extremity_Fracture’”
Syntactic query will not work:SELECT p_id, diagnosis FROMPatients WHERE diagnosis = ‘Upper_Extremity_Fracture;
![Page 77: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/77.jpg)
Inference: Overview
• Native inferencing for• RDF, RDFS• OWL subsets• User-defined rules
• Rules are stored in rulebases
• RDF/OWL graph is entailed (new triples are inferred) by applying rules in rulebase(s) to model(s)
• Inferencing is based on forward chaining: new triples are inferred and stored ahead of query time
![Page 78: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/78.jpg)
Inferencing
• RDFS Example• rdfs:subClassOf is transitive• rdfs:subPropertyOf is transitive• X rdf:type C, C rdfs:subClassOf SC => X rdf:type SC
• OWL Example• :partOf rdf:type owl:TransitiveProperty• :friendOf rdf:type owl:SymmetricProperty
• User-defined Rule Example:• X :hasParent Y, Y :hasBrother Z => X :hasUncle Z
![Page 79: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/79.jpg)
OWL Subsets Supported
• RDFS++• RDFS plus owl:sameAs and owl:InverseFunctionalProperty
• OWLSIF (OWL with IF semantics)• Based on Dr. Horst’s pD* vocabulary¹
• OWLPrime• rdfs:subClassOf, subPropertyOf, domain, range
• owl:TransitiveProperty, SymmetricProperty, FunctionalProperty, InverseFunctionalProperty, inverseOf
• owl:sameAs, differentFrom
• owl:disjointWith, complementOf,
• owl:hasValue, allValuesFrom, someValuesFrom• owl:equivalentClass, equivalentProperty
• Jointly determined with domain experts, customers and partners
1 Completeness, decidability and complexity of entailment for RDF Schema and a semantic extension involving the OWL vocabulary
OWL DLOWL Lite
OWLPrime
40
![Page 80: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/80.jpg)
11g OWL Inference PL/SQL API
• SEM_APIS.CREATE_ENTAILMENT(• Index_name• sem_models(‘GraphTBox’, ‘GraphABox’, …), • sem_rulebases(‘OWLPrime’),• passes,• Inf_components,• Options)• Use “PROOF=T” to generate inference proof
• SEM_APIS.VALIDATE_ENTAILMENT(• sem_models((‘GraphTBox’, ‘GraphABox’, …), • sem_rulebases(‘OWLPrime’),• Criteria,• Max_conflicts,• Options)
• Above APIs can be invoked from Java clients through JDBC
Typical Usage:
• First load RDF/OWL data
• Call create_entailment to generate inferred graph
• Query both original graph and inferred data
Inferred graph contains only new triples! Saves time & resources
Typical Usage:
• First load RDF/OWL data
• Call create_entailment to generate inferred graph
• Call validate_entailment to find inconsistencies
41
![Page 81: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/81.jpg)
Performance Evaluationusing Desktop
42
![Page 82: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/82.jpg)
Database Setup
• Linux based commodity PC (1 CPU, 3GHz, 2GB RAM) ¹• Database installed on machine “semperf3”
semperf3 semperf1
semperf2
Giga-bit Network
Database 11g
• Two other PCs are just serving storage over network
43
1 http://ontolog.cim3.net/file/work/DatabaseAndOntology/2007-10-18_AlanWu/RDBMS-RDFS-OWL-InferenceEngine--AlanWu_20071018.pdf
![Page 83: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/83.jpg)
Oracle 11g Bulk-Loader Performance
![Page 84: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/84.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)
![Page 85: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/85.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
![Page 86: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/86.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec
![Page 87: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/87.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
![Page 88: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/88.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)
![Page 89: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/89.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
![Page 90: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/90.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min
![Page 91: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/91.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min• bulk_load API: 2 hour 34 min
![Page 92: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/92.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min• bulk_load API: 2 hour 34 min
LUBM-1000 (138 million triples)
![Page 93: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/93.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min• bulk_load API: 2 hour 34 min
LUBM-1000 (138 million triples)• TIME 6 hour 23 min (21 mil / hr)
![Page 94: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/94.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min• bulk_load API: 2 hour 34 min
LUBM-1000 (138 million triples)• TIME 6 hour 23 min (21 mil / hr)
• SQL loader: 1 hour 34 min
![Page 95: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/95.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min• bulk_load API: 2 hour 34 min
LUBM-1000 (138 million triples)• TIME 6 hour 23 min (21 mil / hr)
• SQL loader: 1 hour 34 min• bulk_load API: 4 hour 49 min
![Page 96: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/96.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min• bulk_load API: 2 hour 34 min
LUBM-1000 (138 million triples)• TIME 6 hour 23 min (21 mil / hr)
• SQL loader: 1 hour 34 min• bulk_load API: 4 hour 49 min
• DISK SPACE 19 GB (7.3 mil / GB)
![Page 97: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/97.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min• bulk_load API: 2 hour 34 min
LUBM-1000 (138 million triples)• TIME 6 hour 23 min (21 mil / hr)
• SQL loader: 1 hour 34 min• bulk_load API: 4 hour 49 min
• DISK SPACE 19 GB (7.3 mil / GB)
• Triples and Values: 5 GB
![Page 98: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/98.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min• bulk_load API: 2 hour 34 min
LUBM-1000 (138 million triples)• TIME 6 hour 23 min (21 mil / hr)
• SQL loader: 1 hour 34 min• bulk_load API: 4 hour 49 min
• DISK SPACE 19 GB (7.3 mil / GB)
• Triples and Values: 5 GB• Indexes: 11 GB
![Page 99: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/99.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min• bulk_load API: 2 hour 34 min
LUBM-1000 (138 million triples)• TIME 6 hour 23 min (21 mil / hr)
• SQL loader: 1 hour 34 min• bulk_load API: 4 hour 49 min
• DISK SPACE 19 GB (7.3 mil / GB)
• Triples and Values: 5 GB• Indexes: 11 GB• App Table (compressed): 3 GB
![Page 100: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/100.jpg)
Oracle 11g Bulk-Loader PerformanceLUBM-50 (6.9 million triples)• TIME 0 hour 13.5 min (31 mil / hr)
• SQL loader: 4 min 56 sec • bulk_load API: 8 min 33 sec
LUBM-500 (69 million triples)• TIME 3 hour 20 min (21 mil / hr)
• SQL loader: 0 hour 46 min• bulk_load API: 2 hour 34 min
LUBM-1000 (138 million triples)• TIME 6 hour 23 min (21 mil / hr)
• SQL loader: 1 hour 34 min• bulk_load API: 4 hour 49 min
• DISK SPACE 19 GB (7.3 mil / GB)
• Triples and Values: 5 GB• Indexes: 11 GB• App Table (compressed): 3 GB
![Page 101: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/101.jpg)
Query Performance
Ontology LUBM50
6.8 million & 3+ million inferred
LUBM Benchmark Queries
Q1 Q2 Q3 Q4 Q5 Q6 Q7
OWLPrime
# answers 4 130 6 34 719 393730 59
Time
(sec)0.09 0.80 0.28 6.1 0.4 36.82 1.05
OWLPrime +
Pellet on TBox
# answers 4 130 6 34 719 519842 67
Time
(sec)0.09 0.79 0.28 9.5 0.4 43.65 1.13
![Page 102: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/102.jpg)
Query Performance (2)
Ontology LUBM50
6.8 million & 3+ million inferred
LUBM Benchmark Queries
Q8 Q9 Q10 Q11 Q12 Q13 Q14
OWLPrime
# answers 5916 6538 0 224 0 228 393730
Time
(sec)2.76 2.08 0.18 0.02 0.01 0.39 31.5
OWLPrime +
Pellet on TBox
# answers 7790 13639 4 224 15 228 393730
Time
(sec)3.9 3.47 0.37 0.02 0.03 0.39 39.4
![Page 103: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/103.jpg)
Inference PerformanceOntology (size)(after duplicate elimination)
RDFS OWLPrime
#Triples inferred
(millions)
Time(speed)
#Triples inferred
(millions)
Time(speed)
LUBM-506.6 million
2.75 12.25 min(13.5 mil / hr)
3.05 8 min(22.9 mil /
hr)
LUBM-1000133.6 million
55.09 7 hr 19 min(7.5 mil / hr)
61.25 7 hr(8.75 mil /
hr)
UniProt20 million
3.4 24.1 min(8.5 mil / hr)
50.8 3 hr 1 min(16.8 mil /
hr)
Results collected on a single CPU PC (3GHz), 2GB RAM (1.4G dedicate to DB), Multiple Disks over NFS
48
![Page 104: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/104.jpg)
Oracle 11g RDF/OWL
• New features• Bulk loader• Native OWL inference support (with optional proof generation)• Semantic operators
• Performance improvement• Much faster compared to 10gR2
• Loading• Query (table function re-write, query hints)• Inference
• Shipped in 2007
• Java API support• Oracle Jena adaptor (released on OTN)• Sesame (forthcoming)
49
![Page 105: - Oracledownload.oracle.com/otndocs/tech/semantic_web/pdf/oow2007... Why, When, and How to Use Oracle Database 11g Semantic Technologies](https://reader030.fdocuments.us/reader030/viewer/2022021504/5aa424ed7f8b9ac8748b864e/html5/thumbnails/105.jpg)
For More Information
search.oracle.com
or
oracle.com
semantic technologies