How to use SEM_RELATED & SEM_MATCH in a single query

Hi,
I am trying to combine RDF and RDBMS data using SEM_RELATED.
Below sample is working fine but the requirement is i have to add few more conditions in SEM_MATCH
Please suggest me how to combine sem_match and sem_related in a single query.
Please provide me the example which use SEM_MATCH and SEM_RELATED in a single query.
SELECT distinct dg_term_property.CONTEXT_NM FROM dg_term_property,dg_term
WHERE SEM_RELATED ('<http://www.cs.com/mdm/data_glossary#Facilities>',
'<http://www.w3.org/2000/01/rdf-schema#subClassOf>',
'<http://www.cs.com/mdm/data_glossary#Reference_Data_Classes>',
sem_models('GSR_PR_CURR'), sem_rulebases('owlprime')) = 1
and DG_TERM.TERM_NM=DG_TERM_PROPERTY.TERM_NM;
Let me know if you need any other details.
Regards,
Kavitha.

Hi Kavitha,
I am not sure what exactly you are trying to accomplish with this query but the use of the SEM_RELATED is incorrect. To fulfill your requirement most likely you may not even need to combine SEM_RELATED with SEM_MATCH. Actually those two are not built to be used together.
Take a look at the SEM_RELATED documentation and see if you can use it to get the results you need. The example that you are providing is not using the SEM_RELATED correctly.
Here is the documentation:
http://docs.oracle.com/cd/E11882_01/appdev.112/e25609/owl_concepts.htm#CHDJBGFI
Go to:
2.3 Using Semantic Operators to Query Relational Data
Regards!
Jorge
Edited by: jbarba on Aug 20, 2012 10:20 AM
Edited by: jbarba on Aug 20, 2012 10:21 AM

