I have triples data where subjects starts with uri's like
<http://www.test.com/work/12353>
<http://www.test.com/term/12353>
<http://www.test.com/name/12353>
there are approx 70k triples in total.
I want to get all the subject values that starts with <http://www.test.com/work/>
I am able to achieve this using FILTER
as given below, I'm curious to know if this the correct way or there is a better way to achieve the same?
SELECT DISTINCT ?s
WHERE {
?s ?p ?o .
FILTER (strstarts(str(?s), 'http://www.test.com/work/'))
}
LIMIT 1000
Please help.
SELECT ?s { { SELECT DISTINCT ?s { ?s ?p ?o } } FILTER (strstarts(str(?s), 'http://www.test.com/work/')) } LIMIT 1000
. – Yulan