sparql pattern matching
pattern-matching, rdf, sparql
Solution
The RDF terms returned for `?paper` are all URIs. The `REGEX` filter function doesn't work on URIs; it only works on strings. You can turn a URI into a string using the `STR(…)` function. This will work:
FILTER(regex(STR(?paper), "2006"))
Problem
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?