Skip to content

Commit

Permalink
Merge pull request #266 from opengeospatial/fix_for_issue_264
Browse files Browse the repository at this point in the history
Fix for issue 264
  • Loading branch information
ghobona authored Nov 22, 2023
2 parents ed8ee05 + e4badca commit 89ebe10
Show file tree
Hide file tree
Showing 4 changed files with 732 additions and 0 deletions.
27 changes: 27 additions & 0 deletions incubation/geosparql/checkfuncs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import requests
import csv

csvfile = open('/Users/gobehobona/Documents/GitHub/NamingAuthority/incubation/geosparql/concepts_in_funcs.csv', newline='')
fout = open('/Users/gobehobona/Documents/GitHub/NamingAuthority/incubation/geosparql/outputfuncs.txt','w')


conceptreader = csv.reader(csvfile, delimiter=',', quotechar='|')

for row in conceptreader:
#print(row[0])
r = requests.head(row[0])
#print("CODE1 "+str(r.status_code)+","+row[0])
if r.status_code == 303:
r2 = requests.head(r.headers['Location'])
#print("CODE2 "+str(r2.status_code)+","+r.headers['Location'])
if r2.status_code == 200:
#print("200,"+r.headers['Location'])
fout.write(str(r2.status_code)+","+(str(r.headers['Location']).replace('&_mediatype=text/turtle','').replace('http://defs.opengis.net/vocprez/object?uri=','')+"\n"))
else:
print(str(r2.status_code)+","+r.headers['Location'])
fout.write(str(r2.status_code)+","+(str(r.headers['Location']).replace('&_mediatype=text/turtle','').replace('http://defs.opengis.net/vocprez/object?uri=','')+"\n"))



csvfile.close()
fout.close()
Loading

0 comments on commit 89ebe10

Please sign in to comment.