This content has been marked as final. Show 9 replies
The data in other columns can be obtained by doing a self-join with other the RDF table. Below is a sample query using the family demo example:
SELECT x Male, t2.id ID
'(?x rdf:type :Male)',
null)) t1, family_rdf_data t2 where t2.triple.get_subject() = t1.x;
Thank you for your response about this problem. This solution I think will go too slow, if I make the query throw sdo_rdf_match for a solution and them I do it again throw normal query to match que final results ....
SELECT t2.id ID, Brother <br>
SDO_RDF_MATCH( (':Joe' :brotherOf ?Brother)',<br>
) t1, family_rdf_data t2 <br>
where t2.triple.get_subject() = 'http://www.example.org/family/Joe'<br>
and t2.triple.get_property() = 'http://www.example.org/family/brotherOf'<br>
and to_char(t2.triple.get_object()) = t1.Brother;<br>
In this examples, I do the sdo_rdf_match query to obtain the Objetct, and the do again because It could be more triples than matches with this object.
Is there a posibility to obtain directly in the sdo_query_match the RDF_T_ID ?. I think it could be the correct solution.
Yes getting RDF_T_ID through SDO_RDF_MATCH would be convenient, but the current interface does not support that. We are considering that for a future release.
has there been any update to this issue (e.g. being able to access, say, the triple ID, directly within a semantic query instead of performing a join on the triple table itself)?
In the upcoming patchset of Oracle 11g, expected to be released shortly, we are planning to enable direct access to the IDs from semantic query which should satisfy this requirement.
sounds good. in the meantime, can anyone suggest any ways of optimizing a query similar to that posted earlier? my query looks similar to the one posted above...
SELECT t2.id ID, Brother
SDO_RDF_MATCH( (':Joe' :brotherOf ?Brother)',
) t1, family_rdf_data t2
where t2.triple.get_subject() = 'http://www.example.org/family/Joe'
and t2.triple.get_property() = 'http://www.example.org/family/brotherOf'
and to_char(t2.triple.get_object()) = t1.Brother;
...in my case, it seems the family_rdf_data table is (naturally) growing larger, and query times are growing. any suggestions on a better way to retrieve similar data?
Is this patch available now (if not: when) and does it also contain the OPTIONAL clause?
Yes, this patch (220.127.116.11) has been released, and is available for supported customers via metalink (metalink.oracle.com). Usage examples are part of the OOW08 presentations available online now at [http://www.oracle.com/openworld/2008/index.html] . Below is a simple example:
Basically 18.104.22.168 allows the ids of the subject, object, and predicate to be retrieved (instead of just the subject, predicate, object text strings), and these ids will enable you to construct the triple_id by concatenating the ids appropriately.
An example of retrieving an id:
SELECT y$rdfvid, count(*) member_count FROM table(sem_match( '(?x rdf:type ?y)', SEM_Models('r<....>t'),null,null,null,
The 22.214.171.124 patch does not include OPTIONAL but that is expected very shortly. I will post a note on this forum as soon as it is available.
Creating indexes on get_subject(), get_property(), get_object() will help. Examples are iin the Quick Start (section 1.8) in the documentation.