0

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?

Jonas
  • 6,915
  • 8
  • 35
  • 53
  • I'm not familiar with this Oracle functionality but I can see the namespace of your classes only in your query. Can you double check that the stored namespace matches the query? – Ignazio May 23 '17 at 08:00
  • Also, probably, you have to enable [inferencing](http://docs.oracle.com/cd/B28359_01/appdev.111/b28397/owl_concepts.htm#RDFRM618). Try to write `sem_rulebases('owlprime')` instead of `null` in 7. – Stanislav Kralin May 23 '17 at 08:34
  • Hi Stanislav, Thanks for your reply. If I try to add inferencing by adding sem_rulebases('owlprime') instead of null, it gives me a error message saying that "ORA-55456: no valid rules index for this model-rulebase combination". However, Oracle documentation has provided a script to create an index which is as follows. – sachinwagh17 May 23 '17 at 09:18
  • CREATE INDEX diagnosis_sem_idx ON patients (diagnosis) INDEXTYPE IS MDSYS.SEM_INDEXTYPE('ONTOLOGY_MODEL(medical_ontology), RULEBASE(OWLPrime)'); But, unfortunately this script doesn't work and has syntax error. Moreover, I resolved the above issue by creating an entailment, but still the query does not return anything. – sachinwagh17 May 23 '17 at 09:19
  • Well, try to make a query that does not rely on transitivity of `subclassOf`. Is this query successfull? – Stanislav Kralin May 23 '17 at 09:53

0 Answers0