SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
‫أكاديمية الحكومة اإللكترونية الفلسطينية‬
              The Palestinian eGovernment Academy
                         www.egovacademy.ps



Tutorial II: Data Integration and Open Information Systems

                      Session 11
    Oracle Semantic Technologies

                    Dr. Mustafa Jarrar
                       University of Birzeit
                       mjarrar@birzeit.edu
                         www.jarrar.info


                             PalGov © 2011                1
About

This tutorial is part of the PalGov project, funded by the TEMPUS IV program of the
Commission of the European Communities, grant agreement 511159-TEMPUS-1-
2010-1-PS-TEMPUS-JPHES. The project website: www.egovacademy.ps
Project Consortium:

             Birzeit University, Palestine
                                                           University of Trento, Italy
             (Coordinator )


             Palestine Polytechnic University, Palestine   Vrije Universiteit Brussel, Belgium


             Palestine Technical University, Palestine
                                                           Université de Savoie, France

             Ministry of Telecom and IT, Palestine
                                                           University of Namur, Belgium
             Ministry of Interior, Palestine
                                                           TrueTrust, UK
             Ministry of Local Government, Palestine


Coordinator:
Dr. Mustafa Jarrar
Birzeit University, P.O.Box 14- Birzeit, Palestine
Telfax:+972 2 2982935 mjarrar@birzeit.eduPalGov © 2011
                                                                                                 2
© Copyright Notes
Everyone is encouraged to use this material, or part of it, but should
properly cite the project (logo and website), and the author of that part.


No part of this tutorial may be reproduced or modified in any form or by
any means, without prior written permission from the project, who have
the full copyrights on the material.




                 Attribution-NonCommercial-ShareAlike
                              CC-BY-NC-SA

This license lets others remix, tweak, and build upon your work non-
commercially, as long as they credit you and license their new creations
under the identical terms.

                                 PalGov © 2011                               3
Tutorial Map

                                                                                                           Topic                                     h
              Intended Learning Objectives
                                                                              Session 1: XML Basics and Namespaces                               3
A: Knowledge and Understanding
                                                                              Session 2: XML DTD‟s                                               3
  2a1: Describe tree and graph data models.
                                                                              Session 3: XML Schemas                                             3
  2a2: Understand the notation of XML, RDF, RDFS, and OWL.
                                                                              Session 4: Lab-XML Schemas                                         3
  2a3: Demonstrate knowledge about querying techniques for data
  models as SPARQL and XPath.                                                 Session 5: RDF and RDFs                                            3

  2a4: Explain the concepts of identity management and Linked data.           Session 6: Lab-RDF and RDFs                                        3
  2a5: Demonstrate knowledge about Integration &fusion of                     Session 7: OWL (Ontology Web Language)                             3
  heterogeneous data.                                                         Session 8: Lab-OWL                                                 3
B: Intellectual Skills                                                        Session 9: Lab-RDF Stores -Challenges and Solutions                3
  2b1: Represent data using tree and graph data models (XML &                 Session 10: Lab-SPARQL                                             3
  RDF).                                                                       Session 11: Lab-Oracle Semantic Technology                         3
  2b2: Describe data semantics using RDFS and OWL.                            Session 12_1: The problem of Data Integration                      1.5
  2b3: Manage and query data represented in RDF, XML, OWL.                    Session 12_2: Architectural Solutions for the Integration Issues   1.5
  2b4: Integrate and fuse heterogeneous data.                                 Session 13_1: Data Schema Integration                              1
C: Professional and Practical Skills                                          Session 13_2: GAV and LAV Integration                              1
  2c1: Using Oracle Semantic Technology and/or Virtuoso to store              Session 13_3: Data Integration and Fusion using RDF                1
  and query RDF stores.                                                       Session 14: Lab-Data Integration and Fusion using RDF              3
D: General and Transferable Skills
  2d1: Working with team.                                                     Session 15_1: Data Web and Linked Data                             1.5
  2d2: Presenting and defending ideas.                                        Session 15_2: RDFa                                                 1.5
  2d3: Use of creativity and innovation in problem solving.
  2d4: Develop communication skills and logical reasoning abilities.          Session 16: Lab-RDFa                                               3

                                                                       PalGov © 2011                                                                     4
Module ILOs


After completing this module students will be
able to:
   - Using Oracle Semantics Technology to store and
   query RDF stores.




                        PalGov © 2011                 5
Introduction
                                                                                  Source: Oracle.com


• Oracle Semantic Technologies enables you to:
   –   store RDF data and ontologies,
   –   query RDF data,
   –   perform ontology-assisted query of relational data,
   –   use supplied or user-defined “inferencing”.
                Inference                                    Query
                               User-defined
         OWL Subset




                                              Query RDF/        Ontology-assisted
                       RDF/S




                                              OWL data and      query of relational
                                              ontologies        data



                      Store                     RDF/OWL              Relational
             Bulk Load                          data and             data
                                                ontologies
         Incremental
                                                             Database
         load & DML

                                               PalGov © 2011                                       6
Querying RDF data using Oracle

• Oracle introduced an SQL-based scheme to query RDF
  data.

• They introduced an SQL table function called
  “SEM_MATCH” which is part of Oracle‟s Semantic
  Technologies.

• SEM_MATCH takes a SPARQL-like syntax as arguments,
  and returns a table of results that can be further queried
  using SQL.




                         PalGov © 2011                     7
How RDF Data is stored in Oracle.

• The physical organization of RDF data is a bit different
  from its logical organization as a single <S,P,O> table.
  RDF triples are stored after normalization in two tables:
   – IdTriples(ModelID, subjectID, propertyID, objectID)
       (triples in the identifier format)
   – URIMap(UriID, UriValue)
       (uri to identifier mapping)

• The core implementation of RDF_MATCH query translates
  to a self-join query on IdTriples table.




                             PalGov © 2011                    8
Query Optimization

• Optimization of SEM_MATCH queries on RDF data:

  – Depends on Oracle‟s RDBMS optimizer to efficiently
    speed up the execution of the query.

  – Uses of a set of B-tree indexes and materialized views
    (e.g. the subject-property matrix described previously).




                        PalGov © 2011                          9
Architectural Overview




        PalGov © 2011    10
Core Entities in Oracle Database Semantic Store
                                                    Source: Oracle.com


Sem. Network Dictionary and
data tables for storage and
management of asserted and
inferred RDF triples. OWL and
RDFS rule bases are preloaded.
Model: A model holds an RDF
graph (set of S<P<O triples).
Rulebase: A rulebase is a set of
rules used for inferencing.
Entailments: An entailment stores
triples derived via inferencing.
Application Table: Contains a
column of type sdo_rdf_triple_s,
associated with an RDF model, to
allow DML and access to RDF
triples, and storing ancillary
values.
                                    PalGov © 2011                   11
Core Functionality: Load / Query / Inference
                                                Source: Oracle.com



• Load
 – Bulk load
 – Incremental load

• Query and DML
 – SPARQL
  (from Java/endpoint/Oracle)

• Inference
  – Native support for OWL 2 RL,
    SNOMED (OWL 2 EL subset),
    OWLprime, OWLSIF, RDFS++.
  – Named Graph Local Inference
  – User-defined rules




                                PalGov © 2011                   12
Architectural Overview: Interfaces

Note that there are three interfaces for Oracle
Semantic Technologies:
• SQL-based (SQL and PL/SQL)
• Java-based:
  – Jena (Using Jena adapter from Oracle).
  – Sesame (Using Jena adapter from Oracle).
• SPARQL Endpoints:
  – Joseki
  – OpenRDF Workbench



                       PalGov © 2011              13
Architectural Overview
                              Source: Oracle.com




              PalGov © 2011                   14
Installation and Configuration of Oracle Database
              Semantic Technologies




                      PalGov © 2011                 15
Installation and Configuration (1)

• Load the PL/SQL packages and jar file
  – cd $ORACLE_HOME/md/admin
  – As sysdba
  – SQL> @catsem
• Create a tablespace for semantic network
create bigfile tablespace semts
datafile '?/dbs/semts01.dat' size 512M reuse
autoextend on next 512M maxsize unlimited
extent management local
segment space management auto;


                        PalGov © 2011          16
