Skip to content

Commit

Permalink
Adding WESC vocabs
Browse files Browse the repository at this point in the history
  • Loading branch information
jyucsiro committed Sep 14, 2017
1 parent 57882c7 commit 2784260
Show file tree
Hide file tree
Showing 6 changed files with 5,797 additions and 0 deletions.
671 changes: 671 additions & 0 deletions Vocabularies/AVPCC.csv

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions Vocabularies/avpcc-etl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import re

toplevel = []
narrower = dict()
p = re.compile('^<http://wescml.org/def/avpcc/((\d\d)\d*)([\.]*)(\d*)>')
with open('ids.txt') as f:
content = f.readlines()

for i in content:
i=i.strip()
narrower[i] = [];


for i in content:
i=i.strip()
m = p.match(i)
#print i + " --> " + str(m.group(1,2,4) )
if(m.group(1) == m.group(2)):
toplevel.append(i)

else:
if(m.group(3)):
arr = narrower['<http://wescml.org/def/avpcc/'+str(m.group(1))+'>']
arr.append(i)
else:
arr = narrower['<http://wescml.org/def/avpcc/'+str(m.group(2))+'>']
arr.append(i)


for key in narrower:
if(len(narrower[key]) > 0):
print key + " skos:narrower " + ','.join(narrower[key]) + "\n. \n"
Loading

0 comments on commit 2784260

Please sign in to comment.