Programming novice very new to SPARQL. I am trying to get the following query to get me a list of albums by Bob Dylan or Elvis Presley. The resulting table should include album name and artist:
SELECT DISTINCT ?item ?itemLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
{
SELECT DISTINCT ?item WHERE {
?item p:P31 ?statement0.
?statement0 (ps:P31/(wdt:P279*)) wd:Q482994.
{
?item p:P175 ?statement1.
?statement1 (ps:P175/(wdt:P279*)) wd:Q392.
}
UNION
{
?item p:P175 ?statement2.
?statement2 (ps:P175/(wdt:P279*)) wd:Q303.
}
}
}
}
I am only able to get a list of albums.
New contributor
dublo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.