source: main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/prepare/errata/fix-problem-songs--using-errata.sparql@ 34813

Last change on this file since 34813 was 34813, checked in by davidb, 3 years ago

Snapshot of work (2nd go) on errata

File size: 1.5 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
16SELECT ?country_in_year (?year AS ?Year) (?country AS ?Country) ?entrant ?song
17
18WHERE {
19 SERVICE <https://dbpedia.demo.openlinksw.com/sparql> {
20 ?countries_in_esc_by_year skos:broader dbc:Countries_in_the_Eurovision_Song_Contest_by_year.
21
22 ?country_in_year dct:subject ?countries_in_esc_by_year.
23 bind( REPLACE(str(?country_in_year), ".*(\\d{4})", "$1") as ?year).
24 FILTER ( xsd:integer(?year) < 2020).
25
26 ?country_in_year dbp:country ?country.
27
28 ?country_in_year dbp:entrant ?entrant
29 FILTER (isURI(?entrant)).
30
31 ?country_in_year dbp:song ?song_errata
32 FILTER (isLITERAL(?song_errata)).
33 }
34
35 ?song dct:source ?song_errata.
36
37 SERVICE <https://dbpedia.demo.openlinksw.com/sparql> {
38 ?song dbp:artist|dbp:as ?entrant.
39 }
40
41## ?song dct:source ?song_errata.
42
43 OPTIONAL {
44 SERVICE <https://dbpedia.demo.openlinksw.com/sparql> {
45 ?entrant rdfs:label ?entrant_label
46 FILTER (lang(?entrant_label) = 'en').
47 }
48 }
49}
50ORDER BY DESC(?countries_in_esc_by_year)
51
52
53
54
55
Note: See TracBrowser for help on using the repository browser.