query-88897fc7e22ba0f90e901c2864d00804

rq turtle/ttl

Authors from a country who died 100 or more years ago and expired copyright status is not set SELECT DISTINCT ?item ?itemLabel ( GROUP_CONCAT(DISTINCT ?occupationLabel; SEPARATOR=", ") AS ?occupations ) # Concatenate occupations WHERE {
?item wdt:P31 wd:Q5 . # Instance of human being... VALUES ?occupation { wd:Q36180 wd:Q1028181 wd:Q1281618 wd:Q49757 wd:Q1930187 wd:Q639669 wd:Q36834 }. # List of occupations ?item wdt:P106 ?occupation . # The person has those occupations { ?item wdt:P19/wdt:P131* wd:Q77 . } # The person was born in Uruguay or in a place located in the administrative territorial entity of Uruguay... UNION # ...or... { ?item wdt:P27 wd:Q77 . } # ...their country of citizenship is Uruguay. ?item wdt:P570 ?death . # The person died... FILTER ( ?death < "1924-01-01"^^xsd:dateTime ) # ...before a certain date. MINUS { ?item wdt:P7763 ?copyrightStatus. } # The item of the person has not a certain property. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?item rdfs:label ?itemLabel. # Necessary to concatenate occupations ?occupation rdfs:label ?occupationLabel. # Necessary to concatenate occupations } } GROUP BY ?item ?itemLabel # Group results for the same person.

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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#>
# Authors from a country who died 100 or more years ago and expired copyright status is not set
SELECT DISTINCT ?item ?itemLabel ( GROUP_CONCAT(DISTINCT ?occupationLabel; SEPARATOR=", ") AS ?occupations )  # Concatenate occupations
WHERE {  
    ?item wdt:P31 wd:Q5 .            # Instance of human being...
  VALUES  ?occupation { wd:Q36180 wd:Q1028181 wd:Q1281618 wd:Q49757 wd:Q1930187 wd:Q639669 wd:Q36834 }.  # List of occupations
  ?item wdt:P106 ?occupation .  # The person has those occupations
  { ?item wdt:P19/wdt:P131* wd:Q77 . }  # The person was born in Uruguay or in a place located in the administrative territorial entity of Uruguay...
  UNION                                 # ...or...
  { ?item wdt:P27 wd:Q77 . }            # ...their country of citizenship is Uruguay.
  ?item wdt:P570 ?death .               # The person died...
  FILTER ( ?death < "1924-01-01"^^xsd:date )  # ...before a certain date.
  MINUS { ?item wdt:P7763 ?copyrightStatus. }  # The item of the person has not a certain property.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". 
                          ?item rdfs:label ?itemLabel.               # Necessary to concatenate occupations
                          ?occupation rdfs:label ?occupationLabel.   # Necessary to concatenate occupations
                         }
}
GROUP BY ?item ?itemLabel  # Group results for the same person.

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?copyrightStatus") v1("?death") v2("?item"):::projected v5("?itemLabel"):::projected v3("?occupation") v6("?occupationLabel"):::projected v7("?occupations") a1((" ")) c7(["wd:Q77"]):::iri c12(["bd:serviceParam"]):::iri c3(["wd:Q5"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?death < '1924-01-01^^xsd:date'"]] f0 --> v1 v2 --"wdt:P31"--> c3 bind1[/VALUES ?occupation/] bind1-->v3 bind10(["wd:Q36180"]) bind10 --> bind1 bind11(["wd:Q1028181"]) bind11 --> bind1 bind12(["wd:Q1281618"]) bind12 --> bind1 bind13(["wd:Q49757"]) bind13 --> bind1 bind14(["wd:Q1930187"]) bind14 --> bind1 bind15(["wd:Q639669"]) bind15 --> bind1 bind16(["wd:Q36834"]) bind16 --> bind1 v2 --"wdt:P106"--> v3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P27"--> c7 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P19"--> a1 a1 --"wdt:P131"--> c7 end union0r <== or ==> union0l end v2 --"wdt:P570"--> v1 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P7763"--> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 v2 --"rdfs:label"--> v5 v3 --"rdfs:label"--> v6 end bind4[/"?occupationLabel"/] v6 --o bind4 bind4 --as--o v7