0x01Brain
0x01Brain

Reputation: 818

How to get films starring for one actor in dbpedia sparql?

I have the following code where I get the starring for all films selected:

SELECT ?f ?starring
WHERE {
?f rdf:type dbo:Film .
?f dbo:starring ?starring
}

Is there a way where I can get films of specific starring (actor) like "Tom Hanks" for example?

Upvotes: 1

Views: 2306

Answers (1)

Ivo Velitchkov
Ivo Velitchkov

Reputation: 2431

Just add the DBpedia resource representing the actor, as the object of the tipple pattern:

SELECT ?f 
WHERE {
?f rdf:type dbo:Film .
?f dbo:starring dbr:Tom_Hanks .
}

Upvotes: 4

Related Questions