4 Replies Latest reply on Dec 7, 2010 6:38 PM by alwu-Oracle

    Unknown namespace prefix Error - when using custom Aliases with RDF aliases

    821322
      I am getting unknown namespace prefix error when I use custome SEM_ALIAS with rdf SEM_ALIAS. It seems once you specify custom SEM_ALIAS, the default rdf alias is not recognized. Following are the details of queries

      I have a sem_Model "test" which has "event" as a class and "Merger" as a sub-class of event, with "acquiringorg" as a property having the domain "org". "Org" is also defined as a class with the literal attribute "hasname". I have added one instance of "merger" class with appropriate values for "acquiringorg" property. There is one instance or "Org" as well for reference in the instance above.

      the following query(return all objects having property "acquiringorg" and its .e. "hasName" attribute for the object) runs fine and returns appropriate resultset

      select x event,z acquiringorg ,l acquireeorg from table(SEM_MATCH(
      '(?x Evnt:AcquiringOrg ?y)(?k orgn:hasName ?l)',
      SEM_MODELS('test'),
      null,
      SEM_ALIASES(SEM_ALIAS('Evnt','http://www.abc.com/Event/Merger/'),
      SEM_ALIAS('orgn','http://www.abc.com/Org/')),
      null));

      However when I want to add another criteria i.e. show me events of type merger(?x rdf:type :Merger) , the query fails with the "unknown namespace prefix error" as above

      select x event,z acquiringorg ,l acquireeorg from table(SEM_MATCH(
      '(?x rdf:type :Merger)(?x Evnt:AcquiringOrg ?y)(?k orgn:hasName ?l)',
      SEM_MODELS('test'),
      null,
      SEM_ALIASES(SEM_ALIAS('Evnt','http://www.abc.com/Event/Merger/'),
      SEM_ALIAS('orgn','http://www.abc.com/Org/')),
      null));

      specifying "rdf" ALIAS explicitly also does not work

      select x event,z acquiringorg ,l acquireeorg from table(SEM_MATCH(
      '(?x rdf:type :Merger)(?x Evnt:AcquiringOrg ?y)(?k orgn:hasName ?l)',
      SEM_MODELS('test'),
      null,
      SEM_ALIASES(_SEM_ALIAS('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'),_
      SEM_ALIAS('Evnt','http://www.abc.com/Event/Merger/'),
      SEM_ALIAS('orgn','http://www.abc.com/Org/')),
      null));

      I am unable to figure out why default namespace i.e. rdf is returning this error

      Stuck at this point badly!!Any pointers would be useful!!
        • 1. Re: Unknown namespace prefix Error - when using custom Aliases with RDF aliases
          821322
          Full error details are as below

          ORA-29532: Java call terminated by uncaught Java exception: oracle.spatial.rdf.server.ParseException: Unknown namespace prefix ''
          ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 153
          ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 842
          ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 235
          ORA-06512: at line 1
          29532. 00000 - "Java call terminated by uncaught Java exception: %s"
          *Cause:    A Java exception or error was signaled and could not be
          resolved by the Java code.
          *Action:   Modify Java code, if this behavior is not intended.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
          • 2. Re: Unknown namespace prefix Error - when using custom Aliases with RDF aliases
            alwu-Oracle
            Hi,

            I think you missed a SEM_ALIAS('','http://www.abc.com/Event/Merger/') in your query.

            A small test below.

            create table tq_tpl(triple sdo_rdf_triple_s) compress;
            exec sem_apis.create_sem_model('tq','tq_tpl','triple');

            insert into tq_tpl values(sdo_rdf_triple_s('tq','<urn:x>','<http://www.abc.com/Event/Merger/AcquiringOrg>','<urn:y>'));
            insert into tq_tpl values(sdo_rdf_triple_s('tq','<urn:k>','<http://www.abc.com/Org/hasName>','<urn:n>'));
            insert into tq_tpl values(sdo_rdf_triple_s('tq','<urn:x>','<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>','<http://www.abc.com/Event/Merger/Merger>'));

            select x event,y acquiringorg ,l acquireeorg from table(SEM_MATCH(
            '(?x Evnt:AcquiringOrg ?y)(?k orgn:hasName ?l)',
            SEM_MODELS('tq'),
            null,
            SEM_ALIASES(SEM_ALIAS('Evnt','http://www.abc.com/Event/Merger/'),
            SEM_ALIAS('orgn','http://www.abc.com/Org/')),
            null));
            ==>
            urn:x
            urn:y
            urn:n



            select x event,y acquiringorg ,l acquireeorg from table(SEM_MATCH(
            '(?x rdf:type :Merger)(?x Evnt:AcquiringOrg ?y)(?k orgn:hasName ?l)',
            SEM_MODELS('tq'),
            null,
            SEM_ALIASES(SEM_ALIAS('Evnt','http://www.abc.com/Event/Merger/'),
            SEM_ALIAS('orgn','http://www.abc.com/Org/'),
            SEM_ALIAS('','http://www.abc.com/Event/Merger/')),
            null));
            ==>
            same answer.

            Thanks,

            Zhe Wu
            • 3. Re: Unknown namespace prefix Error - when using custom Aliases with RDF aliases
              821322
              I guess you meant SEM_ALIAS('','http://www.abc.com/Event/'). It works with this.

              Is there any developer book available for Semantic implementation in Oracle(apart from the online version available )

              Thanks a lot.
              • 4. Re: Unknown namespace prefix Error - when using custom Aliases with RDF aliases
                alwu-Oracle
                Hi,

                We have dev guide at
                http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11828/toc.htm

                and some training materials at
                http://www.oracle.com/technetwork/database/options/semantic-tech/semtech-training-100336.html

                and presentations at
                http://www.oracle.com/technetwork/database/options/semantic-tech/events-082086.html

                Thanks,

                Zhe Wu