Which is the correct query to retrieve all game titles, and if present their rel
ID: 3838289 • Letter: W
Question
Which is the correct query to retrieve all game titles, and if present their release date, their series, and their director.
1 SELECT ?title ?releasedate ?series ?director WHERE {?game rdfs:label ?title .
OPTIONAL { ?game dbo:releaseDate ?releasedate }
OPTIONAL { ?game dbo:series ?series }
OPTIONAL { ?game dbo:director ?director }
} 2 SELECT ?title ?releasedate ?series ?director WHERE {
?game rdfs:label ?title .
?game dbo:releaseDate OPTIONAL { ?releasedate } .
?game dbo:series OPTIONAL { ?series } .
?game dbo:director OPTIONAL { ?director } .
} 3 SELECT ?title ?releasedate ?series ?director WHERE {
?game rdfs:label ?title .
OPTIONAL {
?game dbo:releaseDate ?releasedate .
?game dbo:series ?series .
?game dbo:director ?director }
} 4 SELECT ?title OPTIONAL(?releasedate ?series ?director) WHERE {
?game rdfs:label ?title .
?game dbo:releaseDate ?releasedate .
?game dbo:series ?series .
?game dbo:director ?director .
}
Explanation / Answer
Answer will be 2
SELECT ?title ?releasedate ?series ?director WHERE {
?game rdfs:label ?title .
?game dbo:releaseDate OPTIONAL { ?releasedate } .
?game dbo:series OPTIONAL { ?series } .
?game dbo:director OPTIONAL { ?director } .
}
Line 1 - Data of row title , releasedate , series , director will be highlighted
Line 2 - where game title is present
Line 3 - if releasedate of that game title is present select it else go to series
Line 4- if series of that game title is present select it else go to director
Line 5- if director of that game title is present select it.
If any problem occurs in understanding,just comment it , will try to solve it as soon as possible.Thankyou
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.