SPARQL QUERY in Protege 4.3

348 Views Asked by At

I have three class in my ontology

class babyAge (6+, 8+, 12+)
class taste (asam, manis, asin)
class food (recipe name)

i want to querying data food for babyAge (6+) and have taste (asam)

i use this code in my java program (i dont know if there are other code more simple than this one, if you know please tell me too) :

SELECT ?babyAge ?taste ?food  
WHERE { ?babyAge mpasi:hasResep ?food.
?food mpasi:hasRasa ?taste.
FILTER regex(str(?babyAge),"6+").
FILTER regex (str(?taste),"asam")}

and i get my data. but when i execute that code in protege, i dont get anything. Can someone help me?

1

There are 1 best solutions below

0
Ignazio On

It's difficult to tell without seeing the ontology.

My first move would be to ensure mpasi is bound to the same value in the ontology and in your query - it might be a case of mismatched IRIs.

You might also want to try without filters and see if anything is returned.