This content has been marked as final.
Show 6 replies
-
1. Re: HOW TO DELETE PARTICULAR TRIPLE SET FROM Oracle SEMANTIC TABLES in 11g
alwu-Oracle Jun 26, 2008 5:08 PM (in response to 11548)Please check this example.
create table tstdel(id number, triple SDO_RDF_TRIPLE_S);
exec sem_apis.create_sem_model('tstdel','tstdel','triple');
insert into tstdel values(1, SDO_RDF_TRIPLE_S('tstdel','<urn:sub>','<urn:pred>','<urn:obj>'));
DELETE FROM tstdel s
WHERE
( to_char(s.triple.rdf_m_id, 'FMXXXXXXXXXXXXXXXX') ||'_'||
to_char(s.triple.rdf_s_id, 'FMXXXXXXXXXXXXXXXX') ||'_'||
to_char(s.triple.rdf_p_id, 'FMXXXXXXXXXXXXXXXX') ||'_'||
to_char(s.triple.rdf_c_id, 'FMXXXXXXXXXXXXXXXX') )
= SDO_RDF.GET_TRIPLE_ID('tstdel', '<urn:sub>', '<urn:pred>', '<urn:obj>');
To speed up delete, you can create a functional index on the application table. -
2. Re: HOW TO DELETE PARTICULAR TRIPLE SET FROM Oracle SEMANTIC TABLES in 11g
alwu-Oracle Jun 30, 2008 2:11 PM (in response to 11548)Hi,
It is very strange. I got an email in my inbox saying that you want to find out
IDs of triples that belong to RNAIDB data set like the following.
"<http://www.lscdd.lilly.com.sg/lscdd/RNAIDB/...../.../:>".
This forum does not have your message somehow.
Assume you have asked such an question :), my answers are
1) from a modeling perspective, it is not a very good idea to encode
semantics in the URI lexical form itself. A URI should be treated
as a symbol.
2) now assume you have a valid reason for doing this, you can try something like the following.
CREATE INDEX testdel_sub_idx ON tstdel (triple.GET_SUBJECT());
-- You can then get the rowid out for those offending rows.
select rowid
from tstdel t
where t.triple.GET_SUBJECT() like '<urn:su%'
;
-- Or you can remove them directly.
delete from tstdel t
where t.triple.GET_SUBJECT() like '<urn:su%'
; -
3. Re: HOW TO DELETE PARTICULAR TRIPLE SET FROM Oracle SEMANTIC TABLES in 11g
alwu-Oracle Jun 30, 2008 2:13 PM (in response to alwu-Oracle)Not sure why the last line of my previous post is messed up. It should be the same as
the where clause in the "select" statement. -
4. Re: HOW TO DELETE PARTICULAR TRIPLE SET FROM Oracle SEMANTIC TABLES in 11g
711158 Dec 14, 2010 2:42 PM (in response to alwu-Oracle)but the values of triple still exists in MDSYS.RDF_VALUE$ table. Is this a proper way remove triple ?? -
5. Re: HOW TO DELETE PARTICULAR TRIPLE SET FROM Oracle SEMANTIC TABLES in 11g
715399 Dec 14, 2010 2:45 PM (in response to 711158)Yes, that is expected. The resource values are not removed from RDF_VALUE$ when deleting triples.
Regards,
Vladimir -
6. Re: HOW TO DELETE PARTICULAR TRIPLE SET FROM Oracle SEMANTIC TABLES in 11g
711158 Dec 15, 2010 8:39 AM (in response to 715399)Our application do atleast 1000 deletes/insert/update on triples every day.
In this case number of unused resource values in MDSYS.RDF_VALUS$ table won't affect the query performance on the model?
Or
Am i missing anything??