Installation and Configuration (2)

• Create a temporary tablespace
create bigfile temporary tablespace semtmpts
tempfile ‘?/dbs/semtmpts.dat'
size 512M reuse
autoextend on next 512M maxsize unlimited
EXTENT MANAGEMENT LOCAL;
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE semtmpts;


• Create an undo tablespace
CREATE bigfile UNDO TABLESPACE semundots
DATAFILE ‘?/dbs/semundots.dat' SIZE 512M REUSE
AUTOEXTEND ON next 512M maxsize unlimited
EXTENT MANAGEMENT LOCAL ;
ALTER SYSTEM SET UNDO_TABLESPACE=semundots;


                         PalGov © 2011                  17
Installation and Configuration (3)

• Create a semantic network to enable semantic data
  management:
  – As sysdba
  – SQL> exec sem_apis.create_sem_network(„semts‟);


• Create Semantic Model
  – As scott (or other)
  – SQL> create table test_tpl(id number, triple sdo_rdf_triple_s);
  – SQL> exec sem_apis.create_sem_model(„test‟,‟test_tpl‟,‟triple‟);




                              PalGov © 2011                            18
Loading RDF Triples




       PalGov © 2011   19
Loading Semantic Data: APIs

• Incremental DMLs (small number of changes)
  •   SQL: Insert                                Recommended for
                                                 very small number
  •   SQL: Delete                                of triples

  •   Java API (Jena): GraphOracleSem.add, delete
  •   Java API (Sesame): OracleSailConnection.addStatement,
      removeStatements
                                                   Recommended for
                                                   very large number
                                                   of triples
• Bulk Loader (large number of changes)
  • PL/SQL: sem_apis.bulk_load_from_staging_table(…)
  • Java API (Jena): OracleBulkUpdateHandler.addInBulk(…),
    prepareBulk
  • Java API (Sesame): OracleBulkUpdateHandler.addInBulk,
    prepareBulk ...
                            PalGov © 2011                         20
PL/SQL Bulk Loader

• STEP 1: Load data into Staging Table using SQL*Loader:
   (a) Create a staging table:
   CREATE TABLE stage_table
   (
       RDF$STC_sub varchar2(4000) not null,
       RDF$STC_pred varchar2(4000) not null,
       RDF$STC_obj varchar2(4000) not null,
       RDF$STC_sub_ext varchar2(64),
       RDF$STC_pred_ext varchar2(64),
       RDF$STC_obj_ext varchar2(64),
       RDF$STC_canon_ext varchar2(64)
   ) COMPRESS Tablespace TS_Name;



                       PalGov © 2011                   21
PL/SQL Bulk Loader

• STEP 1: Load data into Staging Table using SQL*Loader:
   (b) Load into Staging Table
  sqlldr userid=testuser/testuser
  control=bulkload.ctl data=dblp.nt
  direct=true skip=0 load=6000000
  discardmax=0 bad=d0.bad discard=d0.rej
  log=d0.log errors=100000000




                             PalGov © 2011             22
PL/SQL Bulk Loader

• STEP 1: Load data into Staging Table using SQL*Loader:
   (b) Load into Staging Table (from cmd)
  sqlldr userid=testuser/testuser
  control=bulkload.ctl data=dblp.nt
  direct=true skip=0 load=6000000
  discardmax=0 bad=d0.bad discard=d0.rej
  log=d0.log errors=100000000

 Control file where     Maximum number of    Input Data (the path
 we specify the name    rows to bulk-load.   to the input data
 of the staging table   Delete to remove     file)
 in the DB.             limitations.




                             PalGov © 2011                          23
PL/SQL Bulk Loader

