You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Search For Games With the "platform" of "Sega Mega Drive" and Additional Constraints
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/>SELECT*WHERE {
?game wdt:P400 wd:Q10676. # "platform" (wdt:P400), "Sega Mega Drive" (wd:Q10676)?game wdt:P31 wd:Q7889. # "instance of" (wdt:P31), "video game" (wd:Q7889)?game rdfs:label ?label. # label for "video game"# ?game wdt:P437 wd:Q633454. # uncomment this line to only include "distribution" (wdt:P437), "ROM cartridge" (wd:Q633454)# ?game wdt:P123 wd:Q122741. # uncomment this line to only include "publisher" (wdt:P123), "Sega" (wd:Q122741)OPTIONAL {
?game wdt:P852 ?esrb. # optionally get the "ESRB rating" (wdt:P852)?esrb rdfs:label ?rating. # optionally get the label of the "ESRB rating"FILTER (LANG(?rating) = "en"). # require an English label
}
FILTER (LANG(?label) = "en"). # require an English labelFILTER NOT EXISTS {
?game wdt:P437 wd:Q7982. # must not be "distribution" (wdt:P437), "CD-ROM" (wd:Q7982)
}
}
ORDERBY?label
Search For Games With the "platform" of "Sega Mega Drive" and Additional Constraints With Tabular Format
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/>SELECT?game?name?publication_date?ratingWHERE {
?game wdt:P400 wd:Q10676. # "platform" (wdt:P400), "Sega Mega Drive" (wd:Q10676)?game wdt:P31 wd:Q7889. # "instance of" (wdt:P31), "video game" (wd:Q7889)?game rdfs:label ?name. # label for "video game"OPTIONAL {
?game wdt:P852 ?esrb. # optionally get the "ESRB rating" (wdt:P852)?game wdt:P577 ?publication_date. # optionally get the "date of publication" (wdt:P577)?esrb rdfs:label ?rating. # optionally get the label of the "ESRB rating"FILTER (LANG(?rating) = "en"). # require an English label if a "rating" exists
}
FILTER (LANG(?name) = "en"). # require an English label
}
ORDERBY?name
Search For All the ESRB Ratings
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/>SELECTDISTINCT?ratingWHERE {
?esrb_rating_category wdt:P31 wd:Q23683568. # instance of (P31), ESRB rating category (Q23683568)?esrb_rating_category rdfs:label ?rating# label of "ESRB rating category"FILTER((LANG(?rating)) = "en") # require an English label
}
ORDERBY?rating
Search For the Game Name, Game Mode, Genre, and Rating For "Sega Mega Drive" Which Are Also Published By Sega
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/>SELECT?_game?name?publisher?developer?platform?game_mode?genre?ratingWHERE {
?_game wdt:P400 wd:Q10676. # "platform" (wdt:P400), "Sega Mega Drive" (wd:Q10676)?_game wdt:P400 ?_platform. # get the "platform" (wdt:P400)?_platform rdfs:label ?platform. # label for "platform"?_game wdt:P123 wd:Q122741. # "publisher" (wdt:P123), "Sega" (wd:Q122741)?_game wdt:P123 ?_publisher. # get the "publisher" (wdt:P123)?_publisher rdfs:label ?publisher. # label for "publisher"?_game wdt:P31 wd:Q7889. # "instance of" (wdt:P31), "video game" (wd:Q7889)?_game rdfs:label ?name. # label for "video game"OPTIONAL {
?_game wdt:P178 ?_developer. # get the "developer" (wdt:P178)?_developer rdfs:label ?developer. # label for "developer"?_game wdt:P404 ?_game_mode. # get the "game mode" (wdt:P404)?_game_mode rdfs:label ?game_mode. # label for "game mode"?_game wdt:P136 ?_genre. # get the "genre" (wdt:P136)?_genre rdfs:label ?genre. # label for "genre"?_game wdt:P852 ?_rating. # get the "rating" (wdt:P852)?_rating rdfs:label ?rating. # label for "rating"FILTER((LANG(?developer)) = "en") # require an English labelFILTER((LANG(?game_mode)) = "en") # require an English labelFILTER((LANG(?genre)) = "en") # require an English labelFILTER((LANG(?rating)) = "en") # require an English label
}
MINUS {
?_game wdt:P400 wd:Q1063978. # minus "platform" (wdt:P400), "Sega 32X" (wd:Q1063978)
}
FILTER((LANG(?name)) = "en") # require an English labelFILTER((LANG(?platform)) = "en") # require an English labelFILTER((LANG(?publisher)) = "en") # require an English labelFILTER regex(?publisher, "Sega") # filter out any of the non-Sega published releasesFILTER regex(?platform, "Sega Mega Drive") # filter out any of the non-Sega Mega Drive releasesFILTER NOT EXISTS {
?_game wdt:P437 wd:Q7982. # filter out "distribution" (wdt:P437), "CD-ROM" (wd:Q7982)
}
}
ORDERBY?name
https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual#SPARQL_endpoint