I have this SPARQL script meant to work on Wikidata:
SELECT
?game
(group_concat(distinct ?gameLabel ; separator = ", ") AS ?gameLabels)
(group_concat(distinct ?genreLabel ; separator = ", ") AS ?genreLabels)
WHERE {
?game wdt:P31 wd:Q7889;
wdt:P136 wd:Q744038.
OPTIONAL {?game wdt:P136 ?genre}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en".
?game rdfs:label ?gameLabel.
?genre rdfs:label ?genreLabel.
}
} GROUP BY $game
ORDER BY ASC (?gameLabel)
You can test the code here:
Currently, I am filtering for a genre named "role-playing video game". However, I do not want this string to appear in the result set. How do I filter out just this string but not the actual records? Thanks.