I am trying the same scenario which Oracle Semantics Web documentation has listed for querying Cancer Ontology. Below are the steps which I have followed.
1). Created a tablespace.
CREATE TABLESPACE rdf_tblspace
DATAFILE 'C:\app\swagh\oradata\orcl\rdf_tblspace.dat' SIZE 1024M REUSE;
2). Created a semantic data network.
EXECUTE SEM_APIS.CREATE_SEM_NETWORK('rdf_tblspace');
3). Created a application table for storing triples.
CREATE TABLE articles_rdf_data (id NUMBER, triple SDO_RDF_TRIPLE_S);
4). Creted a semantic model.
EXECUTE SEM_APIS.CREATE_SEM_MODEL('articles', 'articles_rdf_data', 'triple');
5). Inserted Cancer Ontology data into semantic model.
INSERT INTO articles_rdf_data VALUES (1,
SDO_RDF_TRIPLE_S ('articles','Immunodeficiency-Syndrome',
'http://www.w3.org/2000/01/rdf-schema#subClassOf',
'Immune_System_Disorder'));
INSERT INTO articles_rdf_data VALUES (2,
SDO_RDF_TRIPLE_S ('articles','T_Cell_Immunodeficiency',
'http://www.w3.org/2000/01/rdf-schema#subClassOf',
'Immunodeficiency-Syndrome'));
INSERT INTO articles_rdf_data VALUES (3,
SDO_RDF_TRIPLE_S ('articles','AIDS',
'http://www.w3.org/2000/01/rdf-schema#subClassOf',
'T_Cell_Immunodeficiency'));
6). Created a patient table and inserted a record with following values in it.
CREATE TABLE patients (id INT, diagnosis VARCHAR2(100));
INSERT INTO patients VALUES (1,'AIDS');
7). Executed a ontology based semantic query.
SELECT diagnosis FROM patients
WHERE SEM_RELATED (diagnosis,
'http://www.w3.org/2000/01/rdf-schema#subClassOf',
'http://www.example.org/medical_terms/Immune_System_Disorder',
sem_models('articles'), null) = 1;
This query should return AIDS
as diagnosis value, as AIDS
is subclass of T_Cell_Immunodeficiency
which in turn subclass of Immunodeficiency-Syndrome
and Immune_System_Disorder
classes, whereas it does not return anything.
Am I missing anything here?