Commit 664e85fe0f2852544a43a0ffabc97c825b8f53bf

Authored by Barry Norton
1 parent 6d057d7824
Exists in master

Started adding annotations

Showing 5 changed files with 52 additions and 25 deletions

mappings/area.ttl View file @ 664e85f
... ... @@ -22,12 +22,39 @@
22 22  
23 23 # MB area => geo:SpatialThing
24 24  
25   -#pt.dbpedia.org wasn't resolving - to check
26   -lb:area_dbpedia a rr:TriplesMap ;
  25 +lb:sm_area rr:template "http://musicbrainz.org/area/{gid}#_" .
  26 +
  27 +lb:area a rr:TriplesMap ;
27 28 rr:logicalTable [rr:tableName "area"] ;
28 29 rr:subjectMap [rr:template "http://musicbrainz.org/area/{gid}#_" ;
29 30 rr:class geo:SpatialThing] ;
30 31 rr:predicateObjectMap
31 32 [rr:predicate rdfs:label ;
32   - rr:objectMap [rr:column "name"]] .
  33 + rr:objectMap [rr:column "name"]] ,
  34 + [rr:predicate ov:sortLabel ;
  35 + rr:objectMap [rr:column "sort_name"]] .
  36 +
  37 +
  38 +lb:area_iso_3166_1 a rr:TriplesMap ;
  39 + rr:logicalTable [rr:sqlQuery """SELECT gid, code
  40 + FROM area
  41 + INNER JOIN iso_3166_1
  42 + ON area.id = iso_3166_1.area"""] ;
  43 + rr:subjectMap lb:sm_area ;
  44 + rr:predicateObjectMap
  45 + [rr:predicate owl:sameAs ;
  46 + rr:objectMap [rr:template "http://ontologi.es/place/{code}" ;
  47 + rr:termType rr:IRI]] .
  48 +
  49 +lb:area_annotation a rr:TriplesMap ;
  50 + rr:logicalTable [rr:sqlQuery
  51 + """SELECT gid, text
  52 + FROM annotation
  53 + INNER JOIN area_annotation
  54 + ON annotation.id = area_annotation.annotation
  55 + INNER JOIN area ON area_annotation.area = area.id"""] ;
  56 + rr:subjectMap lb:sm_area ;
  57 + rr:predicateObjectMap
  58 + [rr:predicate rdfs:comment ;
  59 + rr:objectMap [rr:column "text"]] .
mappings/label.ttl View file @ 664e85f
... ... @@ -43,24 +43,15 @@
43 43 rr:objectMap [rr:template "http://musicbrainz.org/area/{area}#_" ;
44 44 rr:termType rr:IRI]] .
45 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   -
57   -# ] ;
58   -# <http://www.w3.org/ns/r2rml#predicateObjectMap> #ERROR with Ultrawrap
59   -# [ <http://www.w3.org/ns/r2rml#objectMap>
60   -# [ <http://www.w3.org/ns/r2rml#parentTriplesMap>
61   -# <file:///home/kurtjx/srcs/d2r-server-0.7/mapping.n3#LabelActivity>
62   -# ] ;
63   -# <http://www.w3.org/ns/r2rml#predicate>
64   -# <http://purl.org/ontology/mo/activity>
65   -# ] ;
  46 +lb:label_annotation a rr:TriplesMap ;
  47 + rr:logicalTable [rr:sqlQuery
  48 + """SELECT gid, text
  49 + FROM annotation
  50 + INNER JOIN label_annotation
  51 + ON annotation.id = label_annotation.annotation
  52 + INNER JOIN label ON label_annotation.label = label.id"""] ;
  53 + rr:subjectMap lb:sm_label ;
  54 + rr:predicateObjectMap
  55 + [rr:predicate rdfs:comment ;
  56 + rr:objectMap [rr:column "text"]] .
mappings/work.ttl View file @ 664e85f
... ... @@ -55,4 +55,16 @@
55 55 [rr:predicate foaf:isPrimaryTopicOf ;
56 56 rr:objectMap [rr:column "url" ;
57 57 rr:termType rr:IRI]] .
  58 +
  59 +lb:work_annotation a rr:TriplesMap ;
  60 + rr:logicalTable [rr:sqlQuery
  61 + """SELECT gid, text
  62 + FROM annotation
  63 + INNER JOIN work_annotation
  64 + ON annotation.id = work_annotation.annotation
  65 + INNER JOIN work ON work_annotation.work = work.id"""] ;
  66 + rr:subjectMap lb:sm_work ;
  67 + rr:predicateObjectMap
  68 + [rr:predicate rdfs:comment ;
  69 + rr:objectMap [rr:column "text"]] .
musicbrainz_compile_config.properties View file @ 664e85f
1 1 NS =
2 2 outputFileName = musicbrainz.ttl
3 3 schema = musicbrainz
4   -connectionUrl = jdbc:postgresql://localhost:5432/musicbrainz_db_slave?user=musicbrainz&password=musicbrainz
  4 +connectionUrl = jdbc:postgresql://localhost:5432/musicbrainz?user=musicbrainz&password=musicbrainz
5 5 driver = org.postgresql.Driver
6 6 maxSizeOfKey = 3
publications/SMAM2013/Paper/SMAM2013Paper.pdf View file @ 664e85f

No preview for this file type