diff --git a/create_faechersystematik_ttl.py b/create_faechersystematik_ttl.py index 00c9458..b3d1b98 100755 --- a/create_faechersystematik_ttl.py +++ b/create_faechersystematik_ttl.py @@ -27,6 +27,23 @@ def extract_preflabel_translations(current_ttl): pref_label_dict_list.append(pref_label_dict) return pref_label_dict_list +def extract_deprecated_notations(current_ttl): + g_old = Graph() + g_old.parse(current_ttl, format="ttl") + qres = g_old.query( + """ + PREFIX skos: + PREFIX owl: + PREFIX : + + SELECT * + WHERE { + ?concept owl:deprecated true ; + ?p ?o . + }""") + + return qres + def add_pref_labels_lang(level_dict_list, current_pref_labels_dict): for idx, i in enumerate(level_dict_list): notation = level_dict_list[idx]['notation'] @@ -41,6 +58,7 @@ def add_pref_labels_lang(level_dict_list, current_pref_labels_dict): # extract translations of prefLabels current_hfs_file = "https://github.com/dini-ag-kim/hochschulfaechersystematik/blob/master/hochschulfaechersystematik.ttl?raw=true" lang_preflabel_list = extract_preflabel_translations(current_hfs_file) +hfs_deprecated_notations = extract_deprecated_notations(current_hfs_file) # extract hfs data from destatis files url_1st_level = "https://github.com/dini-ag-kim/destatis-schluesseltabellen/blob/main/studierende/Faechergruppe.csv?raw=true" @@ -143,4 +161,9 @@ def add_pref_labels_lang(level_dict_list, current_pref_labels_dict): g.add((URIRef('n0'), skos['notation'], Literal('0'))) g.add((URIRef('scheme'), skos['hasTopConcept'], (URIRef('n0')))) g.bind("dct", DCTERMS) + +# add deprecated notations +for row in hfs_deprecated_notations: + g.add((URIRef(row.concept), row.p, row.o)) + g.serialize('hochschulfaechersystematik.ttl', format='turtle') \ No newline at end of file diff --git a/hochschulfaechersystematik.ttl b/hochschulfaechersystematik.ttl index 07f04d2..cffbfd5 100644 --- a/hochschulfaechersystematik.ttl +++ b/hochschulfaechersystematik.ttl @@ -1,8 +1,10 @@ @base . @prefix dct: . +@prefix owl: . @prefix schema: . @prefix skos: . @prefix vann: . +@prefix xsd: . a skos:ConceptScheme ; dct:alternative "Hochschulfächersystematik"@de ; @@ -1498,7 +1500,9 @@ skos:broader ; skos:inScheme ; skos:notation "128" ; - skos:prefLabel "Physik"@de, "Physics"@en, "Фізика"@uk . + skos:prefLabel "Physik"@de, + "Physics"@en, + "Фізика"@uk . a skos:Concept ; skos:broader ; @@ -2276,6 +2280,26 @@ "Automotive Technology"@en, "Автомобільний транспорт"@uk . + a skos:Concept ; + dct:isReplacedBy ; + owl:deprecated true ; + skos:broader ; + skos:inScheme ; + skos:notation "237" ; + skos:prefLabel "Mathematische Statistik/Wahrscheinlichkeitsrechnung"@de, + "Mathematical statistics/probability calculation"@en, + "Математична статистика/Теорія ймовірності"@uk . + + a skos:Concept ; + owl:deprecated true ; + skos:broader ; + skos:inScheme ; + skos:notation "241" ; + skos:note "Integrated into 211"@en ; + skos:prefLabel "Kerntechnik/Kernverfahrenstechnik"@de, + "Nuclear technology/nuclear process engineering"@en, + "Атомна інженерія/Інженерія ядерних процесів"@uk . + a skos:Concept ; skos:broader ; skos:inScheme ; @@ -2544,7 +2568,9 @@ skos:broader ; skos:inScheme ; skos:notation "292" ; - skos:prefLabel "Islamische Studien/Islamische Theologie"@de, "Islamic Studies/Islamic Theology"@en, "Ісламознавство"@uk . + skos:prefLabel "Islamische Studien/Islamische Theologie"@de, + "Islamic Studies/Islamic Theology"@en, + "Ісламознавство"@uk . a skos:Concept ; skos:broader ;