I’m currently learning some sparql and I’m practicing on the following website with some statements:
http://data.semanticweb.org/snorql
However, I’m trying to execute the following statement:
SELECT DISTINCT ?author WHERE { ?paper swrc:author ?author FILTER(regex(?paper, "2006")) . } .
It says that there are no results. When I run the following query (without the filter):
SELECT DISTINCT ?paper WHERE { ?paper swrc:author ?author . }
I see that there are some papers with 2006 in it’s string. I’m wondering why the first query is not returning these entries where there is 2006 in the ?paper string.
Could anyone help me with this?
The RDF terms returned for
?paperare all URIs. TheREGEXfilter function doesn’t work on URIs; it only works on strings. You can turn a URI into a string using theSTR(…)function. This will work: