I want to retrieve all the related objects of an entity and their labels, but I'm struggling against how the label service and the distinction between statements and (actual) entities works in Wikidata.
For example, given a query such as this one:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT ?plabel ?o ?statement ?statement_valueLabel
WHERE
{
wd:Q9671 ?p ?o. # Michael Schumacher
# Get the predicate's label
?pEntity wikibase:claim ?p .
OPTIONAL {
?pEntity rdfs:label ?plabel .
FILTER (LANG(?plabel) = "en")
}
# (Try) to get the object's label by accessing the claim
?o ?statement ?statement_value.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } # gives ?statement_valueLabel
}
I can manage to get the label of the statement, but in the process I also pull the statement's metadata which I don't want. For example:
Am I doing this wrong? How can I simply get e.g position held UNICED Goodwill Ambassador?

SELECT ?plabel ?statement_valueLabel WHERE { wd:Q9671 ?p ?stmt. # Michael Schumacher # Get the predicate's label ?pEntity wikibase:claim ?p . ?pEntity wikibase:statementProperty ?stmt_prop. OPTIONAL { ?pEntity rdfs:label ?plabel . FILTER (LANG(?plabel) = "en") } # (Try) to get the object's label by accessing the claim ?stmt ?stmt_prop ?statement_value. SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } # gives ?statement_valueLabel }