Missing triples in SEM_MATCH query
Hi,
After loading the LUBM50,0 test data into Oracle 11g and running the sample queries I found some very strange behavior:
Test query 14 for example returns 0 results (should be 393730 result sets - no inferencing is needed).
Most queries work as expected, however in some cases data is not returned from SEM_MATCH (I was not yet able to figure out what really causes this behavior).
This is what I did:
Using Oracle 11gR1 (11.1.0.6.0) on Windows XP
Load the test data (LUBM 50,0) via sqlldr to staging table and bulk load from there to the table used in the semantic model.
The following query produces 0 results:
select x from
table (sem_match('(?x rdf:type ub:UndergraduateStudent)',
sem_models('lubm'),
null,
sem_aliases(sem_alias('ub','http://www.lehigh.edu/%7Ezhp2/2004/0401/univ-bench.owl#')), null));
However, the data is actually contained in the table holding the SDO_RDF_TRIPLE_S.
A query for all triples using SEM_MATCH also returns triples that satisfy this query and should be returned. (Query using '(?o ?p ?s)').
By querying the table containing the semantic references directly also the correct results are returned.
More strangely a query using sem_match like the one above querying for an object of "ub:GraduateStudent" instead of "ub:UndergraduateStudent" also returns (the correct) results.
Moreover, the bulk load contains 6,890,946 triples which is the number of triples contained in the staging table and after bulk loading from there exactly this number is also contained in the table for the semantic model.
However, the query using SEM_MATCH (unrestricted query of '(?o ?p ?s)') which should also return this number of triples only returns 6,657,233 triples (I have not yet checked which triples are missing, but there are more than 200,000 triples gone)
Is there any hint on what I might be doing wrong or how to solve this problem?
Thanks,
Wolfgang
Wolfgang,
I'd suggest downloading the latest patch for 11g (links are posted by Melli in the following thread: Latest Patches for Oracle as suggested by TopBraid and then re-loading and then re-trying the query. Please let us know if that solves the problem.
Thanks,
- Souri.
Similar Messages
-
SEM_MATCH query execution time when a predicate is set as a variable
Hello there,
Our ontology contains 70 million triples (12.5 million asserted triples and 58 million inferred triples). We created a virtual model which includes both asserted and inferred triples).
Our semantic network index configuration is 'PSCM' (index status is valid).
The problem we encounter is when we run a SEM_MATCH query which includes a predicate as a variable, the query ran for 22 seconds. When a similar query is run when the variable is subject or an object or both the time for the SEM_MATCH query execution is 0.2 seconds. Is this reasonable? What do we do wrong?
For example:
1. Predicate as a variable (execution time is 22 seconds):
SELECT a FROM TABLE ( SEM_MATCH
( ' { <http://www.tomproj.com/rep#entity_4> ?a 4 }',
SEM_MODELS( 'TOM_VIRTUAL_MODEL') ,
NULL,
NULL,
NULL,
'ALLOW_DUP=T'));
2. Subject as a variable (execution time is 0.2 seconds):
SELECT a FROM TABLE ( SEM_MATCH
( ' { ?a <http://www.tomproj.com/rep#id> 4 }',
SEM_MODELS( 'TOM_VIRTUAL_MODEL') ,
NULL,
NULL,
NULL,
'ALLOW_DUP=T'));
2. Object as a variable (execution time is 0.2 seconds):
SELECT a FROM TABLE ( SEM_MATCH
( ' { <http://www.tomproj.com/rep/#entity_4> <http://www.tomproj.com/rep#id> a }',
SEM_MODELS( 'TOM_VIRTUAL_MODEL') ,
NULL,
NULL,
NULL,
'ALLOW_DUP=T'));
Cheers,
DoronHi,
So far no lack, None of the solutions are working.
Query execution time didn't change after executing the following:
1. SEM_APIS.DROP_SEM_INDEX('SCP');
2. SEM_APIS.ADD_SEM_INDEX('SCPM');
3. SEM_APIS.ALTER_SEM_INDEX_ON_MODEL('TOM','SCPM','REBUILD');
4. SEM_APIS.ALTER_SEM_INDEX_ON_MODEL('TOM_TF','SCPM','REBUILD');
5. SEM_APIS.ALTER_SEM_INDEX_ON_RULES_INDEX('TOM_RI','SCPM','REBUILD');
My original query (see below) execution time remains 22 secs.
SELECT a FROM TABLE ( SEM_MATCH
( ' { <http://www.tomproj.com/rep#entity_4> ?a 4 }',
SEM_MODELS( 'TOM_VIRTUAL_MODEL') ,
NULL,
NULL,
NULL,
'ALLOW_DUP=T'));
When running the SEM_MATCH on each model ('TOM,'TOM_TF') separately execution time was very fast (~0.007 secs):
1. SELECT a FROM TABLE ( SEM_MATCH
( ' { <http://www.tomproj.com/rep#entity_4> ?a 4 }',
SEM_MODELS( 'TOM') ,
NULL,
NULL,
NULL,
NULL));
2. . SELECT a FROM TABLE ( SEM_MATCH
( ' { <http://www.tomproj.com/rep#entity_4> ?a 4 }',
SEM_MODELS( 'TOM_TF') ,
NULL,
NULL,
NULL,
NULL));
When running the query on both models, execution time was 54 secs:
SELECT a FROM TABLE ( SEM_MATCH
( ' { <http://www.tomproj.com/rep#entity_4> ?a 4 }',
SEM_MODELS( 'TOM','TOM_TF') ,
NULL,
NULL,
NULL,
NULL));
We also run the original query via the Jena Adaptor using Java language and SPARQL, but the results were similar.
As for using parallel parameter in SEM_APIS.ALTER_SEM_INDEX…, since we are using Oracle 11g release 1 the SEM_APIS.ALTER_SEM_INDEX doesn’t support the parallel parameter as far as we know.
In Oracle 11g release 2 the SEM_APIS.ALTER_SEM_INDEX was extended to support the use of 'parallel' parameter.
Any ideas on what do we do wrong?
Cheers,
Doron -
I use sqlplus to run a query statement with the SEM_MATCH function, and got the following error:
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 176
ORA-06512: at line 1
Could it be a bug in the MDSYS.RDF_MATCH_IMPLE_T? I find the MDSYS.RDF_MATCH_IMPL_T in Oracle SQL Developer, but the code is not readable.
Thanks.It is not likely to be a bug, but an issue of how SEM_MATCH is used. It would be best to contact Oracle Support with your sample SEM_MATCH query that causes the error.
Melli -
Is it possible to use the sem_match query in java like a normal sql query?
Yes. You should be able to execute a SQL SEM_MATCH query directly in Java using JDBC.
-
Missing conditions in my query
Hi all
I am trying to develop custom report
Following are the columns which I required
while running the query its showing incorrect data and duplicates too
Not sure where I am missing
Pls suggest me whether the conditions which I gave are correct or not.
select distinct
ppf.full_name Person_Name,
paf.Assignment_number Assignment_number,
ppf.Employee_number Employee_number,
job.name job,
grade.name salary_grade,
grdrule.MINIMUM,
grdrule.MID_VALUE,
grdrule.MAXIMUM,
pPb.pay_annualization_factor * PPP.proposed_salary_n annual_salary,
grdrule.MID_VALUE/pPb.pay_annualization_factor* PPP.proposed_salary_n COMP_RATIO
from
per_people_f ppf,
per_all_assignments_f paf,
per_jobs_vl job,
per_grades_tl grade,
hr_organization_units hou,
pay_grade_rules_f grdrule,
per_pay_bases ppb,
PER_PAY_PROPOSALS ppp
where
ppf.person_id = paf.person_id
and job.job_id=paf.job_id
and grade.grade_id=paf.grade_id
and paf.organization_id = nvl (hou.organization_id, paf.organization_id)
and grdrule.BUSINESS_GROUP_ID=hou.BUSINESS_GROUP_ID
and ppp.BUSINESS_GROUP_ID=hou.BUSINESS_GROUP_ID
and ppb.pay_basis_id= paf.pay_basis_id
Thanks in advanceAfter using those two conditions I am able to fetch 12 records
select
ppf.full_name Person_Name,
paf.Assignment_number Assignment_number,
ppf.Employee_number Employee_number,
job.name job,
grade.name salary_grade,
grdrule.MINIMUM,
grdrule.MID_VALUE,
grdrule.MAXIMUM,
pPb.pay_annualization_factor * PPP.proposed_salary_n annual_salary,
grdrule.MID_VALUE/pPb.pay_annualization_factor* PPP.proposed_salary_n COMP_RATIO
from
per_people_f ppf,
per_all_assignments_f paf,
per_jobs_vl job,
per_grades_tl grade,
hr_organization_units hou,
pay_grade_rules_f grdrule,
per_pay_bases ppb,
PER_PAY_PROPOSALS ppp
where
ppf.person_id = paf.person_id
and job.job_id=paf.job_id
and grade.grade_id=paf.grade_id
and paf.organization_id = nvl (hou.organization_id, paf.organization_id)
and grdrule.BUSINESS_GROUP_ID=hou.BUSINESS_GROUP_ID
and ppp.BUSINESS_GROUP_ID=hou.BUSINESS_GROUP_ID
and ppp.assignment_id = paf.assignment_id --added
and grdrule.grade_or_spinal_point_id =paf.grade_id --added
and ppb.pay_basis_id= paf.pay_basis_id
and paf.business_group_id = 202
and ppf.full_name like 'Benson, Ms. Julianne'
and trunc(sysdate) between ppf.effective_start_date and ppf.effective_end_date
and trunc(sysdate) between paf.effective_start_date and paf.effective_end_date -
Missing Expression error in query...
Hi,
SELECT DECODE(NAME, '~', '', NAME),
DECODE(NAME_2, '~', '', NAME_2),
DECODE(SALES_ORG_ID, '~', '', SALES_ORG_ID),
DECODE(PARTNER_ID, '~', '', PARTNER_ID)
FROM DMN_SALES_PARTNER
WHERE (
(upper(trim(country_name)),(trim(state_id))) IN
SELECT DISTINCT upper(trim(scsm.country_name)),upper(trim (scsm.state_name))
FROM sop_region_country_map srsm, sop_user_map smap,sop_country_state_map scsm
WHERE SSO_ID = '&sso_id' AND
upper(trim(smap.region_id)) = upper(trim(srsm.region_id)) AND
upper(trim(srsm.country_name)) = upper(trim(scsm.country_name)) AND
decode(upper(trim(srsm.state_name)),NULL,'~',upper(trim(srsm.state_name)) ) = upper(trim(scsm.state_name))
AND deviation_from_sap = 'N'
OR
SELECT upper(trim(scsm.country_name)),upper(trim(scsm.state_name))
FROM sop_country_state_map scsm
WHERE (upper(trim(scsm.country_name)),scsm.sap_state_map_id) in (
select upper(trim(scssm.country_name)),scssm.sap_state_map_id
from sop_country_state_sap_mapping scssm )
)I want to return the combination of country_name and state_name from any of the queries in OR clause so as to compare them with the country_name and state_id of main query..I have written the above query for it but its giving me "Missing Expression" error..
Pls help..
Thx
JPJP,
Your second part after the "OR" is just a SQL statement and it is not being compared to an expression. That's probably what the error message is telling you.
Regards,
Rob. -
Missing variables in Infoset Query.
Hi All,
0P_KEYD2 is a variable for characterstic "Posting Date" in the query which fires on ODS 0FIAR_O03.I have created an Infoset on ODS 0FIAR_O03 and 0CUST_SALES(Master Data)and created a query on this infoset. But I am unable to see variable 0P_KEYD2 for Posting Date in the Infoset Query.
(There are some other variables too which are not visible in Infoset Query, these include - custom "Z..." variables & BC variables, with SAP exit and with User entry, etc)
Could anyone suggest how to access this same variable for query on infoset as in ODS query?
I tried having an new Infoset with just the ODS 0FIAR_O03, but here again these variables are missing for this characterstic (and possibly other variables for other characterstic), while if I try to build the query on the above ODS directly I get the variables!
Version: We are on BW 3.5
Thanks,
Melwyn Joseph
Message was edited by: Melwyn Joseph
Message was edited by: Melwyn JosephHi,
I'd put this query in SDN quite some time back..but didn't get any response then.
As Raymond said above, that is what I'd done in my case. The original variables are SAP exit (u can view their code in the standard SAP FM's). Here the code refers to other variables/objects with their specific tech names (or something similar..don't remember it now). In infoset, as we dont get the original tech. names of the objects in the query ...these SAP exit codes will not work for these variables.
The solution is to create your own custom variables & populate it in Customer Exit. U can get the logic from the SAP exit code...its not that difficult to understand.
cheers,
-Me -
Cfreport ("HTML format") missing columns for a query
Using Linux Fedora, ColdFusion 8 Developer Edition.
Problem:
The command:
<cfreport
format="HTML"
template="ReportTemplateHtml.cfr"
filename="Report.html"
overwrite="yes"
query=#structReport.query#
>
With Format equal to PDF or RTF, which is correct output:
"item" "Description" "Qty" "Unit Price" "Extension"
The HTML output writes the following columns:
"item" "" "" "Unit Price" "Extension"
The "Description" and "Qty" are missing.
Any ideas as to why data is missing from HTML report?
The html output for the table is as follows:
<tr valign="top">
<td style="width: 18px; height: 18px;"></td>
<td colspan="3" style="background-color: #EDE9C6;
border-top-style: solid; border-top-width: 1px; border-top-color:
#000000; padding-top: 1px; border-left-style: solid;
border-left-width: 1px; border-left-color: #000000; padding-left:
3px; border-bottom-style: solid; border-bottom-width: 1px;
border-bottom-color: #000000; padding-bottom: 1px;
border-right-style: solid; border-right-width: 1px;
border-right-color: #000000; padding-right: 3px; "><span
style="font-family: Helvetica; background-color: #EDE9C6;
font-size: 10.0pt; font-weight:
bold;">Item</span></td>
<td colspan="6" style="width: 273px; height:
18px;"></td>
<td colspan="3" style="background-color: #EDE9C6;
border-top-style: solid; border-top-width: 1px; border-top-color:
#000000; padding-top: 1px; border-left-style: solid;
border-left-width: 1px; border-left-color: #000000; padding-left:
3px; border-bottom-style: solid; border-bottom-width: 1px;
border-bottom-color: #000000; padding-bottom: 1px;
border-right-style: solid; border-right-width: 1px;
border-right-color: #000000; padding-right: 3px; "><span
style="font-family: Helvetica; background-color: #EDE9C6;
font-size: 10.0pt; font-weight: bold;">Unit
Price</span></td>
<td colspan="3" style="background-color: #EDE9C6;
border-top-style: solid; border-top-width: 1px; border-top-color:
#000000; padding-top: 1px; border-left-style: solid;
border-left-width: 1px; border-left-color: #000000; padding-left:
3px; border-bottom-style: solid; border-bottom-width: 1px;
border-bottom-color: #000000; padding-bottom: 1px;
border-right-style: solid; border-right-width: 1px;
border-right-color: #000000; padding-right: 3px; "><span
style="font-family: Helvetica; background-color: #EDE9C6;
font-size: 10.0pt; font-weight:
bold;">Extension</span></td>
<td style="width: 19px; height: 18px;"></td>
</tr>Query Builder is a crutch tool. Small, lightweight, but limited. It does not have every inline function you see in the SQL reference guide. If you need more, then you have to do more on your own.
-
How to sem_match query on "more than one"
Here is graph,
<Subject A> <:relate> <Object B>
<Subject A> <:relate> <Object C>
I want to find all the subject nodes which relate more than one objects, if using sem_match SQL query, how to represent the match pattern?
Thanks.We can use an aggregate for that.
SELECT ?subj
WHERE
{ ?subj :relate ?obj }
GROUP BY ?subj
HAVING (COUNT(*) > 5)
With this strategy we don't have to worry about duplicate objects because we aren't doing a join.
You can replace 5 with whatever number of :relates you need. -
BEX :Selection screen missing when executing a query
Hi all,
When I am executing a query through BEX Analyzer,I am not getting the Selection Screen Popup.Instead ,the report is directly being generated.So,this is giving rise to various problems.But when the user is executing through portal,he is getting the selection screen.
I am not getting this Selection screen popup in all the DEv,Quality,PreProd and Production systems.And hence ,i am not able to give the selections for a report
Can anyone please provide a solution for this?
Awaiting your response.
Thanks,
AmarHi,
Our GUI version is 710 and 640 is recommended by the client.Hence, no problem with that.The user is able to execute more than one query.
Do u think it is a basis or security related issue.Or is it due to Application of some GUI Patches.
Thanks,
Amar -
Missing parameters on Bex query selection screen
Hi,
we are using BW3.5 (support pack 18) and one of our users has created a number of variants for a particular query which he executes via the Bex Analyser. The problem is, when ever he runs this query now, all the fields that he populated in his variants no longer appear on his selection screen - even if we delete all the variants.
He did not choose to hide any fields (in the variant) and he has not set any personal values in personalisation.
Can anyone please help?
Thanks,
John.Hi Ozan.
Thanks for your reply however my problem was that the fields were no longer displayed on the selection screen thus there was no buttons to select for the personalisation settings therefore no way to turn off the personalisation.
However I discovered that if I executed the query using transaction RSRT the full selection screen was displayed and I could access the personalisation buttons for the parameters that had personalisation.
Thanks anyway. -
Missing data fields in Query designer
Hi Guys,
A query exists on an ODS. There are few characteristics and navigational attributes in the ODS. In Query designer, on the left hand side under Dimensions,
i can see 'Data part' (for Data fields of ODS) and 'Key section' (for Key fields of ODS).
All but 2 fields (One data field and one navigational attribute of the ODS) are seen under 'Dart part' of the query designer.
Data field - Accounting Document number
Navigational attribute - Actual Acquisition Fiscal Year
What may the reason for those 2 fields not appearing.
Any help is greatly appreciated.Hi,
I executed a query on the ODS using LISTCUBE. To my surprise, i can find both 0AC_DOC_NO and ZACQ_YR here. If i can find both these in LISTCUBE, why don't i find the same in the query designer. Even though i built a new query on the ODS in the query designer, i still can't find them in the query designer.
Thanks -
Missing field for MDX query for All Members
Hello,
I'm using MDX query with SSRS for report and I ran into this issue:
Query 1:
select non empty ([Product].[Category].allmembers*[Date].[Calendar].[Calendar Year].allmembers ) on 1,
([Measures].[Internet Sales Amount]) on 0
from [Adventure Works]
go
Query 2
select non empty ([Product].[Category].[All]*[Date].[Calendar].[Calendar Year].allmembers ) on 1,
([Measures].[Internet Sales Amount]) on 0
from [Adventure Works]
In case I run query 2 in SSDT (query designer), it doesn't return first column whereas if I run above two queries in SSMS, I get similar columns/fields.
How it can be resolved in SSRS to return all columns for query 1 and 2.
Thanks,
P
mark it as answer if it answered your question :)Hello,
I'm using MDX query with SSRS for report and I ran into this issue:
Query 1:
select non empty ([Product].[Category].allmembers*[Date].[Calendar].[Calendar Year].allmembers ) on 1,
([Measures].[Internet Sales Amount]) on 0
from [Adventure Works]
go
Query 2
select non empty ([Product].[Category].[All]*[Date].[Calendar].[Calendar Year].allmembers ) on 1,
([Measures].[Internet Sales Amount]) on 0
from [Adventure Works]
In case I run query 2 in SSDT (query designer), it doesn't return first column whereas if I run above two queries in SSMS, I get similar columns/fields.
How it can be resolved in SSRS to return all columns for query 1 and 2.
Thanks,
P -
Initial selection screen missing when execting a query via web
Hello all.
We have a problem when we try to execute a query in web. We developped queries via query designer and we published all in a role. By doing it system generates a link that makes possible to execte this query via web. The issue is that sometimes the initial selection screen doesn´t appear (and the variables are "ready to input".
Could anybody help me?
Thanks in advance.Dear Carmen Rodríguez,
In the WAD properties of the webtemplate.. carefully look for 'Force Variable Screen' Check that option..
Save and rerun the same.. it should be able to see the screen after that..
regards,
Hari -
Missing Result Rows on Query with Conditions
I have a query that has a condition to show only items over $2500.00. We have a result row that shows for plant when the condtions is not on but once the condition is set that result row goes away. Does anyone know how to get a result row to show up on reports with conditions? Thank you.
CarolineHi Caroline,
In BI 7.0, you goto do this in Query Designer.
Select any of your characteristic in the designer and choose Display Properties to always display result.
Then run the query.
Assign Points if Helps !!
Regards,
Naveen Rao Kattela
Maybe you are looking for
-
Display A Success Message From An Application Process
Apex 3.2 I have an on demand application process, which is resetting my application, except application items BEGIN FOR c IN (SELECT page_id FROM apex_application_pages WHERE application_id = :app_id) LOOP ape
-
"iTunes cannot run because some of its required files are missing." Help!!
"iTunes cannot run because some of its required files are missing." Help!! Hello everyone, I have looked throughout this forum but couldn’t find anything similar so I am posting this in the hope of someone helping me out. I have encountered some prob
-
How to positively get rid of AVG Secure search
I have tried many of the method suggested by user but AVG Secure Search is unaffected or goes away but keeps coming back. I don't understand how it only seems to affect people running Firefox and why Firefox seems to rely completely on forums and sug
-
Script to Update SL Address Book with Lion Address Book?
The only thing stopping me from switching from mobileme to icloud is my wife's imac, which is a little too old for Lion. I have seen workarounds to sync calendars and mail, but not address books, via icloud. Since it should be possible to export an
-
Custom formulas for Numbers Spreadsheets
Where do I go to get instructions for custom formula writing in Numbers. My product is iMAC OS X Yosemite. I am more confident with EXCEL and having difficulty with flexibility in the Numbers Spreadsheets.