no rows sleteced with SEM_RELATED function
user571093 Dec 4, 2012 1:05 AMhi,
i am excersing the sem_related function sample code in oracle sem tech devloper's guide 11g.2;but got an issue i don't know what's going on in my code. the query is:
SELECT diagnosis FROM patients
WHERE SEM_RELATED(diagnosis,
'rdfs:subClassOf', '<http://www.example.org/cancer/Immune_System_Disorder>', sem_models('cancer'), sem_rulebases('OWLPRIME'))= 1;
but returned no rows for it. i created the table, the rdf table, sem_model, and entailment and inserted a couple of rows. the codes are follows:
create table patients (id number, diagnosis varchar2 (40)) TABLESPACE rdf_tblspace;
insert into patients values(1234, 'Rheumatoid_Arthritis');
insert into patients values(2345, 'Immunodeficiency_Syndrome');
insert into patients values(3456, 'AIDS');
CREATE TABLE CANCER_RDF_DATA (ID NUMBER, TRIPLE SDO_RDF_TRIPLE_S) TABLESPACE rdf_tblspace;
EXEC SEM_APIS.CREATE_SEM_MODEL('cancer', 'CANCER_RDF_DATA', 'TRIPLE');
exec sem_apis.create_entailment('cancer_idx',sem_models('cancer'),sem_rulebases('owlprime')); (sometimes with 'SEM_APIS.REACH_CLOSURE,null,null')
INSERT INTO cancer_rdf_data VALUES (1, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Immune_System_Disorder', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (2, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Autoimmune_Disease', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (3, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Rheumatoid_Arthritis', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (4, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Immunodeficiency_Syndrome', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (5, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/T_Cell_Immunodeficiency', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (6, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/AIDS', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (7, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Autoimmune_Disease', 'http://www.w3.org/2000/01/rdf-schema#subClassOf', 'http://www.example.org/cancer/Immune_System_Disorder'));
INSERT INTO cancer_rdf_data VALUES (8, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Rheumatoid_Arthritis', 'http://www.w3.org/2000/01/rdf-schema#subClassOf', 'http://www.example.org/cancer/Autoimmune_Disease'));
INSERT INTO cancer_rdf_data VALUES (9, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Immunodeficiency_Syndrome', 'http://www.w3.org/2000/01/rdf-schema#subClassOf', 'http://www.example.org/cancer/Immune_System_Disorder'));
INSERT INTO cancer_rdf_data VALUES (10, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/T_Cell_Immunodeficiency', 'http://www.w3.org/2000/01/rdf-schema#subClassOf', 'http://www.example.org/cancer/Immunodeficiency_Syndrome'));
INSERT INTO cancer_rdf_data VALUES (11, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/AIDS', 'http://www.w3.org/2000/01/rdf-schema#subClassOf', 'http://www.example.org/cancer/T_Cell_Immunodeficiency'));
However the query above doesn't give me the expected results like in the tutorial. can anybody tell me what i am missing here. thanks in advance.
kind regards,
hong
i am excersing the sem_related function sample code in oracle sem tech devloper's guide 11g.2;but got an issue i don't know what's going on in my code. the query is:
SELECT diagnosis FROM patients
WHERE SEM_RELATED(diagnosis,
'rdfs:subClassOf', '<http://www.example.org/cancer/Immune_System_Disorder>', sem_models('cancer'), sem_rulebases('OWLPRIME'))= 1;
but returned no rows for it. i created the table, the rdf table, sem_model, and entailment and inserted a couple of rows. the codes are follows:
create table patients (id number, diagnosis varchar2 (40)) TABLESPACE rdf_tblspace;
insert into patients values(1234, 'Rheumatoid_Arthritis');
insert into patients values(2345, 'Immunodeficiency_Syndrome');
insert into patients values(3456, 'AIDS');
CREATE TABLE CANCER_RDF_DATA (ID NUMBER, TRIPLE SDO_RDF_TRIPLE_S) TABLESPACE rdf_tblspace;
EXEC SEM_APIS.CREATE_SEM_MODEL('cancer', 'CANCER_RDF_DATA', 'TRIPLE');
exec sem_apis.create_entailment('cancer_idx',sem_models('cancer'),sem_rulebases('owlprime')); (sometimes with 'SEM_APIS.REACH_CLOSURE,null,null')
INSERT INTO cancer_rdf_data VALUES (1, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Immune_System_Disorder', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (2, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Autoimmune_Disease', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (3, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Rheumatoid_Arthritis', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (4, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Immunodeficiency_Syndrome', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (5, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/T_Cell_Immunodeficiency', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (6, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/AIDS', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/2000/01/rdf-schema#Class'));
INSERT INTO cancer_rdf_data VALUES (7, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Autoimmune_Disease', 'http://www.w3.org/2000/01/rdf-schema#subClassOf', 'http://www.example.org/cancer/Immune_System_Disorder'));
INSERT INTO cancer_rdf_data VALUES (8, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Rheumatoid_Arthritis', 'http://www.w3.org/2000/01/rdf-schema#subClassOf', 'http://www.example.org/cancer/Autoimmune_Disease'));
INSERT INTO cancer_rdf_data VALUES (9, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/Immunodeficiency_Syndrome', 'http://www.w3.org/2000/01/rdf-schema#subClassOf', 'http://www.example.org/cancer/Immune_System_Disorder'));
INSERT INTO cancer_rdf_data VALUES (10, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/T_Cell_Immunodeficiency', 'http://www.w3.org/2000/01/rdf-schema#subClassOf', 'http://www.example.org/cancer/Immunodeficiency_Syndrome'));
INSERT INTO cancer_rdf_data VALUES (11, sdo_rdf_triple_s('cancer', 'http://www.example.org/cancer/AIDS', 'http://www.w3.org/2000/01/rdf-schema#subClassOf', 'http://www.example.org/cancer/T_Cell_Immunodeficiency'));
However the query above doesn't give me the expected results like in the tutorial. can anybody tell me what i am missing here. thanks in advance.
kind regards,
hong