# Common prefixes across all queries PREFIX : PREFIX rdf: PREFIX xsd: PREFIX rdfs: PREFIX foaf: PREFIX rev: # How many consoles did Nintendo produce? SELECT COUNT(?console) AS ?numConsoles WHERE { ?console :madeBy ?organization . } GROUP BY ?organization # Which console(s) made by Nintendo came out after 1997? SELECT ?console WHERE { ?console :madeBy :Nintendo . ?console :releaseYear ?releaseYear . FILTER(?releaseYear > 1997) } # About which consoles do we not know their number of supported controllers yet if they are NOT portable game consoles? SELECT ?console WHERE { ?console rdf:type :GameConsole . FILTER NOT EXIST { ?console rdf:type :PortableGameConsole . } FILTER NOT EXIST { ?console :numOfSupportedControllers ?anyNumber . } } # Is there a game console without a review? ASK { ?console rdf:type :GameConsole . FILTER NOT EXIST { ?console rev:hasReview ?anyReview . } } # Show all Consoles that have at least one review SELECT DISTINCT ?console WHERE { ?console rev:hasReview ?anyReview . } # Construct triples for something different # Map CEO to consoles CONSTRUCT { ?ceo :isRelatedToConsole ?console . } WHERE { ?console rdf:type :GameConsole . ?console :madeBy ?org . ?org :ceo ?ceo . ?ceo rdf:type foaf:Person . }