source: gs3-installations/eurovision-lod/trunk/sites/eurovision/collect/eurovision/prepare/errata-lod/local--countries-in-esc-by-year-in-1956--with-errata.sparql@ 37319

Last change on this file since 37319 was 37305, checked in by davidb, 16 months ago

Changed to handling 1956 with full data triples

File size: 2.6 KB
Line 
1prefix skos: <http://www.w3.org/2004/02/skos/core#>
2prefix dct: <http://purl.org/dc/terms/>
3prefix xsd: <http://www.w3.org/2001/XMLSchema#>
4
5PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
6PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
7
8prefix dbc: <http://dbpedia.org/resource/Category:>
9prefix dbr: <http://dbpedia.org/resource/>
10prefix dbp: <http://dbpedia.org/property/>
11
12PREFIX dbo: <http://dbpedia.org/ontology/>
13
14PREFIX prov: <http://www.w3.org/ns/prov#>
15
16
17SELECT ?countries_in_esc_by_year ?country_in_year (?year AS ?Year) (?country AS ?Country) (?song_label_3char as ?TitleDisambiguation)
18 ?entrant_robust (?entrant_label AS ?Creator) ?song_robust (?song_label AS ?Title)
19 (?country_in_year_abstract_en AS ?Abstract_en)
20 (?song_abstract_en AS ?TitleAbstract_en) (?entrant_abstract_en AS ?CreatorAbstract_en)
21 (?was_derived_from AS ?WikipediaURL)
22WHERE {
23
24 SERVICE <https://dbpedia.org/sparql> {
25 ?countries_in_esc_by_year skos:broader dbc:Countries_in_the_Eurovision_Song_Contest_by_year.
26
27 ?country_in_year dct:subject ?countries_in_esc_by_year.
28
29 bind( REPLACE(str(?country_in_year), ".*(\\d{4})", "$1") AS ?year).
30 FILTER ( xsd:integer(?year) = 1956).
31
32 }
33
34 ?country_in_year dbp:country ?country.
35
36 ?country_in_year dbp:entrant ?entrant_robust.
37
38 ?country_in_year dbp:song ?song_robust.
39
40 # Additional 1956 check to avoid cross-product
41 ?song_robust dbp:artist ?entrant_robust.
42
43 # Create more DL friendly entrant-title metadata from Wikipedia entrant-uri/label
44 BIND(REPLACE(REPLACE(str(?entrant_robust), "^.*/(.*?)(_+\\(.*(singer|duo|band|group|musician)\\))?$", "$1"),"_"," ") AS ?entrant_label).
45
46 # Create more DL friendly song-title metadata from Wikipedia song-uri/label
47 BIND(REPLACE(REPLACE(str(?song_robust), "^.*/(.*?)(_+\\(.*song\\))?$", "$1"),"_"," ") AS ?song_label).
48
49 BIND(UCASE(SUBSTR(REPLACE(?song_label," ",""),1,3)) AS ?song_label_3char).
50
51 OPTIONAL {
52 SERVICE <https://dbpedia.org/sparql> {
53 ?song_robust prov:wasDerivedFrom ?was_derived_from.
54 }
55 }
56 OPTIONAL {
57 SERVICE <https://dbpedia.org/sparql> {
58 ?country_in_year dbo:abstract ?country_in_year_abstract_en
59 FILTER (lang(?country_in_year_abstract_en) = 'en').
60 }
61 }
62 OPTIONAL {
63 SERVICE <https://dbpedia.org/sparql> {
64 ?entrant_robust dbo:abstract ?entrant_abstract_en
65 FILTER (lang(?entrant_abstract_en) = 'en').
66 }
67 }
68 OPTIONAL {
69 SERVICE <https://dbpedia.org/sparql> {
70 ?song_robust dbo:abstract ?song_abstract_en
71 FILTER (lang(?song_abstract_en) = 'en').
72
73 }
74 }
75}
76ORDER BY ASC(?countries_in_esc_by_year) ?country
77
Note: See TracBrowser for help on using the repository browser.