This content has been marked as final. Show 5 replies
You can use something like this
select app_tab.id ...
'(?x :grandParentOf ?y) (?x rdf:type :Male)', SEM_Models('family'),null,SEM_ALIASES(SEM_ALIAS('','http://www.example.org/family/')),null))
) g, family_rdf_data app_tab
If you need to add a constraint on the property, you can add another expression to the above SQL as follows.
Note that the oracle_orardf_res2vid function is a helper function (automatically created when you
use Jena Adapter).
Hope it helps,
Thanks for answear. I' ve got two questions. First: I do
*'(:John :fatherOf ?y)', SEM_Models('family'),null,SEM_ALIASES(SEM_ALIAS('','http://www.example.org/family/')),null))*
*) g, family app_tab*
and I get id = 1,2,3,4 but it should return id=1,2
and Second: What is rdf_s_id or rdf_c_id ??
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.
Hope it helps,