Similar Messages

  • How to use multiple aggregate functions in single query

    hi to all
    The output will be giving first_name,last_name,max(salary),min(salary) and the output will be department wise.From employees table in single query
    output will be:
    first_name|last_name|max(salary)|min(salary)

    SELECT first_name||' '||last_name as ename,
           MIN(sal) KEEP (DENSE_RANK FIRST ORDER BY sal) OVER (PARTITION BY deptno) "Lowest",
           MAX(sal) KEEP (DENSE_RANK LAST ORDER BY sal) OVER (PARTITION BY deptno) "Highest"
    FROM   emp
    ORDER BY deptno, sal;Edited by: Ramio on Jan 10, 2012 10:43 PM

  • How to use Mulitple DAQs with a single triggered event on only one of the DAQs

    I have three PXI6115 and would like to tie all these to a single triggered event on one of the DAQs. I've scaned the examples and any assistance would be greatly appreciated....

    TCjr,
    Please refer to your other post:
    How to use Multiple DAQs with a single triggered event on only one of the DAQs

  • How to use multiple tape drive for single filesystem on single client.

    Hello All.
    I want to backup single filesystem with multiple tape drive.
    Incase of Symantec veritas netbackup "NEW_STREAM" for multi-stream backup.
    Backup client has a  single backup filesystem like /data1  directory with 4 LTO6 drives.
    /data1 directory doesn't have a sub-direcotry, just present a files.
    If /data1 directory has a sub-directory like /data1/aaa, /data1/bbb, /data1/ccc , Is it possible to use multiple drives?
    Please anybody answer the questions.
    Thanks advanced.

    See how to use multiple tape drive from single client when I want to backup single filesystem?

  • How to insert multiple records in a single query

    Dear all,
    Can you please tell
    how to insert multiple records in a single query ??

    INSERT INTO table_name (column_1, column_2) VALUES ('value_A', 'value_B')OR
    INSERT INTO table_name
    (column_1, column_2)
    SELECT 'value_A', 'value_B' FROM DUAL
    UNION ALL
    SELECT 'value_C', 'value_D' FROM DUAL
    ;Edited by: Benton on Nov 9, 2010 1:59 PM

  • How to use multiple hierarchies for a single char in single query

    Hi,
    Is there any way that we can use multiple hierarchies for a single char in single query. I tried and it just allows me to select one hierarchy even if I use hierarchy variable.
    I have a requirement where user wants to see information related to a cost center with different cost center groups in different hierarchies (every year has different cost center group hierarchies).
    Suppose I want to see information related to a cost center from year 2001-2004.in these four year cost center may have been associated to different groups depending upon that year hierarchy. How can I do that?
    Thanks
    Jona

    Nope. Now way to do this.
    There is always just one hierarchy assigned to a characteristic. And even if the hierarchy was time dependent, it only reads it for one key date and not according to transaction data.
    Regards,
    Beat

  • How to use multiple tape drive from single client when I want to backup single filesystem?

    Hello All.
    I want to backup 1 filesystem using 4 tape drives for reducing backup time.
    In case of symantec veritas netbackup, they can user "NEW_STREAM" for multi-streaming backup.
    Please anybody let me know that how to do use multiple tape drive for single client.
    1. Backup Source server : Linux (1 client)
    2. Backup Soucre :      /data1  (500GB)
        -> Current directory structure doesn't have sub directory under /data1, just files present under /data1
    If direcotry struceture has a sub-direcotry like( /data1/aaa, /data1/bbb ), Is it availble to use multiple tape drives?
    3. Tape Drive with OSB : LTO6 * 4 drives
    Thank you.

    You would have to create a different dataset for each sub-folder. If you only have files at the top level folder then even the NEW_STREAM option couldn't be used to split the job.
    Organise it into folders and then create datasets in a client folder such as :
    /usr/local/oracle/backup/admin/config/dataset/Linux/data1_aaa
    /usr/local/oracle/backup/admin/config/dataset/Linux/data1_bbb
    Then in the schedule you just specify the Linux folder. In each dataset you list the hostname and the folder name, such as :
    include host Linux
    include path /data1/aaa
    Now it will create a new job for each dataset and therefore each folder.
    Thanks
    Rich

  • How to use IF ELSE statement in one QUERY to MS ACCESS

    System.out.println("Enter Final Exam: ");
    int f = Integer.parseInt(input.readLine());
    command.executeUpdate("UPDATE Students SET Final_Exam='"+f+"',Raw_score=(QT+MT+Final_Exam)/3 WHERE stud_name='"+stdID+"'");
    command.executeUpdate("UPDATE Students SET Raw_score=(QT+MT+Final_Exam)/3 WHERE stud_ID='"+stdID+"'");
    if (rsf==100)
    command.executeUpdate("UPDATE Students SET Final_Grade=1.0 WHERE stud_ID='"+stdID+"'");
    else if(rsf < 100 && rsf > 90)
    command.executeUpdate("UPDATE Students SET Final_Grade=2.0 WHERE stud_ID='"+stdID+"'");
    else
    command.executeUpdate("UPDATE Students SET Final_Grade=5.0 WHERE stud_ID='"+stdID+"'");How can I shorten my code using a IF ELSE statement inside a single query or two? Or is it possible?
    Edited by: ivatanako on Sep 28, 2007 11:55 PM

    Sun has tutorial trail for JDBC, you might want to browse through that; you'll get more details and samples there than here. Here's the link to the section on PreparedStatement: http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • Tricky SQL query... how to get all data in a single query?

    create table employee_definition (def_id number, def_name varchar(50));
    insert into employee_definition values (100, 'EMAIL');
    insert into employee_definition values (200, 'MOBILE_PHONE');
    insert into employee_definition values (300, 'HOME_PHONE');
    SQL> select * from employee_definition;
        DEF_ID DEF_NAME
           100 EMAIL
           200 MOBILE_PHONE
           300 HOME_PHONE
    create table employee_data (def_id number, def_value varchar(20), emp_id number);
    insert into employee_data values (100, '[email protected]', 123);
    insert into employee_data values (200, '01232222', 123);
    insert into employee_data values (300, '5555', 123);
    insert into employee_data values (100, '[email protected]', 666);
    insert into employee_data values (200, '888', 666);
    insert into employee_data values (300, '999', 666);
    insert into employee_data values (300, '444', 777);
    SQL> select * from employee_data;
        DEF_ID DEF_VALUE                EMP_ID
           100 [email protected]              123
           200 01232222                    123
           300 5555                        123
           100 [email protected]              666
           200 888                         666
           300 999                         666
           300 999                         777
    7 rows selected.I'm supposed to create a SQL that will return me the email, mobile_phone, and home_phone for a set of employees. The result will be something like this:
    EMPLOYEE ID | HOME_PHONE | MOBILE_PHONE | EMAIL
    123         |  5555  |    01232222      | [email protected]
    666         |  999  |    888      | [email protected]
    777         |  444  |    null     | nullThe thing I'm finding difficulty here is that the same column is used to store different values, based on the value in employee_definition table (something like a key/value pair). If I do:
    SQL> select emp_id, def_value as email from employee_data, employee_definition
      2  where employee_data.def_id = employee_definition.def_id
      3  and employee_definition.def_name = 'EMAIL';
        EMP_ID EMAIL
           123 [email protected]
           666 [email protected]'s partially ok.. I'm just getting the definition for 'EMAIL'. But how can I get all the values in a single query, knowing that the column stores different values based on def_name?

    Oh no, not again.
    Entity attribute models always seem like a great idea to people who have been in the profession for five minutes and lack any kind of fundamental knowledge.
    It staggers me that someone with 2,345 posts still believes "you need a 'detail table' for [storing multiple telephone numbers]"
    "A person can have multiple telephone numbers" is not an excuse to build a tired person_attribute table. Niether is the bizarre proposal by someone with over 4k posts who should know better in an earlier post that EAV models are necessary to support temporal fidelity.
    Taken to it's logical conclusion, EAV modelling leads to just two application tables. THINGS and THING_ATTRIBUTES. And when you consider that a THING_ATTRIBUTE is also a THING, why not roll those two tables up into one also? Hmmm, what does THINGS and THING_ATTRIBUTES look like? I know, TABLES and COLUMNS. Who would've guessed? SQL already provides the completely flexible extensible attribute model the advocates of EAV proscribe. But it also has data types, physical data independence, constraints and an efficient query language which EAV does not.
    EAV modelling errodes the semantics of the attributes which are bundled into the "attribute" table.
    There is no point in storing 12 different phone numbers with implied functional dependency to unconstrained and often repeating notional attributes like "MOBILE", "LANDLINE", "WORK", err, "WORK2", err, "MOBILE2", err, ... when this phone type attribute has no semantic value. When you want to call someone, you invariably want to retrive the prefered_phone_number which may depend on a time of day, or a call context.
    These things need to be modelled properly (i.e normalised to BCNF) within the context of the database.

  • How to find Special Characters in a single query

    Dear Experts,
    Your usual help is required to solve the query.My query is "How to find all special characters like (%$*&@,;'/+- etc. in a single query?"
    Thanks.
    e.g.
    A_MIR
    A%SIM
    A*SIM
    A)SIM

    Hi,
    947459 wrote:
    Dear Experts,
    Your usual help is required to solve the query.My query is "How to find all special characters like (%$*&@,;'/+- etc. in a single query?"
    Thanks.
    e.g.
    A_MIR
    A%SIM
    A*SIM
    A)SIMIt's not clear what you want.
    What are "special characters"? Can you list all of them?
    Do you want to find rows where string_column contains any of the special characters? If so
    SELECT     string_column
    FROM     table_x
    WHERE     string_column     != NVL ( TRANSLATE ( string_column
                                        , 'A(%$*&@,;'/+-'
                                , 'A'
                          , 'A'
    ;I assume 'A' is not a special character.
    You could also use regular expressions, but it will be more efficient if you don't use them unless you really need to.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    You'll get better replies sooner if you always include this information whenever you have a question.

  • How to Use separate web template to a query, when default one is configured

    Hi,
       A default template is configured in SPRO. and all the queries display data using this template. Now I want to display a particular query result in a separed template that is customised to suit the need.
    how can I achieve it? When I customise template and attach query to it, it displays the result in this template, when executed from WAD. If I execute from Bex, The result is automatically displayed in the default template mensioned in SPRO.
    Please advise.

    If you want this template to be attached to this query alone - then you will have to have the same as a separate iView on portal.. when you execute from BEx the default template will get executed and by changing the default template all the queries will start using the default template... it is not possible for you to specify the template to be used when executing queries from BEx Query designer..

  • How to Use the Procedures in a Sql Query

    Hi Friends,
    Can anyone help me out whether can we use the procedure in the sql query..
    if yes help me out with an example
    my requirement is
    i have one sql query .. in which i need to use the procedure which returns multiple values... how can i overcome it,can anyone help me out for this..
    for your reference i am pasting the sql query
    SELECT paf.person_id
    FROM per_all_assignments_f paf START WITH paf.person_id = p_person_id
    AND paf.primary_flag = 'Y'
    AND paf.assignment_type IN('E', 'C')
    AND l_effective_date BETWEEN paf.effective_start_date
    AND paf.effective_end_date
    CONNECT BY PRIOR paf.supervisor_id = paf.person_id
    AND paf.primary_flag = 'Y'
    AND paf.assignment_type IN('E', 'C')
    AND l_effective_date BETWEEN paf.effective_start_date
    AND paf.effective_end_date
    and paf.person_id not in (>>>I HAVE TO USE THE PROCEDURE HERE<<<<);
    Thanks in advance

    We never saw your procedure, but maybe you could wrap it in a function
    SQL> create or replace procedure get_members(in_something IN number, out_members OUT sys_refcursor)
    is
    begin
      open out_members for
        'select level member_id from dual connect by level <= :num' using in_something;
    end get_members;
    Procedure created.
    SQL> create or replace type numbers as table of number;
    Type created.
    SQL> create or replace function members(in_something IN number)
    return numbers
    as
      member_cur sys_refcursor;
      members numbers;
    begin
      get_members(in_something, member_cur);
      fetch member_cur bulk collect into members;
      close member_cur;
      return members;
    end;
    Function created.
    SQL> select * from  table(members(4));
    COLUMN_VALUE
               1
               2
               3
               4
    4 rows selected.Variant on same using piplined function
    SQL> create or replace function members_piped(in_something IN number)
    return numbers pipelined
    as
      member_cur sys_refcursor;
      rec number;
    begin
      get_members(in_something, member_cur);
      loop
         fetch member_cur into rec;
         exit when member_cur%notfound;
         pipe row(rec);
      end loop;
      close member_cur;
      return;
    end;
    Function created.
    SQL> select * from  table(members_piped(4));
    COLUMN_VALUE
               1
               2
               3
               4
    4 rows selected.
    SQL> drop function members_piped;
    Function dropped.
    SQL> drop function members;
    Function dropped.
    SQL> drop type numbers;
    Type dropped.
    SQL> drop procedure get_members;
    Procedure droppedEdit:
    Sorry Blu, had not seen you already posted similar thing
    Edited by: Peter on Jan 27, 2011 5:38 AM

  • How to use bind variables in the following query

    CREATE OR REPLACE PROCEDURE MMDB.test IS
    sel_qtn VARCHAR2 (10);
    CURSOR PT_QUANTITY IS select * from mmdb.product_tree WHERE QUANTITY_CHECK ='E'
    AND run_id = 100
    a PT_QUANTITY%ROWTYPE;
    BEGIN
    FOR i IN PT_QUANTITY
    loop
    sel_qtn := i.quanttity-1;
    While sel_qtn>=1
    loop
    insert into mmdb.product_tree (BILLING_ACCOUNT_NO ,S_CODE) values (i.BILLING_ACCOUNT_NO ,i.S_CODE||'E');
    sel_qtn :=sel_qtn -1;
    End loop;
    commit;
    end;

    Don't duplicate threads: How to use bind variables in the following query

  • How to use ABAP Class to modify Web Query Result ??

    Hi all !
    We are using Web Templates to display our Query.
    What I would like to do ( and seems a really important issue for our users! ) is to have a "PAGE BREAK" everytime the value of a charateristics change in the report
    For Example :
    -Page 1-
    Division     Project
       A               1
                        2
                        3
    -Page 2-
    Division     Project
       B               1
                        2
                        3
    and so on....
    I read threads about using ABAP CLASS but no example what so ever...
    We are presently under BW 3.1 but are considering upgrading to 7.0 by the end of the year so if there is a solution to my problem on either version i'd like to know.
    If anyone has any information about how I can do this it would be most appreciated
    Thx
    JB.

    Hi Yong,
    Ravi is right, first check the blogs by Jocelyn, and if you still have specific questions you can ask them. I have used ABAP classes in workflow and I know Mike Pokraka tries to use classes exclusively.
    Regards,
    Martin

  • How to use MAX function in SSAS MDX Query

    I want to run this Query with MAX Condition on LAST_DATA_UPDATE Column .

    Hi Ashishsingh,
    According to your description, you want to know how to use MAX function in SQL Server Analysis Services MDX Query, right? In this case, please refer to the link below which describe the syntax and sample of MDX function.
    http://technet.microsoft.com/en-us/library/ms145601.aspx
    http://www.mdxpert.com/Functions/MDXFunction.aspx?f=64
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for