Commit d4f9bb9c0be1fe7797d9fb764a1a97d32449bfe9

Authored by Barry Norton
1 parent 5d2752861e
Exists in master

Changed country to area join for labels

Showing 1 changed file with 21 additions and 10 deletions

mappings/label.ttl View file @ d4f9bb9
... ... @@ -32,7 +32,28 @@
32 32 [rr:predicate mo:musicbrainz_guid ;
33 33 rr:objectMap [rr:column "gid" ; rr:datatype xsd:string]] .
34 34  
  35 +lb:label_area a rr:TriplesMap ;
  36 + rr:logicalTable[rr:sqlQuery
  37 + """SELECT label.gid, area.gid AS area
  38 + FROM label
  39 + INNER JOIN area ON label.area = area.id"""] ;
  40 + rr:subjectMap lb:sm_label ;
  41 + rr:predicateObjectMap
  42 + [rr:predicate foaf:based_near ;
  43 + rr:objectMap [rr:template "http://musicbrainz.org/area/{area}#_" ;
  44 + rr:termType rr:IRI]] .
35 45  
  46 +#lb:label_country a rr:TriplesMap ;
  47 +# rr:logicalTable [rr:sqlQuery
  48 +# """SELECT label.gid, country.iso_code
  49 +# FROM label
  50 +# INNER JOIN country ON country.id = label.country"""] ;
  51 +# rr:subjectMap lb:sm_label ;
  52 +# rr:predicateObjectMap
  53 +# [rr:predicate foaf:based_near ;
  54 +# rr:objectMap [rr:template "http://ontologi.es/place/{iso_code}" ;
  55 +# rr:termType rr:IRI]] .
  56 +
36 57 # ] ;
37 58 # <http://www.w3.org/ns/r2rml#predicateObjectMap> #ERROR with Ultrawrap
38 59 # [ <http://www.w3.org/ns/r2rml#objectMap>
... ... @@ -42,15 +63,4 @@
42 63 # <http://www.w3.org/ns/r2rml#predicate>
43 64 # <http://purl.org/ontology/mo/activity>
44 65 # ] ;
45   -
46   -lb:label_country a rr:TriplesMap ;
47   - rr:logicalTable [rr:sqlQuery
48   - """SELECT label.gid, country.iso_code
49   - FROM label
50   - INNER JOIN country ON country.id = label.country"""] ;
51   - rr:subjectMap lb:sm_label ;
52   - rr:predicateObjectMap
53   - [rr:predicate foaf:based_near ;
54   - rr:objectMap [rr:template "http://ontologi.es/place/{iso_code}" ;
55   - rr:termType rr:IRI]] .