• STEP 2: Create a semantic model and run bulk load from
  staging table API:
  – Create SEM Model (if not created already):
  CREATE TABLE myrdf_tpl (id number, triple
  SDO_RDF_TRIPLE_S) COMPRESS nologging tablespace
  semts;
   exec sem_apis.create_sem_model(‘myrdf',‘myrdf_tpl',
   'triple');

   – Bulk Load:
   grant select on stage_table to mdsys;
   grant insert on myrdf_tpl to mdsys;
   exec sem_apis.bulk_load_from_staging_table(‘myrdf’,
   ‘scott‘, stage_table‘, flags=>’PARALLEL_CREATE_INDEX
   PARALLEL=4');
                         PalGov © 2011                     24
After Data is loaded

•   Check number of triples in the model and application table
    – select count(1) from mdsys.rdfm_<ModelName>;
    – select count(1) from <AppTable>;
• Analyze the semantic model if there is enough change to
  the model
    – exec sem_apis.analyze_model(‘<ModelName>’);
• Analyze the semantic network if there is enough change to
  the whole network
    – exec sem_perf.gather_stats(true, 4);  -- just on value$
                                            -- table
    – exec sem_perf.gather_stats(false, 4); -- whole network
• Start Querying


                          PalGov © 2011                     25
Querying RDF Data using SEM_MATCH
                                      Source: Oracle.com


• SPARQL Query Architecture




                      PalGov © 2011                   26
SEM_MATCH: Adding SPARQL to SQL
                             Source: Oracle.com




             PalGov © 2011                   27
SEM_MATCH: Adding SPARQL to SQL
                             Source: Oracle.com




             PalGov © 2011                   28
SEM_MATCH: Adding SPARQL to SQL
                             Source: Oracle.com




             PalGov © 2011                   29
SEM_MATCH Table Function Arguments

SEM_MATCH(
  query VARCHAR2,
  models SEM_MODELS,
       - The query attribute is required.
  rulebases SEM_RULEBASES, is, each can be a null
       - The other attributes are optional (that
         value).
  aliases query attribute is a string literal (or concatenation of
       - The SEM_ALIASES,
         string literals) with one or more triple patterns, usually
  filter VARCHAR2,
         containing variables.

  index_status VARCHAR2,
       EXAMPLE:
       ‘SELECT ?directorName
  options VARCHAR2 ) RETURN ANYDATASET;
         WHERE{
                  :M1 :directedBy ?director .
                  ?director :name ?directorName
                 }’


                            PalGov © 2011                        30
SEM_MATCH Table Function Arguments

SEM_MATCH(
  query VARCHAR2,
  models SEM_MODELS,
  rulebases SEM_RULEBASES,
      - The models attribute identifies the model or models to use.
  aliases SEM_ALIASES, which has the following
      - Its data type is SEM_MODELS,
        definition: TABLE OF VARCHAR2(25).
  filter VARCHAR2,virtual model, specify only the name of
      - If you are querying a
        the virtual model and no other models.
  index_status VARCHAR2,
      - Name of the model:
                         SEM_Models (‘  model_name '),
  options VARCHAR2 ) RETURN ANYDATASET;



                            PalGov © 2011                        31
SEM_MATCH Table Function Arguments

SEM_MATCH(
  query VARCHAR2,
  models SEM_MODELS,
  rulebases SEM_RULEBASES,
  aliases rulebases attribute identifies one or more rulebases
       - The SEM_ALIASES,
          whose rules are to be applied to the query.
  filter you are querying a virtual model, this attribute must be
       - If VARCHAR2,
         null.
  index_status VARCHAR2,
       - A rulebase is an object that can contain rules, and a rule is
  optionsobject that can be applied to draw inferences from
         an VARCHAR2 ) RETURN ANYDATASET;
             semantic data.



                              PalGov © 2011                         32
SEM_MATCH Table Function Arguments

SEM_MATCH(
  query VARCHAR2,
  models SEM_MODELS,
  rulebases SEM_RULEBASES,
  aliases SEM_ALIASES, ff a m i l y _r brulebase. This ruleasays
       - EXAMPLE: creates a rulebase named
         named g r a n d p a r e n t _r u l e into the a m i l y _r b
                                                                            , and then inserts rule


  filter VARCHAR2, of a child who is the parent of a child, that
         that if a person is the parent
         person is a grandparent of.
  index_statusP IVARCHAR2, E ( ' f a m i l y _r b ' ) ;
       E X E C U T E S E M _A S . C R E A T E _R U L E B A S
       I N S E R T I N T O m d s y s . s e m r _f a m i l y _r b V A L U E S (
  optionsn dVARCHAR2 ) RETURN ANYDATASET;
       ' g r a p a r e n t _r u l e ' ,
                '(?x :parentOf ?y) (?y :parentOf ?z)',
                NULL,
                '(?x :grandParentOf ?z)',
                S E M _A L I A S E S ( S E M _A L I A S ( ' ' , ' h t t p : / / w w w . e x a m p l e . o r g / f a m i l y / '
                )));
                                                 PalGov © 2011                                                             33
SEM_MATCH Table Function Arguments

SEM_MATCH(
  query VARCHAR2,
  models SEM_MODELS,
  rulebases SEM_RULEBASES,
  aliases SEM_ALIASES,
  filter VARCHAR2, one or more namespaces, in addition to the
       - The aliases attribute identifies
         default namespaces, to be used for expansion of qualified names in the
  index_status VARCHAR2,
         query pattern.
       - The following default namespaces are used:
  options a rVARCHAR2 m l)s .RETURN/ r ANYDATASET;
       ('or df', 'http://x n oracle.com df/')
             ( ' o r a g e o' , ' h t t p : / / x m l n s . o r a c l e . c o m /rdf/ geo/' )
             ('owl', 'http://www.w3.org/2002/07/owl#')
             ('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')
             ('rdfs', 'http://www.w3.org/2000/01/rdf-schema#')
             ('xsd', 'http://www.w3.org/2001/XMLSchema#')
                                     PalGov © 2011                                              34
SEM_MATCH Table Function Arguments

SEM_MATCH(
  query VARCHAR2,
  models SEM_MODELS,
  rulebases SEM_RULEBASES,
  aliases SEM_ALIASES,
  filter VARCHAR2,
  index_status VARCHAR2,
       -The filter attribute identifies any additional selection criteria.

  options VARCHAR2 ) should be a string in the form of a
       - If this attribute is not null, it RETURN ANYDATASET;
             WHERE clause without the WHERE keyword.
            - For example: '(h >= 6)' to limit the result to cases where the height
              of the grandfather's grandchild is 6 or greater

                                 PalGov © 2011                                   35
SEM_MATCH Table Function Arguments

SEM_MATCH( index_status attribute lets you query semantic data even
       - The
         when the relevant entailment does not have a valid status.
  query- VARCHAR2, the query returns an error if the entailment
         If this attribute is null,
  modelsdoes not have a valid status. If this attribute is not null, it must be
            SEM_MODELS,
         the string INCOMPLETE or INVALID.
  rulebases SEM_RULEBASES, precomputed triples that
       - An Entailment is an object containing
         can be inferred from applying a specified set of rulebases to a
  aliases SEM_ALIASES,
         specified set of models.
  filter VARCHAR2,
  index_status VARCHAR2,
  options VARCHAR2 ) RETURN ANYDATASET;



                                 PalGov © 2011                              36
SEM_MATCH Table Function Arguments

SEM_MATCH(
  query VARCHAR2,
  models SEM_MODELS,
  rulebases SEM_RULEBASES,
  aliases options attribute identifies options that can affect
      - The SEM_ALIASES,
        the results of queries.
  filter VARCHAR2, as keyword-value pairs.
      - Options are expressed
  index_status VARCHAR2,
  options VARCHAR2 ) RETURN ANYDATASET;



                         PalGov © 2011                      37
SEM_MATCH Table Function Arguments

SEM_MATCH(
  query VARCHAR2,
  models SEM_MODELS,
   - For more details about using the SEM_MATCH
  rulebases SEM_RULEBASES, consult
      Function and the its different arguments,
      Oracle Semantic Technologies Developer’s Guide:
  aliases SEM_ALIASES,
   http://www.oracle.com/technetwork/database/options/semantic
   -tech/documentation-087054.html
  filter VARCHAR2,
  index_status VARCHAR2,
     SEM_MATCH DOSUMENTATION:
     http://download.oracle.com/docs/cd/E11882_01/appdev.112/e25609/sdo_rdf_concepts.htm#CHDJACII


  options VARCHAR2 ) RETURN ANYDATASET;



                                           PalGov © 2011                                            38
Examples
                              2007
                                        Sicko
                                                            Michael Moore
                         directedBy
                   M1                  D1                                              Emmy Awards

                                                                    P1                 1995
                   M2                  2009

                                        Capitalism
                                                              C1              USA
                                      1995
                                                                               Washington DC
                        directedBy
                   M3                  D2
                          actedIn                                   P2                 Oscars
                                        Brave Heart         Mel Gibson              1996
                               2007                        Nadine Labaki
                        directedBy
                   M4                  D3                     C2              Lebanon
                          actedIn
                                                                              Beirut
                                         Caramel       location            name
                                                                    P3                   Stockholm Festival
Exercises:                                            C3
                                                                    Sweden          2007

(1) What is the name of director D3?                Stockholm
(2) What is the name of the director of the movie M1?
(3) List all the movies who have directors from the USA and their directors.
(4) List all the names of the directors from Lebanon who have won prizes and the
    prizes they have won.                PalGov © 2011                                                        39
Examples

• Q1: What is the name of director D3?
   Select directorName
   From
     Table(
       SEM_MATCH(
        ‘SELECT ?directorName
         WHERE {:D3 :name ?directorName}’,
         SEM_MODELS(‘movies_model’), null, null, null,
         null, null)
       )
    );




                        PalGov © 2011               40
Examples

• Q2: What is the name of the director of the movie M1?
   Select directorName
   From
     Table(
       SEM_MATCH(
      ‘SELECT ?directorName
         WHERE{
         :M1 :directedBy ?director .
         ?director :name ?directorName}’,
          SEM_MODELS(‘movies_model’), null, null, null,
          null, null)
         )
    );
                         PalGov © 2011                    41
Examples

• Q3: List all the movies who have directors from the USA
  and their directors.
   Select movie, director
   From
     Table(
       SEM_MATCH(
      ‘Select ?movie ?director
        Where {?movie :directedBy ?director.
               ?director :country ?country.
                 ?country :name ‘USA’}’ ,
          SEM_MODELS(‘movies_model’), null, null, null,
          null, null)
         )
    );                   PalGov © 2011                      42
Examples

• Q4: List all the names of the directors from Lebanon who
  have won prizes and the prizes they have won.
   Select directorName, prize
   From
     Table(
       SEM_MATCH(
      ‘Select ?directorName ?prize
       Where { ?director :name ?directorName.
               ?director :country ?c.
               ?c :name ‘Lebanon’.
                ?director :hasWonPrizeIn ?prize}’,
        SEM_MODELS(‘movies_model’), null, null, null,
        null, null)
     ));               PalGov © 2011                 43
Data Integration and Open Information Systems (Tutorial II)
                                             The Palestinian e-Government Academy
                                                                     January, 2012




Tutorial II: Data Integration and Open Information Systems



              Practical Session




                          PalGov © 2011                                             44
Practical Session
PART1: Given the previous movies example and the accompanying four
queries, do the following:
    (1) Write the data graph using any suitable RDF syntax (N3, or Turtle). Note:
        Avoid using XML syntax as it might need additional effort to bulk-load.
    (2) Bulk Load your RDF file into Oracle.
    (3) Write the four queries accompanying the example using the SEM_MATCH
        function and execute them over the bulk-loaded file.
PART2: Given the RDF graph of Practical Session I and II (also included in the
next slide), do the following:
    (1) Write the data graph using any suitable RDF syntax (N3, or Turtle) and bulk-
        load it into Oracle.
    (2) Write the following queries using the SEM_MATCH function and execute them
        over the bulk-loaded file:
        • List all the authors born in a country which has the name Palestine.
        • List the names of all authors with the name of their affiliation who are born in a
          country whose capital‟s population is14M. Note that the author must have an
          affiliation.
        • List the names of all books whose authors are born in Lebanon along with the name
          of the author.                    PalGov © 2011                                    45
