query-ab23eb8328b22bde1b71cd8604fa4887

rq turtle/ttl

Individual cats, with gender shown in an additionnal column (when known)

Use at

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 ?item ?itemLabel ?genderLabel
#select is used for choosing the columns to be displayed genderLabel is the label of the optional "gender" value below
WHERE
{
    ?item wdt:P31 wd:Q146 .
    OPTIONAL{?item wdt:P21 ?gender .}

    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?gender") v1("?item"):::projected c2(["wd:Q146"]):::iri c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"wdt:P31"--> c2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P21".-> v2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end