query-4965aab4e2b1ae4a438f698f9a380b6c

rq turtle/ttl

Copyright term(s) of a country SELECT DISTINCT ?item ?itemLabel ( GROUP_CONCAT ( DISTINCT ?partLabel; SEPARATOR=", ") AS ?appliesToParts ) # Concatenate types of works WHERE { {?item wdt:P279 wd:Q108698760 . } # Look for group of countries with post mortem auctoris copyright... UNION # ...or... { ?item wdt:P279 wd:Q108701480 . } # ...group of countries with copyright based on publication date. ?item p:P1001 ?countryStatement . ?countryStatement ps:P1001 wd:Q241 . # Select a specific country. OPTIONAL { ?countryStatement pq:P518 ?part . } # Get the types of works to which the copyright term applies. SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . ?item rdfs:label ?itemLabel . # Necessary to concatenate types of works. ?part rdfs:label ?partLabel . # Necessary to concatenate types of works. } } GROUP BY ?item ?itemLabel

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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Copyright term(s) of a country
SELECT DISTINCT ?item ?itemLabel ( GROUP_CONCAT ( DISTINCT ?partLabel; SEPARATOR=", ") AS ?appliesToParts )  # Concatenate types of works
WHERE { 
  {?item wdt:P279 wd:Q108698760 . }  # Look for group of countries with post mortem auctoris copyright...
  UNION  # ...or...
  { ?item wdt:P279 wd:Q108701480 . }  # ...group of countries with copyright based on publication date.
  ?item p:P1001 ?countryStatement . 
  ?countryStatement ps:P1001 wd:Q241 .  # Select a specific country.
  OPTIONAL { ?countryStatement pq:P518 ?part . }  # Get the types of works to which the copyright term applies.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . 
                          ?item rdfs:label ?itemLabel .  # Necessary to concatenate types of works.
                          ?part rdfs:label ?partLabel .  # Necessary to concatenate types of works.
                         } 
} 
GROUP BY ?item ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?appliesToParts") v2("?countryStatement") v1("?item"):::projected v4("?itemLabel"):::projected v3("?part") v5("?partLabel"):::projected c9(["bd:serviceParam"]):::iri c3(["wd:Q108701480"]):::iri c2(["wd:Q108698760"]):::iri c11(["en"]):::literal c6(["wd:Q241"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P279"--> c3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P279"--> c2 end union0r <== or ==> union0l end v1 --"p:P1001"--> v2 v2 --"p:statement/P1001"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P518".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 v1 --"rdfs:label"--> v4 v3 --"rdfs:label"--> v5 end bind1[/"?partLabel"/] v5 --o bind1 bind1 --as--o v6