Practical Session
                                                                    Palestine
                                                                                              7.6K
                                        Said
                                                              Capital                  Name
                                                    CN1                     CA1                 Jerusalem
                        AU1
 BK1
                                               CU                Colombia University

          Author                          Viswanathan                                         14.0M
 BK2                    AU2
                                                                          India

                                                              Capital                  Name      New Delhi
          Wamadat                                       CN2                 CA2
                              Name
             Author                       Naima
 BK3                    AU3                                             Lebanon
                                                                                               2.0M
          The Prophet                Gibran
                                                        CN3                CA3
 BK4                                                                                             Beirut
            Author
                        AU4

This data graph is about books. It talks about four books (BK1-BK4).
Information recorded about a book includes data such as; its author,
affiliation, country of birth including its capital and the population of
its capital.


                                      PalGov © 2011                                                          46
Practical Session - Instructions

• Each student should work alone.
• In part 2 of this practical session, the student is strongly recommended
  to write two additional queries, execute them on the data graph, and
  hand them along with the required queries.
• In part 2 of this practical session, the student is encouraged to compare
  the results of the queries with those from Practical Session I and II.
• Each student must expect to present and discuss his/her queries at
  class and compare them with the work of other students.
• The final delivery should include for every part of the practical session:
  (i) A link to the RDF file, (ii) a snapshot of the table where the file was
  bulk-loaded, (iii) A snapshot of every query and its results. These must
  all be delivered in a report form in PDF format.




                                 PalGov © 2011                                  47
References

• http://www.oracle.com

• Anton Deik, Bilal Faraj, Ala Hawash, Mustafa Jarrar: Towards Query
  Optimization for the Data Web - Two Disk-Based algorithms: Trace
  Equivalence and Bisimilarity.




                             PalGov © 2011                             48
Thank you!




   PalGov © 2011   49

Weitere ähnliche Inhalte

Was ist angesagt?

Pal gov.tutorial2.session13 3.data integration and fusion using rdf
Pal gov.tutorial2.session13 3.data integration and fusion using rdfPal gov.tutorial2.session13 3.data integration and fusion using rdf
Pal gov.tutorial2.session13 3.data integration and fusion using rdfMustafa Jarrar
 
Pal gov.tutorial2.session3.xml schemas
Pal gov.tutorial2.session3.xml schemasPal gov.tutorial2.session3.xml schemas
Pal gov.tutorial2.session3.xml schemasMustafa Jarrar
 
Pal gov.tutorial2.session14.lab rdf-dataintegration
Pal gov.tutorial2.session14.lab rdf-dataintegrationPal gov.tutorial2.session14.lab rdf-dataintegration
Pal gov.tutorial2.session14.lab rdf-dataintegrationMustafa Jarrar
 
Pal gov.tutorial2.session1.xml basics and namespaces
Pal gov.tutorial2.session1.xml basics and namespacesPal gov.tutorial2.session1.xml basics and namespaces
Pal gov.tutorial2.session1.xml basics and namespacesMustafa Jarrar
 
Pal gov.tutorial2.session15 2.rd_fa
Pal gov.tutorial2.session15 2.rd_faPal gov.tutorial2.session15 2.rd_fa
Pal gov.tutorial2.session15 2.rd_faMustafa Jarrar
 
Pal gov.tutorial2.session2.xml dtd's
Pal gov.tutorial2.session2.xml dtd'sPal gov.tutorial2.session2.xml dtd's
Pal gov.tutorial2.session2.xml dtd'sMustafa Jarrar
 
Pal gov.tutorial2.session8.lab owl
Pal gov.tutorial2.session8.lab owlPal gov.tutorial2.session8.lab owl
Pal gov.tutorial2.session8.lab owlMustafa Jarrar
 
Pal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddataPal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddataMustafa Jarrar
 
Pal gov.tutorial2.session0.outline
Pal gov.tutorial2.session0.outlinePal gov.tutorial2.session0.outline
Pal gov.tutorial2.session0.outlineMustafa Jarrar
 
Pal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integrationPal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integrationMustafa Jarrar
 
Pal gov.tutorial2.session13 1.data schema integration
Pal gov.tutorial2.session13 1.data schema integrationPal gov.tutorial2.session13 1.data schema integration
Pal gov.tutorial2.session13 1.data schema integrationMustafa Jarrar
 
Pal gov.tutorial2.session4.lab xml document and schemas
Pal gov.tutorial2.session4.lab xml  document and schemasPal gov.tutorial2.session4.lab xml  document and schemas
Pal gov.tutorial2.session4.lab xml document and schemasMustafa Jarrar
 
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issuesPal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issuesMustafa Jarrar
 
Pal gov.tutorial3.session3.xpath & xquery (lab1)
Pal gov.tutorial3.session3.xpath & xquery (lab1)Pal gov.tutorial3.session3.xpath & xquery (lab1)
Pal gov.tutorial3.session3.xpath & xquery (lab1)Mustafa Jarrar
 
Pal gov.tutorial3.session2.xml ns and schema
Pal gov.tutorial3.session2.xml ns and schemaPal gov.tutorial3.session2.xml ns and schema
Pal gov.tutorial3.session2.xml ns and schemaMustafa Jarrar
 
Producing, Publishing and Consuming Linked Data Three lessons from the Bio2RD...
Producing, Publishing and Consuming Linked Data Three lessons from the Bio2RD...Producing, Publishing and Consuming Linked Data Three lessons from the Bio2RD...
Producing, Publishing and Consuming Linked Data Three lessons from the Bio2RD...François Belleau
 
LODUM talk at ifgi's Spatial @ WWU series
LODUM talk at ifgi's Spatial @ WWU seriesLODUM talk at ifgi's Spatial @ WWU series
LODUM talk at ifgi's Spatial @ WWU seriesCarsten Keßler
 

Was ist angesagt? (19)

Pal gov.tutorial2.session13 3.data integration and fusion using rdf
Pal gov.tutorial2.session13 3.data integration and fusion using rdfPal gov.tutorial2.session13 3.data integration and fusion using rdf
Pal gov.tutorial2.session13 3.data integration and fusion using rdf
 
Pal gov.tutorial2.session3.xml schemas
Pal gov.tutorial2.session3.xml schemasPal gov.tutorial2.session3.xml schemas
Pal gov.tutorial2.session3.xml schemas
 
Pal gov.tutorial2.session14.lab rdf-dataintegration
Pal gov.tutorial2.session14.lab rdf-dataintegrationPal gov.tutorial2.session14.lab rdf-dataintegration
Pal gov.tutorial2.session14.lab rdf-dataintegration
 
Pal gov.tutorial2.session1.xml basics and namespaces
Pal gov.tutorial2.session1.xml basics and namespacesPal gov.tutorial2.session1.xml basics and namespaces
Pal gov.tutorial2.session1.xml basics and namespaces
 
Pal gov.tutorial2.session15 2.rd_fa
Pal gov.tutorial2.session15 2.rd_faPal gov.tutorial2.session15 2.rd_fa
Pal gov.tutorial2.session15 2.rd_fa
 
Pal gov.tutorial2.session2.xml dtd's
Pal gov.tutorial2.session2.xml dtd'sPal gov.tutorial2.session2.xml dtd's
Pal gov.tutorial2.session2.xml dtd's
 
Pal gov.tutorial2.session8.lab owl
Pal gov.tutorial2.session8.lab owlPal gov.tutorial2.session8.lab owl
Pal gov.tutorial2.session8.lab owl
 
Pal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddataPal gov.tutorial2.session15 1.linkeddata
Pal gov.tutorial2.session15 1.linkeddata
 
Pal gov.tutorial2.session0.outline
Pal gov.tutorial2.session0.outlinePal gov.tutorial2.session0.outline
Pal gov.tutorial2.session0.outline
 
Pal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integrationPal gov.tutorial2.session12 1.the problem of data integration
Pal gov.tutorial2.session12 1.the problem of data integration
 
Pal gov.tutorial2.session13 1.data schema integration
Pal gov.tutorial2.session13 1.data schema integrationPal gov.tutorial2.session13 1.data schema integration
Pal gov.tutorial2.session13 1.data schema integration
 
Pal gov.tutorial2.session4.lab xml document and schemas
Pal gov.tutorial2.session4.lab xml  document and schemasPal gov.tutorial2.session4.lab xml  document and schemas
Pal gov.tutorial2.session4.lab xml document and schemas
 
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issuesPal gov.tutorial2.session12 2.architectural solutions for the integration issues
Pal gov.tutorial2.session12 2.architectural solutions for the integration issues
 
