Creating a triple store query using SQL - how to find all triples that have a common predicate and o

Posted by Ankur on Stack Overflow See other posts from Stack Overflow or by Ankur
Published on 2010-04-21T02:36:31Z Indexed on 2010/04/21 2:43 UTC
Read the original article Hit count: 283

Filed under:
|
|
|

I have a database that acts like a triple store, except that it is just a simple MySQL database.

I want to select all triples that have a common predicate and object. Info about RDF and triples

I can't seem to work out the SQL.

If I had just a single predicate and object to match I would do:

select TRIPLE from TRIPLES where PREDICATE="predicateName" and OBJECT="objectName"

But if I have a list (HashMap) of many pairs of (predicateName,objectName) I am not sure what I need to do.

Please let me know if I need to provide more info, I am not sure that I have made this quite clear, but I am wary of providing too much info and confusing the issue.

© Stack Overflow or respective owner

Related posts about rdf

Related posts about triples