Commits

Stefano Costa  committed 7c55b75

Add skos:broader for sub-types.

Added all sub-types defined by Hayes to definition file.

  • Participants
  • Parent commits a2d55a5

Comments (0)

Files changed (2)

File arsw-hayes.py

     <skos:inScheme rdf:resource="http://archvocab.net/fineware/arsw-hayes/arsw-hayes_scheme"/>
     <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
     <skos:prefLabel xml:lang="en">Hayes {0}</skos:prefLabel>
-""" + RDF_CLOSEDESC
+"""
+
+BROADER = DESC + """    <skos:broadMatch rdf:resource="http://archvocab.net/fineware/arsw-hayes/{2}">
+"""
 
 FOOTER = """</rdf:RDF>"""
 
     output.write(bytes(HEADER, 'utf-8'))
 
     for i in input_data:
-        output.write(bytes(DESC.format(i, quote_plus(i)), 'utf-8'))
+        if ':' in i:
+            broad, narrow = i.split(':')
+            output.write(bytes(BROADER.format(narrow,
+                                              quote_plus(narrow),
+                                              quote_plus(broad)),
+                               'utf-8'))
+        else:
+            output.write(bytes(DESC.format(i, quote_plus(i)), 'utf-8'))
+        output.write(bytes(CLOSEDESC, 'utf-8'))
 
     output.write(bytes(FOOTER, 'utf-8'))
     output.close()

File arsw-hayes.txt

 1
 2
 3
+3:3A
+3:3B
+3:3C
+3:2/3B
 4
+4:4A
+4:4B
 5
+5:5A
+5:5B
+5:5C
 6
+6:6A
+6:6B
 7
+7:7A
+7:7B
 8
+8:8A
+8:8B
 9
+9:9A
+9:9B
 10
+10:10A
+10:10B
 11
-13
 14
+14:14A
+14:14B
+14:14C
 15
 16
 17
+17:17A
+17:17B
 18
 19
 20
 21
 22
 23
+23:23A
+23:23B
 24
 25
 26
 29
 30
 31
+27/31
 32
 33
 34
 43
 44
 45
+45:45A
+45:45B
+45:45C
 46
 47
 48
+48:48A
+48:48B
 49
 50
+50:50A
+50:50A/B
+50:50B
 51
+51:51A
+51:51B
 52
+52:52A
+52:52B
 53
+53:53A
+53:53B
 54
 55
 56
 57
 58
+58:58A
+58:58B
+58:32/58
 59
+59:59A
+59:59B
 60
 61
+61:61A
+61:61B
 62
+62:62A
+62:62B
 63
 64
 65
 66
 67
+67/71
 68
 69
 70
 71
 72
+72:72A
+72:72B
 73
+73:73A
+73:73B
 74
 75
 76
+76:76A
+76:76B
 77
 78
 79
 80
+80:80A
+80:80B
 81
+81:81A
+81:81B
 82
+82:82A
+82:82B
 83
 84
 85
+85:85A
+85:85B
 86
 87
+87:87A
+87:87B
+87:87C
 88
 89
+89:89A
+89:89B
 90
+90:90A
+90:90B
 91
+91:91A
+91:91B
+91:91B/C
+91:91C
+91:91D
 92
 93
+93:93A
+93:93B
 94
+94:94A
+94:94B
 95
 96
 97
 98
+98:98A
+98:98B
 99
+99:99A
+99:99B
+99:99C
 100
 101
 102
 12/102
 103
+103:103A
+103:103B
 104
+104:104A
+104:104B
+104:104,22
+104:104C
 105
 106
 107
 108
 109
 110
+111