Commit 1eac259c98e4dd510a706c5276709eb85637beb3

Authored by Barry Norton
1 parent 1f551c6f88
Exists in master

Fixed medium

Showing 1 changed file with 5 additions and 18 deletions

mappings/medium.ttl View file @ 1eac259
... ... @@ -27,34 +27,21 @@
27 27 lb:Medium a rr:TriplesMap ;
28 28 rr:logicalTable [rr:tableName "medium"] ;
29 29 rr:subjectMap [rr:class mo:Record ;
30   - rr:template "http://musicbrainz.org/record/{id}#_"] .
31   -
32   -lb:medium_name a rr:TriplesMap ;
33   - rr:logicalTable [rr:tableName "medium"] ;
34   - rr:subjectMap lb:sm_medium ;
  30 + rr:template "http://musicbrainz.org/record/{id}#_"] ;
35 31 rr:predicateObjectMap
36 32 [rr:predicate dc:title ;
37   - rr:objectMap [rr:column "name" ; rr:datatype xsd:string]] .
  33 + rr:objectMap [rr:column "name" ; rr:datatype xsd:string]] ,
  34 + [rr:predicate mo:track_count ;
  35 + rr:objectMap [rr:column "track_count" ; rr:datatype xsd:int]] .
38 36  
39 37 lb:medium_track a rr:TriplesMap ;
40 38 rr:logicalTable [rr:sqlQuery
41 39 """SELECT medium.id, track.id AS track_id
42 40 FROM medium
43   - INNER JOIN tracklist ON medium.tracklist = tracklist.id
44   - INNER JOIN track ON track.tracklist = tracklist.id"""] ;
  41 + INNER JOIN track ON track.medium = medium.id"""] ;
45 42 rr:subjectMap lb:sm_medium ;
46 43 rr:predicateObjectMap [
47 44 rr:predicate mo:track ;
48 45 rr:objectMap [rr:template "http://musicbrainz.org/track/{track_id}#_" ;
49 46 rr:termType rr:IRI]] .
50   -
51   -lb:medium_track_count a rr:TriplesMap ;
52   - rr:logicalTable [rr:sqlQuery
53   - """SELECT medium.id, tracklist.track_count
54   - FROM medium
55   - INNER JOIN tracklist ON medium.tracklist = tracklist.id"""];
56   - rr:subjectMap lb:sm_medium ;
57   - rr:predicateObjectMap
58   - [rr:predicate mo:track_count ;
59   - rr:objectMap [rr:column "track_count" ; rr:datatype xsd:int]] .