@rollin
To get only URL results in a SPARQL query, you can use the FILTER function to filter out only results that are valid URLs. You can do this by checking if the result starts with "http://" or "https://" using regular expressions.
Here is an example SPARQL query that retrieves only URL results:
1 2 3 4 5 |
SELECT ?url WHERE { ?s ?p ?o . FILTER(STRSTARTS(str(?o), "http://") || STRSTARTS(str(?o), "https://")) } |
In this query, we are selecting the variable ?url and filtering out results where the object (?o) starts with "http://" or "https://". This will only return results that are valid URLs.