What's New with Oracle Spatial and Graph
Total Page:16
File Type:pdf, Size:1020Kb
What’s New with Oracle Spatial and Graph Matthew Perry, Ph.D. Consultant Member of Technical Staff Oracle Spatial and Graph September 2018 Copyright © 20182016,, 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, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 3 Agenda 1 Introduction to Oracle Spatial and Graph 2 Core Database Features 3 Mid-tier Components and Tools 4 Summary and Thoughts on Standardization Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 4 Agenda 1 Introduction to Oracle Spatial and Graph 2 Core Database Features 3 Mid-tier Components and Tools 4 Summary and Thoughts on Standardization Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 5 A Little About our Team • First release of RDF Knowledge Graph was Oracle 10g R2 (2005) • Active in standards development – team members have been … • Member of W3C SPARQL 1.1 WG • Member of W3C RDF 1.1 WG • Co-editor of W3C OWL 2 Web Ontology Language Profiles spec. • Co-editor of W3C R2RML: RDB to RDF Mapping Language spec. • Co-editor of OGC GeoSPARQL spec. • Several research papers in this area • VLDB, ICDE, EDBT, ISWC, etc. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 6 Oracle Supports Two Graph Data Models RDF Knowledge Graph . Life Sciences Linked Data • Data Federation . Health Care Semantic Web • Knowledge Representation . Publishing • Semantic Web . Finance Property Graph . Financial . Graph Analytics • Path Analytics Retail, Marketing • Social Network Analysis . Social Media • Entity Analytics . Smart Manufacturing Use Case Graph Model Industry Domain Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 7 RDF Knowledge Graph is a Feature of Oracle Database • Oracle Database is really a multi-model database – Relational, Object, Document (XML, JSON), Spatial, Text, Sharded Key-Value, … – RDF Graph – 10gR2 – Property Graph – 12cR2 • What Database version and options are needed for RDF Knowledge Graph? – On-premise • Oracle Database Enterprise Edition with Spatial & Graph and Partitioning options – Cloud • Oracle Database Cloud Service – High Performance or Extreme Performance • Oracle Database Exadata Cloud Service Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 8 Oracle Spatial and Graph 18c – RDF Knowledge Graph Features • Fast bulk-load and indexing Load / • RDF view of Relational data RDF Knowledge Graph Storage • Manages over a trillion quads Leverages Oracle capabilities: • RAC & Exadata scalability • SPARQL-Jena/Fuseki • Compression & partitioning Query • SPARQL-in-SQL query & update • Federated query • In-Memory Column Store • GeoSPARQL • SQL*Loader direct path load • Parallel DDL, DML, and query • RDFS, OWL2 RL, EL, SKOS • Ladder-based inference • RMAN Backup and Recovery Reasoning • Incremental, parallel reasoning • High Availability • User-defined rules • Oracle Label security • Plug-in architecture • Enterprise Manager Analytics • OBIEE • Oracle Advanced Analytics • PGX Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 9 Oracle Spatial and Graph 18c – RDF Knowledge Graph Architecture SQL Developer Enterprise Manager Protégé Plugin Fuseki Endpoint Cytoscape Plugin RDF Support and Other DB Tools Support for Apache Jena (Java API) SQL and PL/SQL API Forward-chaining RDF Bulk Loader SPARQL-to-SQL SPARQL Update OWL Reasoner Query Translator Processor Generic Relational Schema RDF Views of Relational Data for Storing RDF Data Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 10 Agenda 1 Introduction to Oracle Spatial and Graph 2 Core Database Features 3 Mid-tier Components and Tools 4 Summary and Thoughts on Standardization Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 11 RDF Bulk Loader Step 2 Client DB Server Parallel RDF Bulk Load N-Triple • Value Checking Oracle • Canonicalization N-Quad Protégé • Duplicate Elimination Plugin • Internal ID Generation Turtle • Index Creation RDF/XML Staging Table RDF Relational Schema Jena Adapter Trig Java API JSON-LD Step 1 External Table Others N-Triple N-Quad Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 12 Core Inference Features in Oracle Database • 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 © 2018, Oracle and/or its affiliates. All rights reserved. | 13 Native Inference Engine in Oracle: APIs Typical Usage: SEM_APIS.CREATE_ENTAILMENT( • First load RDF/OWL data • entailment_name • Call create_entailment to generate • sem_models(‘GraphTBox’, ‘GraphABox’, …), • sem_rulebases(‘OWL2RL’), inferred graph • passes, • Query both original graph and • inf_components, inferred data • Options,… Inferred graph contains only new triples! ) Saves time & resources Use “PROOF=T” to generate inference proof Typical Usage: SEM_APIS.VALIDATE_ENTAILMENT( • First load RDF/OWL data • sem_models((‘GraphTBox’, ‘GraphABox’, …), • Call create_entailment to generate • sem_rulebases(‘OWL2RL’), • Criteria, inferred graph • Max_conflicts, • Call validate_entailment to find • Options inconsistencies ) Java API: performInference, deleteInference, setInferenceOption, analyze methods in • GraphOracleSem, DatasetGraphOracleSem (Jena Adapter) Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 14 Entailment with Named Graphs NGLI Entailment GRAPH <urn:g1> { Entails • Two options <urn:John> <urn:hasSSN> 1234 . each <urn:John> rdf:type <urn:Person> . named – Named Graph Local Inference (NGLI) } graph GRAPH <urn:g2> { separately – Named Graph Global Inference (NGGI) <urn:Johnny> <urn:hasSSN> 1234 . Asserted Data <urn:Johnny> rdf:type <urn:Person> . } # TBox: <urn:hasSSN> rdf:type owl:InverseFunctionalProperty . <urn:hasSSN> rdfs:domain <urn:Person> . NGGI Entailment GRAPH <urn:g1> { Entails # ABox: <urn:John> <urn:hasSSN> 1234 . union of GRAPH <urn:g1> { } all named <urn:John> <urn:hasSSN> 1234 . GRAPH <urn:g2> { graphs } <urn:Johnny> <urn:hasSSN> 1234 . GRAPH <urn:g2> { } <urn:Johnny> <urn:hasSSN> 1234 . <urn:Johnny> rdf:type <urn:Person> . } <urn:John> rdf:type <urn:Person> . <urn:John> owl:sameAs <urn:Johnny> . Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 15 Enabling Advanced Inference Capabilities • Parallel inference option EXECUTE sem_apis.create_entailment('M_IDX',sem_models('M'), sem_rulebases('OWL2RL'), null, null, 'DOP=x'); – Where ‘x’ is the degree of parallelism (DOP) • Incremental inference option EXECUTE sem_apis.create_entailment ('M_IDX',sem_models('M'), sem_rulebases('OWL2RL'),null,null, 'INC=T'); • Enabling owl:sameAs option to limit duplicates EXECUTE Sem_apis.create _entailment('M_IDX',sem_models('M'), sem_rulebases('OWL2RL'),null,null,'OPT_SAMEAS=T'); • Control of individual inference rules used EXECUTE Sem_apis.create _entailment('M_IDX',sem_models('M'), sem_rulebases('OWL2RL'),null,'SAM-,SCOH-',null,null); – For example, disable sameAs generation for individuals and disable subClassOf hierarchy Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 16 Extending Semantics Supported by Native OWL Inference Engine • Option 1: Add user-defined rules • Oracle supports, from release 10g, user-defined rules : Antecedents Consequents ?z :parentOf ?x . ?x :siblingOf ?y ?z :parentOf ?y . ?x owl:differentFrom ?y . • Option 2: Leverage external DL reasoners • Option 3: User-defined inferencing in Oracle Database Release 12c Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 17 Extensible Architecture for External OWL DL Reasoners Oracle’s External Native Inference In-Memory OWL Jena APIs Engine for OWL 2 DL Reasoners through RL, EL & user- Jena Adapter defined rules TrOWL/REL Materialized Inference Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 18 Best Practice for Small TBox + Small ABox • Performing materialisation of the entire ontology with TrOWL – Saving full materialisation back to Oracle Spatial and Graph • No further inference needed in SPARQL querying – Because ontology is fully materialised • Suitable for ontology that can be materialised in memory • Most efficient and complete SPARQL querying results Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 19 Best Practice for Small TBox + Large ABox • Performing TBox classification only with TrOWL – Saving only concept and role hierarchy into Oracle Spatial and Graph • SPARQL querying powered by Oracle built-in inference engine – Further materialize ABox based on the TBox classification computed by TrOWL • Suitable for ontology with ABox too large to materialize in memory • Most scalable way handle large ontologies Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 20 User-Defined Inferencing in Oracle Database Release 12c • User-defined inferencing provides