1

The following query

PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX edm: <http://www.europeana.eu/schemas/edm/>
PREFIX ore: <http://www.openarchives.org/ore/terms/>

SELECT *
{
        SERVICE <http://sparql.europeana.eu> {
              ?CHO ore:proxyIn ?proxy;
              dc:title ?title ;
              dc:creator ?creator ;
              dc:date ?date .
              FILTER REGEX(str(?creator),"corelli","i").
              ?proxy edm:isShownBy ?mediaURL .
            } 
}

computes some titles out of some works of "corelli" out of the Europeana knowledge base. But when I try to bind a variable ?surname with a string "corelli" it returns nothing.

E.g.

SELECT *
{
        values ?surname { "corelli" }
        SERVICE <http://sparql.europeana.eu> {

              ?CHO ore:proxyIn ?proxy;
              dc:title ?title ;
              dc:creator ?creator ;
              dc:date ?date .
              FILTER REGEX(str(?creator),?surname,"i").
              ?proxy edm:isShownBy ?mediaURL .
            } 
}

The FILTER REGEX expression seems not to work there (I am using a Blazegraph instance to compute this query). Neither if I use str(?surname) instead of ?surname.

Why is this so?

Anyone knows what can be done in order to set ?surname with some string values (I might want to gather from another endpoint) and let the query find data ?

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
Fabio Ricci
  • 89
  • 1
  • 9
  • 1
    Possible duplicate of [comparing labels in a federated query](https://stackoverflow.com/questions/51814547/comparing-labels-in-a-federated-query) – Stanislav Kralin Aug 20 '18 at 18:07
  • BTW, [this](https://pastebin.com/ZBcYg8LF) works in GraphDB (try on FactForge) and even [this](https://pastebin.com/zwgjp3ez) doesn't work in Blazegraph (try on Wikidata), because GraphDB and Blazegraph pass local bindings into remote query in different ways (FYI, both query assume that `?creator` is a string, not an URI). – Stanislav Kralin Aug 21 '18 at 06:27

1 Answers1

0

Most likely you don't see results because the query times out. It's too heavy for the public endpoint you're using. Actually, both queries are too heavy, and if you make a few attempts with different string values you might notice that sometimes the first query times out too, and sometimes the second query returns some results.

marat
  • 1,247
  • 9
  • 14