query-d387581b72f370e563edf638cbda1a02
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?person ?personLabel ?mother_family_nameLabel ?father_family_nameLabel
WHERE {
{
SELECT ?person ?personLabel ?mother_family_nameLabel ?father_family_name WHERE {
{
SELECT ?person ?mother_family_name ?father_family_name WHERE {
?person wdt:P25 [wdt:P734 ?mother_family_name] ;
wdt:P22 [wdt:P734 ?father_family_name] .
FILTER(?mother_family_name != ?father_family_name)
}
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
?person rdfs:label ?personLabel .
?mother_family_name rdfs:label ?mother_family_nameLabel .
}
FILTER(CONTAINS(?personLabel, CONCAT(?mother_family_nameLabel, "-")))
}
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
?father_family_name rdfs:label ?father_family_nameLabel .
}
FILTER(CONTAINS(?personLabel, CONCAT("-", ?father_family_nameLabel)))
} ORDER BY ASC(?mother_family_nameLabel) ASC(?father_family_nameLabel) ASC(?personLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?father_family_name")
v2("?father_family_nameLabel"):::projected
v4("?mother_family_name")
v1("?mother_family_nameLabel"):::projected
v6("?person"):::projected
v3("?personLabel"):::projected
a1((" "))
a2((" "))
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["contains(?personLabel,concat('-',?father_family_nameLabel))"]]
f0 --> v3
f0 --> v2
f1[["contains(?personLabel,concat(?mother_family_nameLabel,'-'))"]]
f1 --> v3
f1 --> v1
f2[["?mother_family_name != ?father_family_name"]]
f2 --> v4
f2 --> v5
a1 --"wdt:P734"--> v4
v6 --"wdt:P25"--> a1
a2 --"wdt:P734"--> v5
v6 --"wdt:P22"--> a2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
v6 --"rdfs:label"--> v3
v4 --"rdfs:label"--> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
v5 --"rdfs:label"--> v2
end