query-fb2fe51937f024f1e82b5f0772b3ecdf

rq turtle/ttl

People born on Independence day PREFIX xsd: http://www.w3.org/2001/XMLSchema# PREFIX schema: http://schema.org/

SELECT ?personItem ?wikis ?person ?personDescription ?date ?Occupation ?Gender ?image
(IF(BOUND(?personDescription), CONCAT(?person, " (", ?personDescription, ")"), ?person) AS ?title) WHERE { { SELECT ?personItem ?date ?occupationItem ?genderItem (SAMPLE(?image) AS ?image) (COUNT(DISTINCT ?article) AS ?wikis) WHERE { ?personItem wdt:P569 ?date. ?personItem wdt:P18 ?image. ?personItem wdt:P21 ?genderItem. ?personItem wdt:P106 ?occupationItem. ?personItem wdt:P27 wd:Q668 . OPTIONAL { ?article schema:about ?personItem. FILTER((SUBSTR(STR(?article), 12, 19)) = "wikipedia.org/wiki/") } FILTER(((DATATYPE(?date)) = xsd:dateTime) && ((MONTH(?date)) = 8) && ((DAY(?date)) = 15)) } GROUP BY ?personItem ?date ?occupationItem ?genderItem } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?personItem schema:description ?personDescription. ?personItem rdfs:label ?person. ?occupationItem rdfs:label ?Occupation. ?genderItem rdfs:label ?Gender. } } ORDER BY DESC(?rank)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#People born on Independence day
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX schema: <http://schema.org/>

SELECT ?personItem ?wikis ?person ?personDescription ?date ?Occupation ?Gender ?image  
(IF(BOUND(?personDescription), CONCAT(?person, " (", ?personDescription, ")"), ?person) AS ?title) 
WHERE {
  {
    SELECT ?personItem ?date ?occupationItem ?genderItem (SAMPLE(?image) AS ?image) (COUNT(DISTINCT ?article) AS ?wikis) 
      WHERE {
      ?personItem wdt:P569 ?date.
      ?personItem wdt:P18 ?image.
      ?personItem wdt:P21 ?genderItem.
      ?personItem wdt:P106 ?occupationItem.
      ?personItem wdt:P27 wd:Q668 .
      OPTIONAL {
        ?article schema:about ?personItem.
        FILTER((SUBSTR(STR(?article), 12, 19)) = "wikipedia.org/wiki/")
      }
      FILTER(((DATATYPE(?date)) = xsd:dateTime) && ((MONTH(?date)) = 8) && ((DAY(?date)) = 15))
    }
    GROUP BY ?personItem ?date ?occupationItem ?genderItem
  }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?personItem schema:description ?personDescription.
    ?personItem rdfs:label ?person.
    ?occupationItem rdfs:label ?Occupation.
    ?genderItem rdfs:label ?Gender.
  }
}
ORDER BY DESC(?rank)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v12("?Gender"):::projected v11("?Occupation"):::projected v3("?article") v2("?date"):::projected v6("?genderItem") v8("?image"):::projected v7("?occupationItem") v10("?person"):::projected v9("?personDescription"):::projected v4("?personItem"):::projected v1("?rank") v13("?title") v8("?wikis"):::projected c15(["bd:serviceParam"]):::iri c12(["wd:Q668"]):::iri c17(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?date = 'xsd:dateTime'month-from-dateTime(?date) = '8^^xsd:integer'day-from-dateTime(?date) = '15^^xsd:integer'"]] f0 --> v2 v4 --"wdt:P569"--> v2 v4 --"wdt:P18"--> v8 v4 --"wdt:P21"--> v6 v4 --"wdt:P106"--> v7 v4 --"wdt:P27"--> c12 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."schema:about".-> v4 end bind3[/"sample(?image)"/] v8 --o bind3 bind3 --as--o v8 bind4[/"count(?article)"/] v3 --o bind4 bind4 --as--o v8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c15 --"wikibase:language"--> c17 v4 --"schema:description"--> v9 v4 --"rdfs:label"--> v10 v7 --"rdfs:label"--> v11 v6 --"rdfs:label"--> v12 end bind5[/"if(bound(?personDescription),concat(?person,' (',?personDescription,')'),?person)"/] v9 --o bind5 v10 --o bind5 bind5 --as--o v13