rdfsparqlendpointlinkedmdb

How should I do, for getting the desired result from linkedmdb?


Will someone explain me this phenomenon? I am querying the endpoint http://www.linkedmdb.org/snorql with the SPARQL query: Get the list actors who have starred in a British Movie Q1:

SELECT * WHERE {
?Film <http://data.linkedmdb.org/resource/movie/country> <http://data.linkedmdb.org/resource/country/GB> .
?Film <http://data.linkedmdb.org/resource/movie/actor> ?actor.
}

Among the results we have an actor with id 11764 Oddly when I run the query Q2:

SELECT * WHERE {
   ?Film <http://data.linkedmdb.org/resource/movie/actor> ?actor.
}

Although Q2 is less selective than the Q1 actor number 11764 is no longer in the result. Notice that we get the Q2 by removing the first triple pattern of Q1 (less constraint)


Solution

  • This appears to be a bug in the SPARQL engine at the linkedmdb.org endpoint, as these results are clearly inconsistent.

    To rule out the possibility of an upper limit on the query result size I tried a couple of variations of your original query.

    This query:

    SELECT * WHERE {
        ?Film <http://data.linkedmdb.org/resource/movie/actor> ?actor . 
        FILTER (?actor = <http://data.linkedmdb.org/resource/actor/11764> )
    }
    

    gave me the expected result (two results, both fillms with the actor we expect).

    However, this query:

     SELECT * WHERE {
        ?Film <http://data.linkedmdb.org/resource/movie/actor> ?actor . 
        FILTER (REGEX(STR(?actor), "11764"))
     }
    

    gave me zero results, while this query:

     SELECT * WHERE {
        ?Film <http://data.linkedmdb.org/resource/movie/country> <http://data.linkedmdb.org/resource/country/GB> .
        ?Film <http://data.linkedmdb.org/resource/movie/actor> ?actor . 
        FILTER (REGEX(STR(?actor), "11764"))
     }
    

    gives me exactly one result (one GB film with this actor), as expected.

    So, in summary: nothing wrong with your SPARQL queries. You seem to have stumbled upon a bug in their SPARQL engine - you might want to contact them with this information.