Pal gov.tutorial3.session3.xpath & xquery (lab1)
Pal gov.tutorial3.session3.xpath & xquery (lab1)Pal gov.tutorial3.session3.xpath & xquery (lab1)
Pal gov.tutorial3.session3.xpath & xquery (lab1)
 
Pal gov.tutorial3.session2.xml ns and schema
Pal gov.tutorial3.session2.xml ns and schemaPal gov.tutorial3.session2.xml ns and schema
Pal gov.tutorial3.session2.xml ns and schema
 
Producing, Publishing and Consuming Linked Data Three lessons from the Bio2RD...
Producing, Publishing and Consuming Linked Data Three lessons from the Bio2RD...Producing, Publishing and Consuming Linked Data Three lessons from the Bio2RD...
Producing, Publishing and Consuming Linked Data Three lessons from the Bio2RD...
 
LODUM talk at ifgi's Spatial @ WWU series
LODUM talk at ifgi's Spatial @ WWU seriesLODUM talk at ifgi's Spatial @ WWU series
LODUM talk at ifgi's Spatial @ WWU series
 
Java
JavaJava
Java
 
Icsme16.ppt
Icsme16.pptIcsme16.ppt
Icsme16.ppt
 

Ähnlich wie Pal gov.tutorial2.session11.oracle

Pal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemanticsPal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemanticsMustafa Jarrar
 
Pal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemanticsPal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemanticsMustafa Jarrar
 
Pal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outlinePal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outlineMustafa Jarrar
 
Pal gov.tutorial4.outline
Pal gov.tutorial4.outlinePal gov.tutorial4.outline
Pal gov.tutorial4.outlineMustafa Jarrar
 
Pal gov.tutorial4.session6 2.knowledge double-articulation
Pal gov.tutorial4.session6 2.knowledge double-articulationPal gov.tutorial4.session6 2.knowledge double-articulation
Pal gov.tutorial4.session6 2.knowledge double-articulationMustafa Jarrar
 
Pal gov.tutorial4.session11.lab zinnarontologybasedwebservices
Pal gov.tutorial4.session11.lab zinnarontologybasedwebservicesPal gov.tutorial4.session11.lab zinnarontologybasedwebservices
Pal gov.tutorial4.session11.lab zinnarontologybasedwebservicesMustafa Jarrar
 
Pal gov.tutorial3.session6.soap
Pal gov.tutorial3.session6.soapPal gov.tutorial3.session6.soap
Pal gov.tutorial3.session6.soapMustafa Jarrar
 
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011François Scharffe
 
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift
 
Pal gov.tutorial4.session8 2.stepwisemethodologies
Pal gov.tutorial4.session8 2.stepwisemethodologiesPal gov.tutorial4.session8 2.stepwisemethodologies
Pal gov.tutorial4.session8 2.stepwisemethodologiesMustafa Jarrar
 
Pal gov.tutorial3.session4.rest
Pal gov.tutorial3.session4.restPal gov.tutorial3.session4.rest
Pal gov.tutorial3.session4.restMustafa Jarrar
 
Pal gov.tutorial4.session5.lab ontologytools
Pal gov.tutorial4.session5.lab ontologytoolsPal gov.tutorial4.session5.lab ontologytools
Pal gov.tutorial4.session5.lab ontologytoolsMustafa Jarrar
 
Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2Mustafa Jarrar
 
Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5Mustafa Jarrar
 
Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6Mustafa Jarrar
 

Ähnlich wie Pal gov.tutorial2.session11.oracle (15)

Pal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemanticsPal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemantics
 
Pal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemanticsPal gov.tutorial4.session1 1.needforsharedsemantics
Pal gov.tutorial4.session1 1.needforsharedsemantics
 
Pal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outlinePal gov.tutorial3.session0.outline
Pal gov.tutorial3.session0.outline
 
Pal gov.tutorial4.outline
Pal gov.tutorial4.outlinePal gov.tutorial4.outline
Pal gov.tutorial4.outline
 
Pal gov.tutorial4.session6 2.knowledge double-articulation
Pal gov.tutorial4.session6 2.knowledge double-articulationPal gov.tutorial4.session6 2.knowledge double-articulation
Pal gov.tutorial4.session6 2.knowledge double-articulation
 
Pal gov.tutorial4.session11.lab zinnarontologybasedwebservices
Pal gov.tutorial4.session11.lab zinnarontologybasedwebservicesPal gov.tutorial4.session11.lab zinnarontologybasedwebservices
Pal gov.tutorial4.session11.lab zinnarontologybasedwebservices
 
Pal gov.tutorial3.session6.soap
Pal gov.tutorial3.session6.soapPal gov.tutorial3.session6.soap
Pal gov.tutorial3.session6.soap
 
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
 
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
 
Pal gov.tutorial4.session8 2.stepwisemethodologies
Pal gov.tutorial4.session8 2.stepwisemethodologiesPal gov.tutorial4.session8 2.stepwisemethodologies
Pal gov.tutorial4.session8 2.stepwisemethodologies
 
Pal gov.tutorial3.session4.rest
Pal gov.tutorial3.session4.restPal gov.tutorial3.session4.rest
Pal gov.tutorial3.session4.rest
 
Pal gov.tutorial4.session5.lab ontologytools
Pal gov.tutorial4.session5.lab ontologytoolsPal gov.tutorial4.session5.lab ontologytools
Pal gov.tutorial4.session5.lab ontologytools
 
Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2Pal gov.tutorial3.session5.lab2
Pal gov.tutorial3.session5.lab2
 
Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5Pal gov.tutorial3.session12.lab5
Pal gov.tutorial3.session12.lab5
 
Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6Pal gov.tutorial3.session14.lab6
Pal gov.tutorial3.session14.lab6
 

Mehr von Mustafa Jarrar

Clustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment AnalysisClustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment AnalysisMustafa Jarrar
 
Classifying Processes and Basic Formal Ontology
Classifying Processes  and Basic Formal OntologyClassifying Processes  and Basic Formal Ontology
Classifying Processes and Basic Formal OntologyMustafa Jarrar
 
Discrete Mathematics Course Outline
Discrete Mathematics Course OutlineDiscrete Mathematics Course Outline
Discrete Mathematics Course OutlineMustafa Jarrar
 
Business Process Implementation
Business Process ImplementationBusiness Process Implementation
Business Process ImplementationMustafa Jarrar
 
Business Process Design and Re-engineering
Business Process Design and Re-engineeringBusiness Process Design and Re-engineering
Business Process Design and Re-engineeringMustafa Jarrar
 
BPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical ConstructsBPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical ConstructsMustafa Jarrar
 
BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs  BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs Mustafa Jarrar
 
Introduction to Business Process Management
Introduction to Business Process ManagementIntroduction to Business Process Management
Introduction to Business Process ManagementMustafa Jarrar
 
Customer Complaint Ontology
Customer Complaint Ontology Customer Complaint Ontology
Customer Complaint Ontology Mustafa Jarrar
 
Subset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion RulesSubset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion RulesMustafa Jarrar
 
Schema Modularization in ORM
Schema Modularization in ORMSchema Modularization in ORM
Schema Modularization in ORMMustafa Jarrar
 
On Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in PalestineOn Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in PalestineMustafa Jarrar
 
Lessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online CoursesLessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online CoursesMustafa Jarrar
 
Presentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-finalPresentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-finalMustafa Jarrar
 
Jarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 CallsJarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 CallsMustafa Jarrar
 
Habash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingHabash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingMustafa Jarrar
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Mustafa Jarrar
 
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 ProposalsRiestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 ProposalsMustafa Jarrar
 
Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020Mustafa Jarrar
 
Jarrar: Sparql Project
Jarrar: Sparql ProjectJarrar: Sparql Project
Jarrar: Sparql ProjectMustafa Jarrar
 

Mehr von Mustafa Jarrar (20)

Clustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment AnalysisClustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment Analysis
 
Classifying Processes and Basic Formal Ontology
Classifying Processes  and Basic Formal OntologyClassifying Processes  and Basic Formal Ontology
Classifying Processes and Basic Formal Ontology
 
