query-9b66ed4a35c6a1ab34c30ae6c075dcf8
Query for songs whose title contains a proper nameMy try was this:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?compositorLabel ?nacionalidadLabel ?nombreLabel ?cancionLabel WHERE {
?cancion wdt:P31 wd:Q7366. #there is some song (obvious)
?cancion wdt:P86 ?compositor. #that has some composer
?compositor wdt:P27 ?nacionalidad. #this composer has born at these place
?nombre wdt:P31 wd:Q1071027. #this proper name
FILTER(CONTAINS(LCASE(?cancionLabel), ?nombrelabel)). #is part of the song title.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?cancion")
v1("?cancionLabel"):::projected
v4("?compositor")
v5("?nacionalidad")
v6("?nombre")
v2("?nombrelabel")
c2(["wd:Q7366"]):::iri
c7(["bd:serviceParam"]):::iri
c9(["en"]):::literal
c5(["wd:Q1071027"]):::iri
f0[["contains(lower-case(?cancionLabel),?nombrelabel)"]]
f0 --> v1
f0 --> v2
v3 --"wdt:P31"--> c2
v3 --"wdt:P86"--> v4
v4 --"wdt:P27"--> v5
v6 --"wdt:P31"--> c5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end