I am trying to complete the following case in SPARQL. I want to return the labels of the deathPlace for the Greek writer "Nikos Kazantzakis"
The workspace to copy-paste the queries below.
I am running the following query:
PREFIX dp: <https://dbpedia.org/page/West_Germany>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT (?musician as ?musicianName) ?nationality ?deathTime ?deathPlaceLabel ?abstarct
WHERE
{
?musician rdfs:label "Nikos Kazantzakis" @en .
?musician dbo:nationality ?nationality .
?musician dbo:deathDate ?deathTime .
?musician dbo:deathPlace ?deathPlaceLabel .
#dp:commonName ?deathPlaceLabel?deathPlaceLabel .
?musician dbo:abstract ?abstarct .
FILTER (lang(?abstarct) = 'en')
}
This has the following result:
The ?deathPlaceLabel value is printed but as the hyperlink resource. Is it feasible to enter each property (i.e. dbr:West_Germany, dbr:Germany, dbr:Freiburg) and print their labels?
What I tried is to pass the West_Germnay resource to a prefix and then call the "commonName" property from that prefix. Likewise,
PREFIX dp: <https://dbpedia.org/page/West_Germany>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT (?musician as ?musicianName) ?nationality ?deathTime ?deathPlaceLabel ?abstarct
WHERE
{
?musician rdfs:label "Nikos Kazantzakis" @en .
?musician dbo:nationality ?nationality .
?musician dbo:deathDate ?deathTime .
#?musician dbo:deathPlace ?deathPlaceLabel .
?dplabel dp:commonName ?deathPlaceLabel .
?musician dbo:abstract ?abstarct .
FILTER (lang(?abstarct) = 'en')
}
But I seem to retrieve an empty column(s) result.