0

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)

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • There were some typos in your SPARQL queries (whitespace between the `?` and the actual variable names) but I assume that wasn't what caused your problem, so I edited it. – Jeen Broekstra Jul 08 '15 at 23:16

1 Answers1

1

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.

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • I don't know that it's a bug so much as that they limit the number of results. See, for instance [How to resolve the execution limits in Linkedmdb](http://stackoverflow.com/q/25141247/1281433), [LinkedMDB SPARQL results with fewer results than expected?](http://stackoverflow.com/q/24283012/1281433), and the comments on the answer to [LinkedMDB SPARQL Query](http://stackoverflow.com/q/18783869/1281433). However, I don't think that [Can't retrieve movies with high IDs from LinkedMDB with SPARQL](http://stackoverflow.com/q/22021040/1281433) is relevant. – Joshua Taylor Jul 09 '15 at 00:24
  • @JoshuaTaylor I thought so too at first, but if it were a limiting of the number of results, my more constrained queries (with the filter conditions) should have given consistent (non-empty) answers. – Jeen Broekstra Jul 09 '15 at 00:25
  • Good point. (I didn't read your answer all that closely, but you actually addressed most of that already. LinkedMDB's quirky enough that I don't spend too much time trying to debug it.) – Joshua Taylor Jul 09 '15 at 00:28