SELECT?actor?actorLabelWHERE{wd:Q127367 wdt:P161 ?actor# members of the cast of "The Lord of the Rings: The Fellowship of the Ring" by Peter JacksonSERVICEwikibase:label {bd:serviceParam wikibase:language "en".}}

Étape 2 : Acteurs du même film avec leurs rôles :

SELECT?actor?actorLabel?role?roleLabelWHERE{wd:Q127367 p:P161 ?actorStatement.# statements for members of the cast of The Lord of the Rings: The Fellowship of the Ring?actorStatementps:P161 ?actor.# value of those statements?actorStatementpq:P453 ?role.# qualifier with property P453 (character role) for those statementsSERVICEwikibase:label {bd:serviceParam wikibase:language "en".}}

Étape 2b : Acteurs du même film, si possible avec leurs rôles :

SELECT?actor?actorLabel?role?roleLabelWHERE{wd:Q127367 p:P161 ?actorStatement.# cast statements of The Lord of the Rings: The Fellowship of the Ring?actorStatementps:P161 ?actor.# value of those statementsOPTIONAL{?actorStatementpq:P453 ?role.}# trying to get the qualifier with property P453 (character role) for those statementsSERVICEwikibase:label {bd:serviceParam wikibase:language "en".}}

SELECTDISTINCT?actor?actorLabel?role?roleLabelWHERE{?moviewdt:P179 wd:Q190214 .# movie is part of the "'Lord of the Rings' by Peter Jackson" film series (Q190214)?moviep:P161 ?actorStatement.# movie has actors cast?actorStatementps:P161 ?actor.# of which we get the QidOPTIONAL{?actorStatementpq:P453 ?role.}# and try to get the character roleSERVICEwikibase:label {bd:serviceParam wikibase:language "en".}}

SELECTDISTINCT?actor?actorLabel?role?roleLabel?imageWHERE{?moviewdt:P179 wd:Q190214 .# movie is part of Peter Jackson's LotR trilogy?moviep:P161 ?actorStatement.# movie has actors cast?actorStatementps:P161 ?actor.# of which we get the QidOPTIONAL{?actorwdt:P18 ?image}.# and an image if one is declared?actorStatementpq:P453 ?role.# the actors were cast as given roles?rolewdt:P31 wd:Q74359 .# roles that happen to be that of HobbitsSERVICEwikibase:label {bd:serviceParam wikibase:language "en".}}

#defaultView:ImageGrid# photo gallery of actors who played Hobbits in Peter Jackson's Lord of the Rings trilogySELECTDISTINCT?actor?actorLabel?role?roleLabel?imageWHERE{?moviewdt:P179 wd:Q190214 .# movie is part of Peter Jackson's trilogy?moviep:P161 ?actorStatement.# movie has actors cast?actorStatementps:P161 ?actor.# of which we get the QidOPTIONAL{?actorwdt:P18 ?image}.# and an image if one is declared?actorStatementpq:P453 ?role.# the actors were cast as given roles?rolewdt:P31 wd:Q74359 .# roles that happen to be that of HobbitsSERVICEwikibase:label {bd:serviceParam wikibase:language "en".}}