8 Replies Latest reply: Mar 14, 2014 3:01 PM by Matperry-Oracle RSS

    How to use SEM_DISTANCE

    HansC

      Oracle 12c RDF developer manual at bottom of Pg. 130 has a SQL like below,

       

      SELECT diagnosis, SEM_DISTANCE(123) 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('medical_ontology'), sem_rulebases('owlprime'), 123) = 1

      WHERE SEM_DISTANCE(123) <= 3;

       

      Is there something wrong as there are two where there?

       

      If I change to

       

      SELECT diagnosis, SEM_DISTANCE(123) 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('medical_ontology'), sem_rulebases('owlprime'), 123) = 1

      and SEM_DISTANCE(123) <= 3;

       

      It gives error, ora-13199 SQLERRM=User defined exception ora-06512 at "MDSYS.SDO_Operator", line 429.

       

      What is the right way to use sem_distance?