Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Semantic Technology In Oracle Database 12c

194 visualizaciones

Publicado el

Presentation from the BG OUG Autumn conference, November 2017 at Pravetz, Bulgaria.

Demos:

SPARQL/SPARUL
=============

Using Virtuoso/Blazegraph as a triple store

// insert triple
INSERT {
GRAPH <data.bgoug.online/graph> {
<http://data.bgoug.online/people/MartinToshev>
<http://data.bgoug.online/attends>
<http://data.bgoug.online/events/100>
}
}

// query triple
SELECT ?s ?p ?o FROM <data.bgoug.online/graph> WHERE { ?s ?p ?o }

// insert another record
INSERT {
GRAPH <data.bgoug.online/graph> {
<http://data.bgoug.online/people/IvanIvanov>
<http://data.bgoug.online/attends>
<http://data.bgoug.online/events/100>
}
}

// try to insert triple multiple times

// delete triples for Ivan Ivanov
DELETE {GRAPH <data.bgoug.online/graph> {<http://data.bgoug.online/people/IvanIvanov> ?p ?o} }
WHERE { <http://data.bgoug.online/people/IvanIvanov> ?p ?o }

// show in blazegraph (use INSERT DATA) for INSERT

Oracle Semantic technology
==========================

// create tablespace (under sys)
CREATE TABLESPACE rdf_tblspace
DATAFILE 'D:\software\Oracle12c\oradata\SampeDB\rdf_tblspace.dat' SIZE 1024M REUSE
AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED
SEGMENT SPACE MANAGEMENT AUTO;

EXECUTE SEM_APIS.CREATE_SEM_NETWORK('rdf_tblspace');

// create semantic tables and do SQL queries
CREATE TABLE conference_rdf_table (id NUMBER, triple SDO_RDF_TRIPLE_S);
EXECUTE SEM_APIS.CREATE_SEM_MODEL('conference', 'conference_rdf_table', 'triple');

INSERT INTO conference_rdf_table VALUES (1,
SDO_RDF_TRIPLE_S ('conference','<http://data.bgoug.online/people/MartinToshev>',
'<http://data.bgoug.online/attends>','<http://data.bgoug.online/events/100>'));

SELECT SEM_APIS.GET_MODEL_ID('conference') AS conference FROM DUAL;
SELECT SEM_APIS.IS_TRIPLE(
'conference','<http://data.bgoug.online/people/MartinToshev>',
'<http://data.bgoug.online/attends>','<http://data.bgoug.online/events/100>') as is_triple from DUAL;

SELECT c.triple.GET_SUBJECT() AS subject,
c.triple.GET_PROPERTY() AS property,
c.triple.GET_OBJECT() AS object
FROM conference_rdf_table c;

SELECT x attendee, y event
FROM TABLE(SEM_MATCH(
'{?x <http://data.bgoug.online/attends> ?y}',
SEM_Models('conference'),
null,
SEM_ALIASES(SEM_ALIAS('','<http://data.bgoug.online/conference>')),
null));

Publicado en: Tecnología
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

Semantic Technology In Oracle Database 12c

  1. 1. Semantic Technology in Oracle Database 12c Martin Toshev
  2. 2. Who am I Software consultant (CoffeeCupConsulting) BG JUG board member (http://jug.bg) OpenJDK and Oracle RBDMS enthusiast Twitter: @martin_fmi Martin Toshev Prague, 19-20 October 2017
  3. 3. Agenda Semantic web at a glance Semantic technology in Oracle RDBMS 12c Oracle RDBMS12c vs triple stores Martin Toshev Prague, 19-20 October 2017
  4. 4. Semantic web at a glance
  5. 5. Semantic Web •A set of standards providing an extension of the world wide web •Promote the idea of a global “web of linked data” •Defined using RDF as a base format •One of the building blocks of Web 3.0 Martin Toshev Prague, 19-20 October 2017 <http://data.bgoug.online/people /MartinToshev> <http://data.bgoug.online /events/100> foaf:Person <http://data.bgoug.online/attends> rdf:type
  6. 6. RDF • RDF represents information in a subject-predicate-object form • Resources are identified with URIs • RDFS provides a mechanism for definition of RDF vocabularies Martin Toshev Prague, 19-20 October 2017 <http://data.bgoug.online/people/MartinToshev> <http://data.bgoug.online/attends> <http://data.bgoug.online/events/100> http://data.bgoug.online/bg/events/10 <http://data.bgoug.online/attendee> <rdfs:label> “Conference attendee”
  7. 7. SPARQL • SPARQL is the standard RDF query language • The DML extension of SPARQL is called SPARUL Martin Toshev Prague, 19-20 October 2017 SELECT ?s ?p ?o FROM <data.bgoug.online/graph> WHERE { ?s ?p ?o } INSERT { GRAPH <data.bgoug.online/graph> { <http://data.bgoug.online/people/MartinToshev> <http://data.bgoug.online/attends> <http://data.bgoug.online/events/100> } }
  8. 8. OWL & SKOS • SKOS provides a way to create knowledge organization systems using RDF • These include taxonomies, thesauri, classification schemes etc. • OWL provides an RDF representation of ontologies • Defines semantic of the RDF schema • Far more complex than SKOS for knowledge organization Martin Toshev Prague, 19-20 October 2017
  9. 9. Semantic Data • Semantic data might be encoded within an existing web page • One option is to use RDFa which is an attribute-level HTML extension Martin Toshev Prague, 19-20 October 2017 <div xmlns:dc="http://purl.org/dc/elements/1.1/" about=" http://data.bgoug.online/events/100"> <span property="dc:title">BGOUG Autumn Conference 2017</span> <span property="dc:creator">BGOUG</span> <span property="dc:date">2017-11-19</span> </div>
  10. 10. Semantic Data • Semantic data might be exposed via web-accessible databases • These are also called triple/quad stores • Provide native storage for RDF data • Widely used implementations are Virtuoso, GraphDB and Blazegraph Martin Toshev Prague, 19-20 October 2017
  11. 11. DEMO querying SPARQL endpoints
  12. 12. Semantic technology in Oracle RDBMS 12
  13. 13. Why Oracle Semantic Technology ? • Existing Oracle database provide a great source of data • Some of that data can might be exposed as Linked Open Data • Semantics may be applied on top of relational data • Semantic data might be stored in a relational format Martin Toshev Prague, 19-20 October 2017
  14. 14. Use case: social networking • Cisco WebEx social platform uses Oracle semantic technology • Social graph is represented by a unified RDF model • Enables semantic tagging, social graph navigation and search • Provides connectivity with other sources of semantic data Martin Toshev Prague, 19-20 October 2017
  15. 15. General features • Native RDF/RDFS/OWL/SKOS support • Bulk load of RDF data • Triples are stored in database tables in the MDSYS schema • Information about models stored in the MDSYS.SEM_MODEL$ view • Improved performance and scalability Martin Toshev Prague, 19-20 October 2017
  16. 16. General features •SPARQL-like queries via SQL (along with a Java API) •SPARQL support via Jena and SESAME providers •Semantic rules (inference) and entailments •Virtual semantic models Martin Toshev Prague, 19-20 October 2017
  17. 17. SQL-based semantic queries • Provided by a DSL that mimics the SPARQL capabilities • Implemented by the SEM_MATCH table function • Ontology-based querying of relational data via the SEM_RELATED operator • Provides SPARQL constructs such as FILTER and OPTIONAL • New SPARQL-like features added per RDBMS release Martin Toshev Prague, 19-20 October 2017
  18. 18. Enabling semantic features 1) EXECUTE mdsys.enableGeoRaster; 2) SQL*Plus: @%ORACLE_HOME%mdadmincatsem.sql 3) (change password of MDSYS): alter user mdsys identified by mdsys account unlock; alter user mdsys identified by pass123; Martin Toshev Prague, 19-20 October 2017
  19. 19. DEMO Oracle semantic technology
  20. 20. Oracle RDBMS 12c vs triple stores
  21. 21. Oracle RDBMS 12c • Mixing relational and RDF data provides advanced query capabilities • A lot of PL/SQL subprograms provided by the SEM_APIS package Martin Toshev Prague, 19-20 October 2017
  22. 22. Triple store • Dedicated format for storing of RDF data • Provides more specialized optimization capabilities for SPARQL queries • Provide dedicated management tools and interfaces for RDF data Martin Toshev Prague, 19-20 October 2017
  23. 23. Summary • Oracle Database 12c already provides a solid set of semantic features • Existing relational data can be amended with semantic information • Oracle database can be used as a triple store Martin Toshev Prague, 19-20 October 2017
  24. 24. References Resource Description Framework https://en.wikipedia.org/wiki/Resource_Description_Framework Semantic Web (Wikipedia) https://en.wikipedia.org/wiki/Semantic_Web Linked Data book http://linkeddatabook.com/editions/1.0/ Martin Toshev Prague, 19-20 October 2017
  25. 25. References Oracle Database 11g Semantic Technologies Overview http://download.oracle.com/otndocs/tech/semantic_web/pdf/oow10_semtech_ Spatial and Graph RDF Semantic Graph Developer’s Guide https://docs.oracle.com/database/121/RDFRM/rdf-overview.htm#RDFRM100 Oracle Database Semantic Technologies http://www.oracle.com/technetwork/database/options/semantic- tech/semtech11gr2-featover-131765.pdf Martin Toshev Prague, 19-20 October 2017
  26. 26. References How and Why Customers Use Oracle's Semantic Database Technologies: A Panel http://download.oracle.com/otndocs/tech/semantic_web/pdf/oow10_sem tech_intro_lopez.pdf Oracle Spatial 11g use in Cisco Social Semantic Software http://download.oracle.com/otndocs/tech/semantic_web/pdf/oow10_sem tech_cisco.pdf RDF Semantic Graph - Training http://www.oracle.com/technetwork/database/options/spatialandgraph/le arnmore/semtech-training-100336.html#training Martin Toshev Prague, 19-20 October 2017
  27. 27. References Cisco WebEx Social Oracle Spatial and Graph: Graph for Enterprise Collaboration http://download.oracle.com/otndocs/tech/semantic_web/pdf/case_studie s/Oracle_CaseStudy_Cisco_WebEx_Social_RDF_Graph_Enterprise_Collabor ation.pdf Martin Toshev Prague, 19-20 October 2017

×