Previous topic  Top  Next topic  Print this Topic
 

Importing Oracle RDF

 

You can access RDF Data saved to the Oracle database. The mapping rules, which are created by import, define concept_/2, directsub_/3, directisa_/3, directatttype_/6, representation_/4, documentation_/4 and att_/4. RDF Data are shown in OntoStudio as classes, properties, and so on.

 

Oracle RDF Database Example

1.Create a tablespace for RDF Data:

CREATE TABLESPACE rdftblspace

DATAFILE '/oradata/orcl/rdftblspace.dat' SIZE 1024M REUSE

AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED

SEGMENT SPACE MANAGEMENT AUTO;

 

2.Create an Oracle RDF Network (Oracle 10g) or a semantic data network (Oracle 11g):

Oracle 10g:

EXECUTE SDO_RDF.CREATE_RDF_NETWORK('rdftblspace');

Oracle 11g:

EXECUTE SEM_APIS.CREATE_SEM_NETWORK('rdftblspace');

3.Create a table for RDF Data (the column with data type SDO_RDF_TRIPLE_S  will be used for RDF Data):

CREATE TABLE rdftblname(id NUMBER, triple SDO_RDF_TRIPLE_S);

 

4.Create an RDF Model:

Oracle 10g:

EXECUTE SDO_RDF.CREATE_RDF_MODEL('modelname', 'rdftblname', 'triple');

Oracle 11g:

EXECUTE SEM_APIS.CREATE_SEM_MODEL('modelname', 'rdftblname', 'triple');

 

5.Insert RDF Data into the table:

Classes:

INSERT INTO rdftblname VALUES (1,

  sdo_rdf_triple_s ('modelname','http://a.b.c/Concept1',

    'http://www.w3.org/1999/02/22-rdf-syntax-

ns#type','http://www.w3.org/2000/01/rdf-schema#Class'));

 

INSERT INTO rdftblname VALUES (2,

  sdo_rdf_triple_s ('modelname','http://a.b.c/Concept2',

    'http://www.w3.org/1999/02/22-rdf-syntax-

ns#type','http://www.w3.org/2000/01/rdf-schema#Class'));

 
Directsub_/3:

INSERT INTO rdftblname VALUES (3,

  sdo_rdf_triple_s ('modelname','http://a.b.c/Concept3',

    'http://www.w3.org/2000/01/rdf-schema#subClassOf','http://a.b.c/Concept1'));

 

INSERT INTO rdftblname VALUES (4,

  sdo_rdf_triple_s ('modelname','http://a.b.c/Concept4',

    'http://www.w3.org/2000/01/rdf-schema#subClassOf','http://a.b.c/Concept2'));

 

Directatttype_/6:  

INSERT INTO rdftblname VALUES (5,

  sdo_rdf_triple_s ('modelname','http://a.b.c/relation1',

    'http://www.w3.org/1999/02/22-rdf-syntax-

ns#type','http://www.w3.org/1999/02/22-rdf-syntax-ns#Property'));

 

INSERT INTO rdftblname VALUES (6,

  sdo_rdf_triple_s ('modelname','http://a.b.c/relation1',

    'http://www.w3.org/2000/01/rdf-schema#domain','http://a.b.c/Concept1'));

 

INSERT INTO rdftblname VALUES (7,

  sdo_rdf_triple_s ('modelname','http://a.b.c/relation1',

    'http://www.w3.org/2000/01/rdf-schema#range','http://a.b.c/Concept2'));

 
Directisa_/3:  

INSERT INTO rdftblname VALUES (8,

  sdo_rdf_triple_s ('modelname','http://a.b.c/instance1',

    'http://www.w3.org/1999/02/22-rdf-syntax-ns#type','http://a.b.c/Concept1'));

   
Representation_/4:

INSERT INTO rdftblname VALUES (9,

  sdo_rdf_triple_s ('modelname','http://a.b.c/Concept1',

    'http://www.w3.org/2000/01/rdf-schema#label','"testlabel"'));

   
Documentation_/4:

INSERT INTO rdftblname VALUES (10,

  sdo_rdf_triple_s ('modelname','http://a.b.c/Concept1',

    'http://www.w3.org/2000/01/rdf-schema#comment','docu'));

   
Att_/4:  

INSERT INTO rdftblname VALUES (11,

  sdo_rdf_triple_s ('modelname','http://a.b.c/instance1',

    'http://a.b.c/relation1','instvalue1'));

 
You can find the full Oracle RDF Documentation with examples on the Oracle Home Page:
Oracle 10g: http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b19307/sdo_rdf_concepts.htm#CIHDIBDE
Oracle 11g: http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28397/sdo_rdf_concepts.htm#CHDJBDHF

 

OntoConfig Settings

To use the Oracle RDF Import with OntoStudio, set the OntoConfig parameters to the following:

ConceptNamesGround = off
useQueriesOnly = on

To use the Oracle RDF access in OntoBroker:

ConceptNamesGround = off