From 084f34b7f9a8e6e437731662507acf5452673384 Mon Sep 17 00:00:00 2001 From: Gobe Hobona Date: Wed, 6 Dec 2023 20:59:27 +0000 Subject: [PATCH 1/2] Create 20231206_url_statuses.csv --- .../geosparql/20231206_url_statuses.csv | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 incubation/geosparql/20231206_url_statuses.csv diff --git a/incubation/geosparql/20231206_url_statuses.csv b/incubation/geosparql/20231206_url_statuses.csv new file mode 100644 index 00000000..417765c2 --- /dev/null +++ b/incubation/geosparql/20231206_url_statuses.csv @@ -0,0 +1,194 @@ +400,http://www.opengis.net/def/function/geosparql/difference_output +400,http://www.opengis.net/def/function/geosparql/centroid_output +400,http://www.opengis.net/def/function/geosparql/rcc8ntpp_output +400,http://www.opengis.net/def/function/geosparql/sfOverlaps_param2 +400,http://www.opengis.net/def/function/geosparql/buffer_param1 +500,http://www.opengis.net/def/function/geosparql/maxx +400,http://www.opengis.net/def/function/geosparql/ehOverlap_output +400,http://www.opengis.net/def/function/geosparql/isSimple_param1 +400,http://www.opengis.net/def/function/geosparql/maxZ_param1 +400,http://www.opengis.net/def/function/geosparql/union_param2 +404,http://defs-dev.opengis.net/ogc-na/definitions/conceptschemes/entailed/geosparql.ttl +400,http://www.opengis.net/def/function/geosparql/sfTouches_param2 +400,http://www.opengis.net/def/function/geosparql/centroid_param1 +400,http://www.opengis.net/def/function/geosparql/relate_param1 +400,http://www.opengis.net/def/function/geosparql/metricDistance_param2 +400,http://www.opengis.net/def/function/geosparql/sfDisjoint_param2 +400,http://www.opengis.net/def/function/geosparql/minz_param1 +400,http://www.opengis.net/def/function/geosparql/convexHull_param1 +400,http://www.opengis.net/def/function/geosparql/intersection_output +400,http://www.opengis.net/def/function/geosparql/maxZ_output +400,http://www.opengis.net/def/function/geosparql/minZ_param1 +400,http://www.opengis.net/def/function/geosparql/isEmpty_param1 +400,http://www.opengis.net/def/function/geosparql/ehCovers_param2 +400,http://www.opengis.net/def/function/geosparql/rcc8dc_param1 +400,http://www.opengis.net/def/function/geosparql/length_param1 +500,http://www.opengis.net/def/function/geosparql/minz +400,http://www.opengis.net/def/function/geosparql/maxz_param1 +400,http://www.opengis.net/def/function/geosparql/asGeoJSON_param1 +400,http://www.opengis.net/def/function/geosparql/sfWithin_param1 +400,http://www.opengis.net/def/function/geosparql/ehInside_param2 +400,http://www.opengis.net/def/function/geosparql/rcc8ntppi_param2 +400,http://www.opengis.net/def/function/geosparql/rcc8ec_param1 +400,http://www.opengis.net/def/function/geosparql/relate_param3 +400,http://www.opengis.net/def/function/geosparql/ehOverlap_param2 +400,http://www.opengis.net/def/function/geosparql/rcc8dc_param2 +400,http://www.opengis.net/def/function/geosparql/ehCoveredBy_param1 +500,http://www.opengis.net/def/function/geosparql/maxy +400,http://www.opengis.net/def/function/geosparql/asKML_param1 +500,http://www.opengis.net/def/geosparql/servicedescription +400,http://www.opengis.net/def/function/geosparql/maxY_output +400,http://www.opengis.net/def/function/geosparql/geometryN_param1 +400,http://www.opengis.net/def/function/geosparql/sfOverlaps_param1 +400,http://www.opengis.net/def/geosparql/safuncs +400,http://www.opengis.net/def/function/geosparql/ehMeet_param2 +400,http://www.opengis.net/def/function/geosparql/ehContains_output +400,http://www.opengis.net/def/function/geosparql/asWKT_output +400,http://www.opengis.net/def/function/geosparql/ehCoveredBy_param2 +400,http://www.opengis.net/def/function/geosparql/minZ_output +400,http://www.opengis.net/def/function/geosparql/asGML_param2 +400,http://www.opengis.net/def/function/geosparql/rcc8tppi_param1 +400,http://www.opengis.net/def/function/geosparql/symDifference_param2 +400,http://www.opengis.net/def/function/geosparql/minX_param1 +400,http://www.opengis.net/def/function/geosparql/buffer_param2 +400,http://www.opengis.net/def/geosparql/geo-jsonldcontext +400,http://www.opengis.net/def/function/geosparql/metricLength_output +400,http://www.opengis.net/def/function/geosparql/union_param1 +400,http://www.opengis.net/def/function/geosparql/ehOverlap_param1 +400,http://www.opengis.net/def/function/geosparql/rcc8po_param1 +400,http://www.opengis.net/def/function/geosparql/envelope_param1 +400,http://www.opengis.net/def/function/geosparql/maxx_output +400,http://www.opengis.net/def/function/geosparql/ehCovers_param1 +400,http://www.opengis.net/def/function/geosparql/sfIntersects_param2 +400,http://www.opengis.net/def/function/geosparql/sfContains_param1 +400,http://www.opengis.net/def/function/geosparql/sfIntersects_param1 +400,http://www.opengis.net/def/function/geosparql/minz_output +400,http://www.opengis.net/def/function/geosparql/minY_param1 +400,http://www.opengis.net/def/function/geosparql/boundary_output +400,http://www.opengis.net/def/geosparql/sf-jsonldcontext +400,http://www.opengis.net/def/function/geosparql/ehContains_param1 +400,http://www.opengis.net/def/function/geosparql/concaveHull_param1 +400,http://www.opengis.net/def/function/geosparql/sfContains_param2 +400,http://www.opengis.net/def/function/geosparql/ehDisjoint_param2 +500,http://www.opengis.net/def/function/geosparql/minx +400,http://www.opengis.net/def/function/geosparql/rcc8eq_output +400,http://www.opengis.net/def/function/geosparql/minX_output +400,http://www.opengis.net/def/function/geosparql/miny_param1 +400,http://www.opengis.net/def/function/geosparql/transform_output +400,http://www.opengis.net/def/function/geosparql/sfTouches_output +400,http://www.opengis.net/def/function/geosparql/asDGGS_output +400,http://www.opengis.net/def/function/geosparql/getSRID_param1 +400,http://www.opengis.net/def/function/geosparql/sfCrosses_param1 +400,http://www.opengis.net/def/function/geosparql/buffer_param3 +400,http://www.opengis.net/def/function/geosparql/metricBuffer_param2 +400,http://www.opengis.net/def/function/geosparql/maxy_param1 +400,http://www.opengis.net/def/function/geosparql/dimension_param1 +400,http://www.opengis.net/def/function/geosparql/maxX_param1 +400,http://www.opengis.net/def/function/geosparql/intersection_param1 +400,http://www.opengis.net/def/function/geosparql/boundary_param1 +400,http://www.opengis.net/def/function/geosparql/rcc8tpp_param2 +400,http://www.opengis.net/def/function/geosparql/miny_output +400,http://www.opengis.net/def/function/geosparql/sfEquals_param1 +400,http://www.opengis.net/def/function/geosparql/sfContains_output +400,http://www.opengis.net/def/function/geosparql/area_param1 +400,http://www.opengis.net/def/function/geosparql/metricPerimeter_output +400,http://www.opengis.net/def/function/geosparql/transform_param2 +400,http://www.opengis.net/def/function/geosparql/rcc8eq_param1 +400,http://www.opengis.net/def/function/geosparql/sfTouches_param1 +400,http://www.opengis.net/def/function/geosparql/convexHull_output +400,http://www.opengis.net/def/function/geosparql/boundingCircle_param1 +400,http://www.opengis.net/def/function/geosparql/metricDistance_param1 +400,http://www.opengis.net/def/function/geosparql/distance_param3 +400,http://www.opengis.net/def/function/geosparql/geometryN_param2 +400,http://www.opengis.net/def/function/geosparql/distance_param1 +400,http://www.opengis.net/def/function/geosparql/rcc8ntppi_param1 +400,http://www.opengis.net/def/function/geosparql/rcc8ntpp_param2 +400,http://www.opengis.net/def/function/geosparql/union_output +400,http://www.opengis.net/def/function/geosparql/numGeometries_param1 +500,http://www.opengis.net/def/function/geosparql/miny +400,http://www.opengis.net/def/function/geosparql/ehDisjoint_param1 +400,http://www.opengis.net/def/function/geosparql/relate_param2 +400,http://www.opengis.net/def/function/geosparql/ehEquals_param2 +400,http://www.opengis.net/def/function/geosparql/ehMeet_param1 +400,http://www.opengis.net/def/function/geosparql/buffer_output +400,http://www.opengis.net/def/function/geosparql/intersection_param2 +400,http://www.opengis.net/def/function/geosparql/transform_param1 +400,http://www.opengis.net/def/function/geosparql/asDGGS_param1 +400,http://www.opengis.net/def/function/geosparql/minx_output +400,http://www.opengis.net/def/function/geosparql/sfCrosses_param2 +400,http://www.opengis.net/def/function/geosparql/rcc8ec_param2 +400,http://www.opengis.net/def/function/geosparql/sfDisjoint_output +400,http://www.opengis.net/def/function/geosparql/geometryN_output +400,http://www.opengis.net/def/function/geosparql/envelope_output +400,http://www.opengis.net/def/function/geosparql/metricLength_param1 +400,http://www.opengis.net/def/function/geosparql/dimension_output +400,http://www.opengis.net/def/function/geosparql/ehContains_param2 +400,http://www.opengis.net/def/function/geosparql/asGML_param1 +400,http://www.opengis.net/def/function/geosparql/symDifference_param1 +400,http://www.opengis.net/def/function/geosparql/length_output +500,http://www.opengis.net/def/function/geosparql/maxz +400,http://www.opengis.net/def/function/geosparql/symDifference_output +400,http://www.opengis.net/def/function/geosparql/sfEquals_param2 +400,http://www.opengis.net/def/function/geosparql/ehEquals_param1 +400,http://www.opengis.net/def/function/geosparql/ehInside_param1 +400,http://www.opengis.net/def/function/geosparql/distance_param2 +400,http://www.opengis.net/def/function/geosparql/asWKT_param1 +400,http://www.opengis.net/def/function/geosparql/perimeter_param1 +400,http://www.opengis.net/def/function/geosparql/rcc8ec_output +400,http://www.opengis.net/def/function/geosparql/rcc8tppi_output +400,http://www.opengis.net/def/function/geosparql/maxY_param1 +400,http://www.opengis.net/def/function/geosparql/ehCoveredBy_output +400,http://www.opengis.net/def/function/geosparql/maxx_param1 +400,http://www.opengis.net/def/function/geosparql/ehCovers_output +400,http://www.opengis.net/def/function/geosparql/isSimple_output +400,http://www.opengis.net/def/function/geosparql/isEmpty_output +400,http://www.opengis.net/def/function/geosparql/sfOverlaps_output +400,http://www.opengis.net/def/function/geosparql/boundingCircle_output +400,http://www.opengis.net/def/function/geosparql/rcc8po_param2 +400,http://www.opengis.net/def/function/geosparql/rcc8eq_param2 +400,http://www.opengis.net/def/function/geosparql/metricArea_param1 +400,http://www.opengis.net/def/function/geosparql/rcc8tpp_param1 +400,http://www.opengis.net/def/function/geosparql/rcc8ntppi_output +400,http://www.opengis.net/def/function/geosparql/sfDisjoint_param1 +400,http://www.opengis.net/def/function/geosparql/rcc8ntpp_param1 +400,http://www.opengis.net/def/function/geosparql/difference_param2 +400,http://www.opengis.net/def/function/geosparql/sfIntersects_output +400,http://www.opengis.net/def/function/geosparql/metricBuffer_param1 +400,http://www.opengis.net/def/function/geosparql/sfWithin_output +400,http://www.opengis.net/def/function/geosparql/perimeter_param2 +400,http://www.opengis.net/def/function/geosparql/maxz_output +400,http://www.opengis.net/def/function/geosparql/metricBuffer_output +400,http://www.opengis.net/def/function/geosparql/minx_param1 +400,http://www.opengis.net/def/function/geosparql/asDGGS_param2 +400,http://www.opengis.net/def/function/geosparql/ehEquals_output +400,http://www.opengis.net/def/geosparql/extended-examples +400,http://www.opengis.net/def/geosparql/validator +400,http://www.opengis.net/def/function/geosparql/metricPerimeter_param1 +400,http://www.opengis.net/def/function/geosparql/perimeter_output +400,http://www.opengis.net/def/function/geosparql/difference_param1 +400,http://www.opengis.net/def/function/geosparql/concaveHull_output +400,http://www.opengis.net/def/function/geosparql/maxy_output +400,http://www.opengis.net/def/function/geosparql/rcc8tppi_param2 +400,http://www.opengis.net/def/function/geosparql/sfWithin_param2 +400,http://www.opengis.net/def/function/geosparql/rcc8tpp_output +400,http://www.opengis.net/def/function/geosparql/asGML_output +400,http://www.opengis.net/def/function/geosparql/sfCrosses_output +400,http://www.opengis.net/def/function/geosparql/area_param2 +400,http://www.opengis.net/def/function/geosparql/asKML_output +400,http://www.opengis.net/def/function/geosparql/numGeometries_output +400,http://www.opengis.net/def/function/geosparql/distance_output +400,http://www.opengis.net/def/function/geosparql/getSRID_output +400,http://www.opengis.net/def/function/geosparql/metricDistance_output +400,http://www.opengis.net/def/geosparql/repository +400,http://www.opengis.net/def/function/geosparql/maxX_output +400,http://www.opengis.net/def/function/geosparql/area_output +400,http://www.opengis.net/def/function/geosparql/asGeoJSON_output +400,http://www.opengis.net/def/function/geosparql/metricArea_output +400,http://www.opengis.net/def/function/geosparql/minY_output +400,http://www.opengis.net/def/function/geosparql/ehInside_output +400,http://www.opengis.net/def/function/geosparql/relate_output +400,http://www.opengis.net/def/function/geosparql/ehDisjoint_output +400,http://www.opengis.net/def/function/geosparql/ehMeet_output +400,http://www.opengis.net/def/function/geosparql/rcc8po_output +400,http://www.opengis.net/def/function/geosparql/rcc8dc_output +400,http://www.opengis.net/def/function/geosparql/sfEquals_output From b2943149b99e1774233576ed9eba1b37ab9f41fa Mon Sep 17 00:00:00 2001 From: Gobe Hobona Date: Wed, 6 Dec 2023 20:59:29 +0000 Subject: [PATCH 2/2] Create update_alias_register.py --- .../second_attempt/update_alias_register.py | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 incubation/geosparql/second_attempt/update_alias_register.py diff --git a/incubation/geosparql/second_attempt/update_alias_register.py b/incubation/geosparql/second_attempt/update_alias_register.py new file mode 100644 index 00000000..529bbd84 --- /dev/null +++ b/incubation/geosparql/second_attempt/update_alias_register.py @@ -0,0 +1,54 @@ +import os, re +import rdflib +import requests +from rdflib.namespace import DC, DCTERMS, DOAP, FOAF, SKOS, OWL, RDF, RDFS, VOID, XMLNS, XSD + +''' +pip3 install rdflib +pip3 install requests +''' + +fout = open('/Users/gobehobona/Documents/GitHub/NamingAuthority/incubation/geosparql/20231206_url_statuses.csv','w') + + +path = "/Users/gobehobona/Documents/GitHub/NamingAuthority/incubation/geosparql/second_attempt/triples_to_add" + +g = rdflib.Graph() + +for dirpath, subdirs, files in os.walk(path): + for name in files: + if name.endswith(".ttl"): + print(os.path.join(dirpath, name)) + g.parse(os.path.join(dirpath, name)) + + +#g.serialize(destination="/Users/gobehobona/Documents/GitHub/NamingAuthority/incubation/geosparql/20231206_insert_aliases.nt",format="nt") + + +#g1 = rdflib.Graph() +#g1.parse("file:///Users/gobehobona/Documents/GitHub/NamingAuthority/incubation/geosparql/20231206_insert_aliases.nt") + + +knows_query = """ +SELECT DISTINCT ?subject { + ?subject ?predicate ?object + FILTER (isURI(?subject) && STRSTARTS(str(?subject), str('http://www.opengis.net/def/') ) ) +}""" + +all_def_uris = [] + +qres = g.query(knows_query) +for row in qres: + all_def_uris.append(f"{row.subject}") + +for subject in all_def_uris: + print(subject) + r = requests.head(str(subject)) + if r.status_code == 303: + r2 = requests.head(r.headers['Location']) + if not(r2.status_code==200): + fout.write(str(r2.status_code)+","+str(r.headers['Location']).replace('&_mediatype=text/turtle','').replace('http://defs.opengis.net/vocprez/object?uri=','')+"\n") + + +fout.close() +