Discrete Mathematics Course Outline
Discrete Mathematics Course OutlineDiscrete Mathematics Course Outline
Discrete Mathematics Course Outline
 
Business Process Implementation
Business Process ImplementationBusiness Process Implementation
Business Process Implementation
 
Business Process Design and Re-engineering
Business Process Design and Re-engineeringBusiness Process Design and Re-engineering
Business Process Design and Re-engineering
 
BPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical ConstructsBPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical Constructs
 
BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs  BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs
 
Introduction to Business Process Management
Introduction to Business Process ManagementIntroduction to Business Process Management
Introduction to Business Process Management
 
Customer Complaint Ontology
Customer Complaint Ontology Customer Complaint Ontology
Customer Complaint Ontology
 
Subset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion RulesSubset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion Rules
 
Schema Modularization in ORM
Schema Modularization in ORMSchema Modularization in ORM
Schema Modularization in ORM
 
On Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in PalestineOn Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in Palestine
 
Lessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online CoursesLessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online Courses
 
Presentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-finalPresentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-final
 
Jarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 CallsJarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 Calls
 
Habash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingHabash: Arabic Natural Language Processing
Habash: Arabic Natural Language Processing
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing
 
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 ProposalsRiestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
 
Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020
 
Jarrar: Sparql Project
Jarrar: Sparql ProjectJarrar: Sparql Project
Jarrar: Sparql Project
 

Kürzlich hochgeladen

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

Kürzlich hochgeladen (20)

Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 

