Striving for Optimal Performance
  • Blog
    • Archive
    • Categories
    • Search
  • Troubleshooting Oracle Performance
    • Description
    • Structure
    • Table of Contents
    • Forewords
    • Reviews
    • Downloadable Files
    • Addenda and Errata
    • First Edition
  • Public Appearances
    • Past Public Appearances
  • Contact
  • About

Named Notation and SEM_MATCH Table Function

13 June 2013 4 Comments Written by Christian Antognini

This is a short post about a strange behavior I discovered today…

The fact is that it is not really possible to use the named notation with the SEM_MATCH table function. In fact, even though the parameter’s names can be specified, the order of the parameters overrides the specification done with the named notation!?!

Here is an example:

  • With positional notation everything works as expected
SQL> SELECT count(*)
  2  FROM table(
  3    sem_match('SELECT * WHERE { GRAPH :gCH { ?s ?p ?o } }',
  4              sem_models('SEMDEMO_WORK'),
  5              NULL,
  6              sem_aliases(sem_alias(NULL,'http://www.semwebtech.org/mondial/10/meta#')),
  7              NULL
  8    )
  9  );

  COUNT(*)
----------
       601
  • The named notation seems to be supported… (notice that the parameters are specified in the same order as they are defined in the table function)
SQL> SELECT count(*)
  2  FROM table(
  3    sem_match(query     => 'SELECT * WHERE { GRAPH :gCH { ?s ?p ?o } }',
  4              models    => sem_models('SEMDEMO_WORK'),
  5              rulebases => NULL,
  6              aliases   => sem_aliases(sem_alias(NULL,'http://www.semwebtech.org/mondial/10/meta#')),
  7              filter    => NULL
  8    )
  9  );

  COUNT(*)
----------
       601
  • … but when the parameters are not specified in the same order as they are defined (the RULEBASES and ALIASES parameters were swapped), a PLS-00306 is raised!
SQL> SELECT count(*)
  2  FROM table(
  3    sem_match(query     => 'SELECT * WHERE { GRAPH :gCH { ?s ?p ?o } }',
  4              models    => sem_models('SEMDEMO_WORK'),
  5              aliases   => sem_aliases(sem_alias(NULL,'http://www.semwebtech.org/mondial/10/meta#')),
  6              rulebases => NULL,
  7              filter    => NULL
  8    )
  9  );

SELECT count(*)
*
ERROR at line 1:
ORA-06550: line 4, column 13:
PLS-00306: wrong number or types of arguments in call to 'ODCITABLEDESCRIBE'
ORA-06550: line 4, column 6:
PL/SQL: Statement ignored

As a result, even though using the named notation is better for readability, the order of the parameters cannot be changed! I’m puzzled.

Update 2013-06-21: bug 16996604 (NAMED PARAMETERS DISCARDED BY ODCITABLEDESCRIBE AND PREPARE) was opened to track this issue.

11gR2, Bug, RDF Semantic Graph
ITL Deadlocks (script)
Scripts to Download Oracle Database 12c Release 1 Documentation

4 Comments

  1. Steve C Steve C
    13 June 2013    

    Does the same behavior occur if you go against RDF_MATCH instead of the public synonym SEM_MATCH?

    Reply
    • Christian Antognini Christian Antognini
      14 June 2013    

      Hi Steve

      Yes, same behavior.

      Best,
      Chris

      Reply
      • Steve C Steve C
        14 June 2013    

        I guess at this point I may run this past Zhe Wu in the Oracle Semantic forum. He is very responsive about these sorts of things.

        Reply
        • Christian Antognini Christian Antognini
          18 June 2013    

          Hi Steve

          This is a good idea. But, since the forums are waaaaay too slow right now, I sent him an email.

          Best,
          Chris

          Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.