Singh Amit
Singh Amit

Reputation: 1

SPARQL Query for linked data

I want to fetch Movies details from LinkedMDB along with corresponding same as links for DBPedia Datasets.I am writing following query:

SELECT ?film ?label ?dbpediaLink WHERE {
  ?film rdf:type movie:film .
  ?film rdfs:label ?label . 
  ?film owl:sameAs ?dbpediaLink
  FILTER(regex(str(?dbpediaLink), "dbpedia", "i"))
}
LIMIT 1000

This query is returning Movie URI in LinkedMDB, Movie Name and DBPedia URI. I want to get more details about each movie so that I can have more feature for classification.

Upvotes: 0

Views: 252

Answers (1)

ColinMaudry
ColinMaudry

Reputation: 143

I'm not sure I understood your problem, but I'll give a shot: you found some properties about films on IMDB (the title and the DBpedia URI), and you would like to discover what other properties the data can offer.

In this situation, I would do a DESCRIBE query to return all the triples where a random ?film is the subject.

DESCRIBE ?film WHERE {
?film a movie:film .
}
limit 1

Explanation:

  • DESCRIBE queries return all the triples for which the URIs returned by the WHERE clause are subjects (some endpoints are configured to also return the triples where those URIs are object). That would return triples with rdfs:label, owl:sameAs... and other properties (if any)!
  • The WHERE clause specifies which ?film we want described
  • The limit makes sure you don't describe ALL the movie:film in the data

PS: I'm not familiar with IMDB data, but isn't it movie:Film (capital F)?

Upvotes: 1

Related Questions