Supposing we have many RDF triples related as:
1: <S,P1,O>
2: <O,P2,O3>
3: <O,P3,O4>
4: <O3,P4,O5>
I would like to get triple N° 2, 3 and 4 by just knowing triple number 1 because triple N° 2 and 3 share "O" with triple N°1 and triple N° 4 share "O3" with triple N°2 which share "O" with triple N°1 Is it possible to formulate that with sparql query without knowung P2,P3,P4?
Thank you in advance
Sure. This query will do that just that:
It's unlikely to be very efficient though. However without knowing more about your actual data or why you want this particular result, it's difficult to come up with a better solution.