-
1. Re: Tracing all the tuples that are inserted as part of a transaction
alwu-Oracle Nov 2, 2016 8:55 PM (in response to user474398)1 person found this helpfulHi Priya,
The triples/quads are stored in an internal table (partitioned) called MDSYS.RDF_LINK$. For performance reasons, we do not associate timestamps with each insert/deletion.
Having said that, you may be able to figure out a "diff" with flashback/scn [1], assuming you have the necessary privileges and sufficient UNDO.
Thanks,
Zhe Wu
[1] https://docs.oracle.com/database/121/ADFNS/adfns_flashback.htm#ADFNS01004
-
2. Re: Tracing all the tuples that are inserted as part of a transaction
user474398 Nov 3, 2016 5:33 PM (in response to alwu-Oracle)Thank you Zhe!
We also like to understand the total tuples count in our database for rdf_value$ and rdf_link$ views.
We have three RDF_MODELs (in MDSS.rdf_model$) - ontology, instances of ontology data and spatial.
Here are the counts of the corresponding tuples for all models:
select count(*) from DATA_TPL; --386,224,043
select count(*) from ONTOLOGY_TPL; --28281
select count(*) from SPATIAL_TPL; --274899
However counts for rdf_value$ and rdf_link$ are as below:
select count(*) from MDSYS.rdf_value$; --81,572,658
select count(*) from MDSYS.RDF_LINK$; --174,645,616
For some reason I thought either the RDF_LINK$ or RDF_VALUE$ counts should match up to the counts of all three tpl when added together.
Why the counts of RDF_LINK$ and RDF_VALUE$ are not adding up to what we have in *TPL tables and what do each view represent.
Thanks,
Priya
-
3. Re: Tracing all the tuples that are inserted as part of a transaction
alwu-Oracle Nov 4, 2016 4:41 PM (in response to user474398)1 person found this helpfulHi Priya,
This is because you have duplicates in the _TPL table. Internally, to maintain the set semantics of an RDF graph (or an RDF dataset), we take out duplicates (triples/quads). That's why RDF_LINK$ (or the RDFM_ views of RDF_LINK$ partitions) may have less number of rows.
We do maintain a COST column in MDSYS.RDF_LINK$ to keep track of how many duplicates there are for each unique triple/quad.
SQL> select /*+ parallel(4) */ sum(cost) from mdsys.rdf_link$;
SQL> select /*+ parallel(4) */ sum(cost) from mdsys.rdfm_<model_name>;
Hope it helps,
Zhe Wu
-
4. Re: Tracing all the tuples that are inserted as part of a transaction
user474398 Nov 4, 2016 5:31 PM (in response to alwu-Oracle)Thank you Zhe!
I still don't understand the difference between RDF_LINK vs RDF_VIEW.
Is my understanding correct that RDF_LINK$ count should match with TPL count if there are no duplicates in the TPL table.
Thanks,
Priya
-
5. Re: Tracing all the tuples that are inserted as part of a transaction
alwu-Oracle Nov 5, 2016 12:32 AM (in response to user474398)Hi Priya,
Let me explain. MDSYS.RDF_LINK$ is the underlying table storing all triples/quads that exist in the semantic network. It is partitioned so that each separate RDF model (asserted or inferred) can occupy a separate partition.
MDSYS.RDF_LINK$ itself is a private table in MDSYS. Regular users are NOT able to access it. Views (like MDSYS.RDFM_<model_name>) can be created on top of one or multiple partitions. Access to the views can be granted to regular users.
You are right when there is no duplicates, # of rows in _TPL should match that in MDSYS.RDFM_<model_name>
Hope it helps,
Zhe Wu