Pal gov.tutorial2.session11.oracle

  • 1. ‫أكاديمية الحكومة اإللكترونية الفلسطينية‬ The Palestinian eGovernment Academy www.egovacademy.ps Tutorial II: Data Integration and Open Information Systems Session 11 Oracle Semantic Technologies Dr. Mustafa Jarrar University of Birzeit mjarrar@birzeit.edu www.jarrar.info PalGov © 2011 1
  • 2. About This tutorial is part of the PalGov project, funded by the TEMPUS IV program of the Commission of the European Communities, grant agreement 511159-TEMPUS-1- 2010-1-PS-TEMPUS-JPHES. The project website: www.egovacademy.ps Project Consortium: Birzeit University, Palestine University of Trento, Italy (Coordinator ) Palestine Polytechnic University, Palestine Vrije Universiteit Brussel, Belgium Palestine Technical University, Palestine Université de Savoie, France Ministry of Telecom and IT, Palestine University of Namur, Belgium Ministry of Interior, Palestine TrueTrust, UK Ministry of Local Government, Palestine Coordinator: Dr. Mustafa Jarrar Birzeit University, P.O.Box 14- Birzeit, Palestine Telfax:+972 2 2982935 mjarrar@birzeit.eduPalGov © 2011 2
  • 3. © Copyright Notes Everyone is encouraged to use this material, or part of it, but should properly cite the project (logo and website), and the author of that part. No part of this tutorial may be reproduced or modified in any form or by any means, without prior written permission from the project, who have the full copyrights on the material. Attribution-NonCommercial-ShareAlike CC-BY-NC-SA This license lets others remix, tweak, and build upon your work non- commercially, as long as they credit you and license their new creations under the identical terms. PalGov © 2011 3
  • 4. Tutorial Map Topic h Intended Learning Objectives Session 1: XML Basics and Namespaces 3 A: Knowledge and Understanding Session 2: XML DTD‟s 3 2a1: Describe tree and graph data models. Session 3: XML Schemas 3 2a2: Understand the notation of XML, RDF, RDFS, and OWL. Session 4: Lab-XML Schemas 3 2a3: Demonstrate knowledge about querying techniques for data models as SPARQL and XPath. Session 5: RDF and RDFs 3 2a4: Explain the concepts of identity management and Linked data. Session 6: Lab-RDF and RDFs 3 2a5: Demonstrate knowledge about Integration &fusion of Session 7: OWL (Ontology Web Language) 3 heterogeneous data. Session 8: Lab-OWL 3 B: Intellectual Skills Session 9: Lab-RDF Stores -Challenges and Solutions 3 2b1: Represent data using tree and graph data models (XML & Session 10: Lab-SPARQL 3 RDF). Session 11: Lab-Oracle Semantic Technology 3 2b2: Describe data semantics using RDFS and OWL. Session 12_1: The problem of Data Integration 1.5 2b3: Manage and query data represented in RDF, XML, OWL. Session 12_2: Architectural Solutions for the Integration Issues 1.5 2b4: Integrate and fuse heterogeneous data. Session 13_1: Data Schema Integration 1 C: Professional and Practical Skills Session 13_2: GAV and LAV Integration 1 2c1: Using Oracle Semantic Technology and/or Virtuoso to store Session 13_3: Data Integration and Fusion using RDF 1 and query RDF stores. Session 14: Lab-Data Integration and Fusion using RDF 3 D: General and Transferable Skills 2d1: Working with team. Session 15_1: Data Web and Linked Data 1.5 2d2: Presenting and defending ideas. Session 15_2: RDFa 1.5 2d3: Use of creativity and innovation in problem solving. 2d4: Develop communication skills and logical reasoning abilities. Session 16: Lab-RDFa 3 PalGov © 2011 4
  • 5. Module ILOs After completing this module students will be able to: - Using Oracle Semantics Technology to store and query RDF stores. PalGov © 2011 5
  • 6. Introduction Source: Oracle.com • Oracle Semantic Technologies enables you to: – store RDF data and ontologies, – query RDF data, – perform ontology-assisted query of relational data, – use supplied or user-defined “inferencing”. Inference Query User-defined OWL Subset Query RDF/ Ontology-assisted RDF/S OWL data and query of relational ontologies data Store RDF/OWL Relational Bulk Load data and data ontologies Incremental Database load & DML PalGov © 2011 6
  • 7. Querying RDF data using Oracle • Oracle introduced an SQL-based scheme to query RDF data. • They introduced an SQL table function called “SEM_MATCH” which is part of Oracle‟s Semantic Technologies. • SEM_MATCH takes a SPARQL-like syntax as arguments, and returns a table of results that can be further queried using SQL. PalGov © 2011 7
  • 8. How RDF Data is stored in Oracle. • The physical organization of RDF data is a bit different from its logical organization as a single <S,P,O> table. RDF triples are stored after normalization in two tables: – IdTriples(ModelID, subjectID, propertyID, objectID) (triples in the identifier format) – URIMap(UriID, UriValue) (uri to identifier mapping) • The core implementation of RDF_MATCH query translates to a self-join query on IdTriples table. PalGov © 2011 8
  • 9. Query Optimization • Optimization of SEM_MATCH queries on RDF data: – Depends on Oracle‟s RDBMS optimizer to efficiently speed up the execution of the query. – Uses of a set of B-tree indexes and materialized views (e.g. the subject-property matrix described previously). PalGov © 2011 9
  • 10. Architectural Overview PalGov © 2011 10
  • 11. Core Entities in Oracle Database Semantic Store Source: Oracle.com Sem. Network Dictionary and data tables for storage and management of asserted and inferred RDF triples. OWL and RDFS rule bases are preloaded. Model: A model holds an RDF graph (set of S<P<O triples). Rulebase: A rulebase is a set of rules used for inferencing. Entailments: An entailment stores triples derived via inferencing. Application Table: Contains a column of type sdo_rdf_triple_s, associated with an RDF model, to allow DML and access to RDF triples, and storing ancillary values. PalGov © 2011 11
  • 12. Core Functionality: Load / Query / Inference Source: Oracle.com • Load – Bulk load – Incremental load • Query and DML – SPARQL (from Java/endpoint/Oracle) • Inference – Native support for OWL 2 RL, SNOMED (OWL 2 EL subset), OWLprime, OWLSIF, RDFS++. – Named Graph Local Inference – User-defined rules PalGov © 2011 12
  • 13. Architectural Overview: Interfaces Note that there are three interfaces for Oracle Semantic Technologies: • SQL-based (SQL and PL/SQL) • Java-based: – Jena (Using Jena adapter from Oracle). – Sesame (Using Jena adapter from Oracle). • SPARQL Endpoints: – Joseki – OpenRDF Workbench PalGov © 2011 13
  • 14. Architectural Overview Source: Oracle.com PalGov © 2011 14
  • 15. Installation and Configuration of Oracle Database Semantic Technologies PalGov © 2011 15
  • 16. Installation and Configuration (1) • Load the PL/SQL packages and jar file – cd $ORACLE_HOME/md/admin – As sysdba – SQL> @catsem • Create a tablespace for semantic network create bigfile tablespace semts datafile '?/dbs/semts01.dat' size 512M reuse autoextend on next 512M maxsize unlimited extent management local segment space management auto; PalGov © 2011 16
  • 17. Installation and Configuration (2) • Create a temporary tablespace create bigfile temporary tablespace semtmpts tempfile ‘?/dbs/semtmpts.dat' size 512M reuse autoextend on next 512M maxsize unlimited EXTENT MANAGEMENT LOCAL; ALTER DATABASE DEFAULT TEMPORARY TABLESPACE semtmpts; • Create an undo tablespace CREATE bigfile UNDO TABLESPACE semundots DATAFILE ‘?/dbs/semundots.dat' SIZE 512M REUSE AUTOEXTEND ON next 512M maxsize unlimited EXTENT MANAGEMENT LOCAL ; ALTER SYSTEM SET UNDO_TABLESPACE=semundots; PalGov © 2011 17
  • 18. Installation and Configuration (3) • Create a semantic network to enable semantic data management: – As sysdba – SQL> exec sem_apis.create_sem_network(„semts‟); • Create Semantic Model – As scott (or other) – SQL> create table test_tpl(id number, triple sdo_rdf_triple_s); – SQL> exec sem_apis.create_sem_model(„test‟,‟test_tpl‟,‟triple‟); PalGov © 2011 18
  • 19. Loading RDF Triples PalGov © 2011 19
  • 20. Loading Semantic Data: APIs • Incremental DMLs (small number of changes) • SQL: Insert Recommended for very small number • SQL: Delete of triples • Java API (Jena): GraphOracleSem.add, delete • Java API (Sesame): OracleSailConnection.addStatement, removeStatements Recommended for very large number of triples • Bulk Loader (large number of changes) • PL/SQL: sem_apis.bulk_load_from_staging_table(…) • Java API (Jena): OracleBulkUpdateHandler.addInBulk(…), prepareBulk • Java API (Sesame): OracleBulkUpdateHandler.addInBulk, prepareBulk ... PalGov © 2011 20
  • 21. PL/SQL Bulk Loader • STEP 1: Load data into Staging Table using SQL*Loader: (a) Create a staging table: CREATE TABLE stage_table ( RDF$STC_sub varchar2(4000) not null, RDF$STC_pred varchar2(4000) not null, RDF$STC_obj varchar2(4000) not null, RDF$STC_sub_ext varchar2(64), RDF$STC_pred_ext varchar2(64), RDF$STC_obj_ext varchar2(64), RDF$STC_canon_ext varchar2(64) ) COMPRESS Tablespace TS_Name; PalGov © 2011 21
  • 22. PL/SQL Bulk Loader • STEP 1: Load data into Staging Table using SQL*Loader: (b) Load into Staging Table sqlldr userid=testuser/testuser control=bulkload.ctl data=dblp.nt direct=true skip=0 load=6000000 discardmax=0 bad=d0.bad discard=d0.rej log=d0.log errors=100000000 PalGov © 2011 22
  • 23. PL/SQL Bulk Loader • STEP 1: Load data into Staging Table using SQL*Loader: (b) Load into Staging Table (from cmd) sqlldr userid=testuser/testuser control=bulkload.ctl data=dblp.nt direct=true skip=0 load=6000000 discardmax=0 bad=d0.bad discard=d0.rej log=d0.log errors=100000000 Control file where Maximum number of Input Data (the path we specify the name rows to bulk-load. to the input data of the staging table Delete to remove file) in the DB. limitations. PalGov © 2011 23
  • 24. PL/SQL Bulk Loader • STEP 2: Create a semantic model and run bulk load from staging table API: – Create SEM Model (if not created already): CREATE TABLE myrdf_tpl (id number, triple SDO_RDF_TRIPLE_S) COMPRESS nologging tablespace semts; exec sem_apis.create_sem_model(‘myrdf',‘myrdf_tpl', 'triple'); – Bulk Load: grant select on stage_table to mdsys; grant insert on myrdf_tpl to mdsys; exec sem_apis.bulk_load_from_staging_table(‘myrdf’, ‘scott‘, stage_table‘, flags=>’PARALLEL_CREATE_INDEX PARALLEL=4'); PalGov © 2011 24
  • 25. After Data is loaded • Check number of triples in the model and application table – select count(1) from mdsys.rdfm_<ModelName>; – select count(1) from <AppTable>; • Analyze the semantic model if there is enough change to the model – exec sem_apis.analyze_model(‘<ModelName>’); • Analyze the semantic network if there is enough change to the whole network – exec sem_perf.gather_stats(true, 4); -- just on value$ -- table – exec sem_perf.gather_stats(false, 4); -- whole network • Start Querying PalGov © 2011 25
  • 26. Querying RDF Data using SEM_MATCH Source: Oracle.com • SPARQL Query Architecture PalGov © 2011 26
  • 27. SEM_MATCH: Adding SPARQL to SQL Source: Oracle.com PalGov © 2011 27
  • 28. SEM_MATCH: Adding SPARQL to SQL Source: Oracle.com PalGov © 2011 28
  • 29. SEM_MATCH: Adding SPARQL to SQL Source: Oracle.com PalGov © 2011 29
  • 30. SEM_MATCH Table Function Arguments SEM_MATCH( query VARCHAR2, models SEM_MODELS, - The query attribute is required. rulebases SEM_RULEBASES, is, each can be a null - The other attributes are optional (that value). aliases query attribute is a string literal (or concatenation of - The SEM_ALIASES, string literals) with one or more triple patterns, usually filter VARCHAR2, containing variables. index_status VARCHAR2, EXAMPLE: ‘SELECT ?directorName options VARCHAR2 ) RETURN ANYDATASET; WHERE{ :M1 :directedBy ?director . ?director :name ?directorName }’ PalGov © 2011 30
  • 31. SEM_MATCH Table Function Arguments SEM_MATCH( query VARCHAR2, models SEM_MODELS, rulebases SEM_RULEBASES, - The models attribute identifies the model or models to use. aliases SEM_ALIASES, which has the following - Its data type is SEM_MODELS, definition: TABLE OF VARCHAR2(25). filter VARCHAR2,virtual model, specify only the name of - If you are querying a the virtual model and no other models. index_status VARCHAR2, - Name of the model: SEM_Models (‘ model_name '), options VARCHAR2 ) RETURN ANYDATASET; PalGov © 2011 31
  • 32. SEM_MATCH Table Function Arguments SEM_MATCH( query VARCHAR2, models SEM_MODELS, rulebases SEM_RULEBASES, aliases rulebases attribute identifies one or more rulebases - The SEM_ALIASES, whose rules are to be applied to the query. filter you are querying a virtual model, this attribute must be - If VARCHAR2, null. index_status VARCHAR2, - A rulebase is an object that can contain rules, and a rule is optionsobject that can be applied to draw inferences from an VARCHAR2 ) RETURN ANYDATASET; semantic data. PalGov © 2011 32
  • 33. SEM_MATCH Table Function Arguments SEM_MATCH( query VARCHAR2, models SEM_MODELS, rulebases SEM_RULEBASES, aliases SEM_ALIASES, ff a m i l y _r brulebase. This ruleasays - EXAMPLE: creates a rulebase named named g r a n d p a r e n t _r u l e into the a m i l y _r b , and then inserts rule filter VARCHAR2, of a child who is the parent of a child, that that if a person is the parent person is a grandparent of. index_statusP IVARCHAR2, E ( ' f a m i l y _r b ' ) ; E X E C U T E S E M _A S . C R E A T E _R U L E B A S I N S E R T I N T O m d s y s . s e m r _f a m i l y _r b V A L U E S ( optionsn dVARCHAR2 ) RETURN ANYDATASET; ' g r a p a r e n t _r u l e ' , '(?x :parentOf ?y) (?y :parentOf ?z)', NULL, '(?x :grandParentOf ?z)', S E M _A L I A S E S ( S E M _A L I A S ( ' ' , ' h t t p : / / w w w . e x a m p l e . o r g / f a m i l y / ' ))); PalGov © 2011 33
  • 34. SEM_MATCH Table Function Arguments SEM_MATCH( query VARCHAR2, models SEM_MODELS, rulebases SEM_RULEBASES, aliases SEM_ALIASES, filter VARCHAR2, one or more namespaces, in addition to the - The aliases attribute identifies default namespaces, to be used for expansion of qualified names in the index_status VARCHAR2, query pattern. - The following default namespaces are used: options a rVARCHAR2 m l)s .RETURN/ r ANYDATASET; ('or df', 'http://x n oracle.com df/') ( ' o r a g e o' , ' h t t p : / / x m l n s . o r a c l e . c o m /rdf/ geo/' ) ('owl', 'http://www.w3.org/2002/07/owl#') ('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#') ('rdfs', 'http://www.w3.org/2000/01/rdf-schema#') ('xsd', 'http://www.w3.org/2001/XMLSchema#') PalGov © 2011 34
  • 35. SEM_MATCH Table Function Arguments SEM_MATCH( query VARCHAR2, models SEM_MODELS, rulebases SEM_RULEBASES, aliases SEM_ALIASES, filter VARCHAR2, index_status VARCHAR2, -The filter attribute identifies any additional selection criteria. options VARCHAR2 ) should be a string in the form of a - If this attribute is not null, it RETURN ANYDATASET; WHERE clause without the WHERE keyword. - For example: '(h >= 6)' to limit the result to cases where the height of the grandfather's grandchild is 6 or greater PalGov © 2011 35
  • 36. SEM_MATCH Table Function Arguments SEM_MATCH( index_status attribute lets you query semantic data even - The when the relevant entailment does not have a valid status. query- VARCHAR2, the query returns an error if the entailment If this attribute is null, modelsdoes not have a valid status. If this attribute is not null, it must be SEM_MODELS, the string INCOMPLETE or INVALID. rulebases SEM_RULEBASES, precomputed triples that - An Entailment is an object containing can be inferred from applying a specified set of rulebases to a aliases SEM_ALIASES, specified set of models. filter VARCHAR2, index_status VARCHAR2, options VARCHAR2 ) RETURN ANYDATASET; PalGov © 2011 36
  • 37. SEM_MATCH Table Function Arguments SEM_MATCH( query VARCHAR2, models SEM_MODELS, rulebases SEM_RULEBASES, aliases options attribute identifies options that can affect - The SEM_ALIASES, the results of queries. filter VARCHAR2, as keyword-value pairs. - Options are expressed index_status VARCHAR2, options VARCHAR2 ) RETURN ANYDATASET; PalGov © 2011 37
  • 38. SEM_MATCH Table Function Arguments SEM_MATCH( query VARCHAR2, models SEM_MODELS, - For more details about using the SEM_MATCH rulebases SEM_RULEBASES, consult Function and the its different arguments, Oracle Semantic Technologies Developer’s Guide: aliases SEM_ALIASES, http://www.oracle.com/technetwork/database/options/semantic -tech/documentation-087054.html filter VARCHAR2, index_status VARCHAR2, SEM_MATCH DOSUMENTATION: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e25609/sdo_rdf_concepts.htm#CHDJACII options VARCHAR2 ) RETURN ANYDATASET; PalGov © 2011 38
  • 39. Examples 2007 Sicko Michael Moore directedBy M1 D1 Emmy Awards P1 1995 M2 2009 Capitalism C1 USA 1995 Washington DC directedBy M3 D2 actedIn P2 Oscars Brave Heart Mel Gibson 1996 2007 Nadine Labaki directedBy M4 D3 C2 Lebanon actedIn Beirut Caramel location name P3 Stockholm Festival Exercises: C3 Sweden 2007 (1) What is the name of director D3? Stockholm (2) What is the name of the director of the movie M1? (3) List all the movies who have directors from the USA and their directors. (4) List all the names of the directors from Lebanon who have won prizes and the prizes they have won. PalGov © 2011 39
  • 40. Examples • Q1: What is the name of director D3? Select directorName From Table( SEM_MATCH( ‘SELECT ?directorName WHERE {:D3 :name ?directorName}’, SEM_MODELS(‘movies_model’), null, null, null, null, null) ) ); PalGov © 2011 40
  • 41. Examples • Q2: What is the name of the director of the movie M1? Select directorName From Table( SEM_MATCH( ‘SELECT ?directorName WHERE{ :M1 :directedBy ?director . ?director :name ?directorName}’, SEM_MODELS(‘movies_model’), null, null, null, null, null) ) ); PalGov © 2011 41
  • 42. Examples • Q3: List all the movies who have directors from the USA and their directors. Select movie, director From Table( SEM_MATCH( ‘Select ?movie ?director Where {?movie :directedBy ?director. ?director :country ?country. ?country :name ‘USA’}’ , SEM_MODELS(‘movies_model’), null, null, null, null, null) ) ); PalGov © 2011 42
  • 43. Examples • Q4: List all the names of the directors from Lebanon who have won prizes and the prizes they have won. Select directorName, prize From Table( SEM_MATCH( ‘Select ?directorName ?prize Where { ?director :name ?directorName. ?director :country ?c. ?c :name ‘Lebanon’. ?director :hasWonPrizeIn ?prize}’, SEM_MODELS(‘movies_model’), null, null, null, null, null) )); PalGov © 2011 43
  • 44. Data Integration and Open Information Systems (Tutorial II) The Palestinian e-Government Academy January, 2012 Tutorial II: Data Integration and Open Information Systems Practical Session PalGov © 2011 44
  • 45. Practical Session PART1: Given the previous movies example and the accompanying four queries, do the following: (1) Write the data graph using any suitable RDF syntax (N3, or Turtle). Note: Avoid using XML syntax as it might need additional effort to bulk-load. (2) Bulk Load your RDF file into Oracle. (3) Write the four queries accompanying the example using the SEM_MATCH function and execute them over the bulk-loaded file. PART2: Given the RDF graph of Practical Session I and II (also included in the next slide), do the following: (1) Write the data graph using any suitable RDF syntax (N3, or Turtle) and bulk- load it into Oracle. (2) Write the following queries using the SEM_MATCH function and execute them over the bulk-loaded file: • List all the authors born in a country which has the name Palestine. • List the names of all authors with the name of their affiliation who are born in a country whose capital‟s population is14M. Note that the author must have an affiliation. • List the names of all books whose authors are born in Lebanon along with the name of the author. PalGov © 2011 45
  • 46. Practical Session Palestine 7.6K Said Capital Name CN1 CA1 Jerusalem AU1 BK1 CU Colombia University Author Viswanathan 14.0M BK2 AU2 India Capital Name New Delhi Wamadat CN2 CA2 Name Author Naima BK3 AU3 Lebanon 2.0M The Prophet Gibran CN3 CA3 BK4 Beirut Author AU4 This data graph is about books. It talks about four books (BK1-BK4). Information recorded about a book includes data such as; its author, affiliation, country of birth including its capital and the population of its capital. PalGov © 2011 46
  • 47. Practical Session - Instructions • Each student should work alone. • In part 2 of this practical session, the student is strongly recommended to write two additional queries, execute them on the data graph, and hand them along with the required queries. • In part 2 of this practical session, the student is encouraged to compare the results of the queries with those from Practical Session I and II. • Each student must expect to present and discuss his/her queries at class and compare them with the work of other students. • The final delivery should include for every part of the practical session: (i) A link to the RDF file, (ii) a snapshot of the table where the file was bulk-loaded, (iii) A snapshot of every query and its results. These must all be delivered in a report form in PDF format. PalGov © 2011 47
  • 48. References • http://www.oracle.com • Anton Deik, Bilal Faraj, Ala Hawash, Mustafa Jarrar: Towards Query Optimization for the Data Web - Two Disk-Based algorithms: Trace Equivalence and Bisimilarity. PalGov © 2011 48
  • 49. Thank you! PalGov © 2011 49