I try to get index from family example using SEM_MATCH. For example I do INSERT INTO family_rdf_data VALUES (3, SDO_RDF_TRIPLE_S('family',
Thanks for answear. I' ve got two questions. First: I do
select app_tab.id from (TABLE(SEM_MATCH(
*'(:John :fatherOf ?y)', SEM_Models('family'),null,SEM_ALIASES(SEM_ALIAS('','http://www.example.org/family/')),null))*
*) g, family app_tab* where
--g.x$RDFVID=app_tab.triple.rdf_s_id and* g.y$RDFVID=app_tab.triple.rdf_c_id
and I get id = 1,2,3,4 but it should return id=1,2
It really depends on what rows you have in your application table.
Note that if you insert the same triple multiple times into your application table,
you are likely to get "duplicates" when querying the graph together with your application table.
In contrast, when querying using SEM_MATCH, the underlying RDFM_<modelName> view
maintains a set of triples.
As far as your query goes, basically it finds the ID of the RDF resource (which is father of John),
you then join it with the application table, locating rows that have the same object ID.
Obviously, the object ID itself is not sufficient to uniquely identify a triple.
You may want to add predicates using oracle_orardf_res2vid for both :John
rdf_s_id is the ID for triple subject and
rdf_p_id is the ID for triple predicate.