Commit 16f1cd451f0b70ce8f7dedee74366a92cd76572c

Authored by Barry Norton
1 parent 29f3e1e394
Exists in master

Added area (just DBpedia linkset for now)

Showing 1 changed file with 48 additions and 0 deletions

mappings/area.ttl View file @ 16f1cd4
  1 +@prefix rr: <http://www.w3.org/ns/r2rml#> .
  2 +
  3 +@prefix lb: <https://github.com/LinkedBrainz/r2rml/v0.1#> .
  4 +@prefix ngs: <http://musicbrainz.org/NGS> .
  5 +
  6 +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
  7 +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
  8 +@prefix owl: <http://www.w3.org/2002/07/owl#> .
  9 +@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
  10 +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
  11 +@prefix dc: <http://purl.org/dc/elements/1.1/> .
  12 +@prefix mo: <http://purl.org/ontology/mo/> .
  13 +@prefix foaf: <http://xmlns.com/foaf/0.1/> .
  14 +@prefix ov: <http://open.vocab.org/terms/> .
  15 +@prefix dct: <http://purl.org/dc/terms/> .
  16 +@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
  17 +@prefix event: <http://purl.org/NET/c4dm/event.owl#> .
  18 +@prefix is: <http://purl.org/ontology/is/core#> .
  19 +@prefix isi: <http://purl.org/ontology/is/inst/> .
  20 +@prefix time: <http://www.w3.org/2006/time#> .
  21 +@prefix tl: <http://purl.org/NET/c4dm/timeline.owl#> .
  22 +
  23 +# MB area => DBpedia link
  24 +
  25 +lb:sm_area rr:template "http://musicbrainz.org/area/{gid}#_" .
  26 +
  27 +#pt.dbpedia.org wasn't resolving - to check
  28 +lb:area_dbpedia a rr:TriplesMap ;
  29 + rr:logicalTable [rr:sqlQuery
  30 + """SELECT artist.gid,
  31 + REPLACE(REPLACE(url, 'wikipedia.org/wiki',
  32 + 'dbpedia.org/resource'),
  33 + 'http://en.',
  34 + 'http://')
  35 + AS url
  36 + FROM artist
  37 + INNER JOIN l_area_url ON area.id = l_area_url.entity0
  38 + INNER JOIN link ON l_area_url.link = link.id
  39 + INNER JOIN link_type ON link_type = link_type.id
  40 + INNER JOIN url on l_area_url.entity1 = url.id
  41 + WHERE link_type.gid='9228621d-9720-35c3-ad3f-327d789464ec'
  42 + AND url SIMILAR TO
  43 + 'http://(de|el|en|es|ko|pl|pt).wikipedia.org/wiki/%'"""] ;
  44 + rr:subjectMap lb:sm_area ;
  45 + rr:predicateObjectMap
  46 + [rr:predicate owl:sameAs ;
  47 + rr:objectMap [rr:column "url"; rr:termType rr:IRI]] .