diff --git a/scripts/generate.sh b/scripts/generate.sh new file mode 100755 index 0000000..aa76c5d --- /dev/null +++ b/scripts/generate.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +# This script generates all output data from the input files in this repository. +# +# If executed without arguments, it downloads the required external files and +# executes all generators: +# +# $ scripts/generate.sh +# +# The `fetch` and `generate` sub-commands can be used to execute individual +# stages: +# +# $ scripts/generate.sh fetch +# $ scripts/generate.sh generate nace +set -euo pipefail + +GENERATORS=( + qudt + combined_nomenclature + envo + model_terms + open_energy_ontology + custom_products +) + +declare -A GENERATOR_ARGS +GENERATOR_ARGS=( + [combined_nomenclature]=sentier_vocab/CN_2024.rdf +) + +main() { + [[ "$#" -eq 0 ]] && set -- all + local cmd=$1; shift + case "$cmd" in + all) fetch; generate;; + fetch) fetch "$@";; + generate) generate "$@";; + *) usage;; + esac +} + +usage() { + echo >&2 < . + + a skos:Concept ; + skos:broader ; + skos:definition "Wastewater that is contaminated with feces or urine,"@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "sewage"@en ; + skos:related "SWEETRealm:Sewage", + "https://en.wikipedia.org/wiki/Sewage" . + + a skos:Concept ; + skos:broader ; + skos:definition "Water that is found on the surface of an astronomical object."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "surface water"@en . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "borax leachate"@en . + + a skos:Concept ; + skos:altLabel "coastal ocean water"@en, + "coastal oceanic water"@en, + "coastal seawater"@en, + "coastal water"@en ; + skos:broader ; + skos:definition "Coastal sea water is sea water that is adjacent to a coast."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "coastal sea water"@en . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "ditch water"@en . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "drilling bore water"@en . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "pulp-bleaching waste water"@en . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "oil field production water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Water which has very low concentrations of nutrients."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "oligotrophic water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Water with a nutrient level intermediate between eutrophic and oligotrophic."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "mesotrophic water"@en . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "pond water"@en . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "bacon curing brine"@en . + + a skos:Concept ; + skos:altLabel "potable water"@en ; + skos:broader ; + skos:definition "Drinking water is water which may be consumed by humans with no adverse effects on their health."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "drinking water"@en ; + skos:related "EcoLexicon:drinking_water", + "SWEETRealm:DrinkingWater", + "https://en.wikipedia.org/wiki/Drinking_water" . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "distilled water"@en ; + skos:related "https://en.wikipedia.org/wiki/Distilled_water" . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "tap water"@en ; + skos:related "https://en.wikipedia.org/wiki/Tap_water" . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "bore hole water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Sterile water is water which does not contain lliving organisms."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "sterile water"@en . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "muddy water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "High temperature water ejected from hydrothermal vents and laden with dissolved metals and minerals as a result of percolation through crustal rocks."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "hydrothermal fluid"@en . + + a skos:Concept ; + skos:altLabel "anaerobic water"@en ; + skos:broader ; + skos:definition "Water which lacks dissolved oxygen."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "anoxic water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Brackish water which is part of an estuary."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "estuarine water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "A portion of alkaline water is a portion of water with a pH greater than 7."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "alkaline water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "A portion of acidic water is a portion of water with a pH less than 7."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "acidic water"@en . + + a skos:Concept ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "river water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Rainwater is liquid water which has precipitated in the form of droplets through the condensation of atmospheric water vapour."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "rainwater"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Meltwater is the water released by the melting of snow or ice, including glacial ice, tabular icebergs and ice shelves over oceans."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "meltwater"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Ballast water is water contained in the ballast tanks of sea-going vessels."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "ballast water"@en . + + a skos:Concept ; + skos:altLabel "fracture water"@en ; + skos:broader ; + skos:definition "Water which is partially contained within a fissure or a geological fracture."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "fissure water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Wastewater which is produced by industrial activity and which contains chemical contaminants other than those associated with urine and fecal matter."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "industrial wastewater"@en . + + a skos:Concept ; + skos:altLabel "ground water"@en ; + skos:broader ; + skos:definition "Underground water which is located in pore spaces found in rock or unconsolidated deposits such as soil, clay, or gravel."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "groundwater"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Water which has a very high concentration of nutrients."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "hypereutrophic water"@en . + + a skos:Concept ; + skos:altLabel "slightly salty water"@en ; + skos:broader ; + skos:definition "Water which contains a slightly increased concentration of dissolved salts, relative to their concentration in freshwater."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "slightly saline water"@en ; + skos:related "EcoLexicon:saltwater", + "SWEETRealm:SalineWater", + "SWEETRealm:SaltWater", + "https://en.wikipedia.org/wiki/Saline_water" . + + a skos:Concept ; + skos:altLabel "moderately salty water"@en ; + skos:broader ; + skos:definition "Water which contains a moderately increased concentration of dissolved salts, relative to their concentration in freshwater."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "moderately saline water"@en ; + skos:related "EcoLexicon:saltwater", + "SWEETRealm:SalineWater", + "SWEETRealm:SaltWater", + "https://en.wikipedia.org/wiki/Saline_water" . + + a skos:Concept ; + skos:altLabel "highly salty water"@en ; + skos:broader ; + skos:definition "Water which contains a highly increased concentration of dissolved salts, relative to their concentration in freshwater."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "highly saline water"@en ; + skos:related "EcoLexicon:saltwater", + "SWEETRealm:SalineWater", + "SWEETRealm:SaltWater", + "https://en.wikipedia.org/wiki/Saline_water" . + + a skos:Concept ; + skos:broader ; + skos:definition "Water which has an appreciable concentration of dissolved oxygen."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "oxic water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Water which has low levels of dissolved oxygen."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "hypoxic water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Saline water which is derived from sea water and used during the cultivation of crustaceans."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "saline shrimp pond water"@en . + + a skos:Concept ; + skos:altLabel "urban storm water"@en ; + skos:broader ; + skos:definition "Stormwater which accumulates in an urban ecosystem."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "urban stormwater"@en . + + a skos:Concept ; + skos:altLabel "rural storm water"@en ; + skos:broader ; + skos:definition "Stormwater which accumulates in a rural ecosystem."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "rural stormwater"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "A lake underneath the surface of the Earth."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "subterranean lake"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "A liquid water which has no current or flow and is susceptible to contamination by pathogens or pathogenic vectors."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "stagnant water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Liquid water which is a participant in a water cooling process."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "cooling water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Liquid water which occurs naturally within the pores of rocks and sediments."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "interstitial water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Liquid water which is either part of or was removed from a marine lake."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "marine lake water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Water which comes from a spring."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "spring water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Fresh water which is harvested from cloud."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "cloud water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Water which is part of a lake."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "lake water"@en . + + a skos:Concept ; + skos:altLabel "overland flow"@en, + "surface runoff"@en ; + skos:broader ; + skos:definition "Liquid water which 1) flows over land and 2) is not absorbed or retained by the materials if flows over or through."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "runoff"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Liquid water which is present in soils as discontinuous volumnes of water in contact with solid and gaseous components of the soil."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "residual water in soil"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Waste water which was converted into an effluent that can be either returned to the water cycle with minimal environmental issues or reused."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "treated wastewater"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Saline water from which minerals have been removed to produce fresh water suitable for human consumption or irrigation."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:prefLabel "desalinated water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Water which contains a highly increased concentration of dissolved salts, surpassing the average salinity of seawater."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower ; + skos:prefLabel "hypersaline water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Water which has a higher salinity than fresh water but a lower salinity than marine water."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower ; + skos:prefLabel "brackish water"@en ; + skos:related "EcoLexicon:brackish_water", + "LTER:702", + "SPIRE:Brackish_water", + "SWEETRealm:BrackishWater", + "https://en.wikipedia.org/wiki/Brackish_water" . + + a skos:Concept ; + skos:altLabel "ocean water"@en, + "seawater"@en ; + skos:broader ; + skos:definition "Water which has physicochemical properties that have been determined by the processes occuring in a sea or ocean."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower ; + skos:prefLabel "sea water"@en ; + skos:related "EcoLexicon:sea_water", + "LTER:701", + "SWEETRealm:SeaWater", + "https://en.wikipedia.org/wiki/Sea_water" . + + a skos:Concept ; + skos:altLabel "polluted water"@en ; + skos:broader ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower ; + skos:prefLabel "contaminated water"@en ; + skos:related "EcoLexicon:water_pollution", + "https://en.wikipedia.org/wiki/Contaminated_water" . + + a skos:Concept ; + skos:broader ; + skos:definition "Water with a high nutrient level."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower ; + skos:prefLabel "eutrophic water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Water saturated or nearly saturated with salt (NaCl)."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower ; + skos:prefLabel "brine"@en ; + skos:related "EcoLexicon:brine", + "SWEETRealm:Brine", + "https://en.wikipedia.org/wiki/Brine" . + + a skos:Concept ; + skos:broader ; + skos:definition "Water which is part of a stream."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower ; + skos:prefLabel "stream water"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "The liquid produced when water percolates through any permeable material. It can contain either dissolved or suspended material, or usually both."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower , + ; + skos:prefLabel "leachate"@en ; + skos:related "https://en.wikipedia.org/wiki/Leachate" . + + a skos:Concept ; + skos:broader ; + skos:definition "Water which has physicochemical properties determined by processes which occur beneath the planetary crust."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower , + ; + skos:prefLabel "underground water"@en ; + skos:related "SWEETRealm:UndergroundWater" . + + a skos:Concept ; + skos:altLabel "storm water"@en ; + skos:broader ; + skos:definition "Water which accumulates on a solid surface during precipitation events and snow/ice melt."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower , + ; + skos:prefLabel "stormwater"@en . + + a skos:Concept ; + skos:broader ; + skos:definition "Water that has been adversely affected in quality by anthropogenic influence."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower , + , + ; + skos:prefLabel "waste water"@en ; + skos:related "EcoLexicon:waste_water", + "SWEETRealm:Wastewater", + "https://en.wikipedia.org/wiki/Waste_water" . + + a skos:Concept ; + skos:altLabel "freshwater"@en ; + skos:broader ; + skos:definition "Water which has a low concentration of dissolved solutes, particularly that of sodium chloride."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower , + , + , + , + , + ; + skos:prefLabel "fresh water"@en ; + skos:related "EcoLexicon:fresh_water", + "LTER:216", + "SWEETRealm:FreshWater", + "https://en.wikipedia.org/wiki/Fresh_water" . + + a skos:Concept ; + skos:altLabel "salt water"@en ; + skos:broader ; + skos:definition "Water which contains a significant concentration of dissolved salts."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower , + , + , + , + , + , + ; + skos:prefLabel "saline water"@en ; + skos:related "EcoLexicon:saltwater", + "SWEETRealm:SalineWater", + "SWEETRealm:SaltWater", + "https://en.wikipedia.org/wiki/Saline_water" . + + a skos:Concept ; + skos:altLabel "water"@en ; + skos:definition "An environmental material primarily composed of dihydrogen oxide in its liquid form."@en ; + skos:exactMatch ; + skos:inScheme ; + skos:narrower , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + skos:prefLabel "liquid water"@en ; + skos:related "EcoLexicon:water", + "LTER:617", + "https://en.wikipedia.org/wiki/Water" ; + skos:topConceptOf . + + a skos:ConceptScheme ; + skos:altLabel "Biosphere flows"@en ; + skos:definition "Material or energy entering the system being studied that has been drawn from the environment without previous human transformation, or material or energy leaving the system being studied that is released into the environment without subsequent human transformation."@en ; + skos:prefLabel "Elementary flows"@en . + diff --git a/sentier_vocab/output/oeo-product-vocab.ttl b/sentier_vocab/output/oeo-product-vocab.ttl new file mode 100644 index 0000000..27ca498 --- /dev/null +++ b/sentier_vocab/output/oeo-product-vocab.ttl @@ -0,0 +1,127 @@ +@prefix skos: . + + a skos:Concept ; + skos:exactMatch . + + a skos:Concept ; + skos:exactMatch . + + a skos:Concept ; + skos:altLabel "fossiler Wasserstoff"@de ; + skos:broader ; + skos:broaderTransitive ; + skos:definition "Fossil hydrogen is hydrogen with fossil origin." ; + skos:prefLabel "fossil hydrogen"@en . + + a skos:Concept ; + skos:altLabel "synthetischer Wasserstoff"@de ; + skos:broader ; + skos:broaderTransitive ; + skos:definition "Synthetic hydrogen is hydrogen with synthetic origin." ; + skos:prefLabel "synthetic hydrogen"@en . + + a skos:Concept ; + skos:altLabel "erneuerbare elektrische Energie"@de ; + skos:broader ; + skos:broaderTransitive ; + skos:definition "Renewable electrical energy is electrical energy with a renewable origin." ; + skos:prefLabel "renewable electrical energy"@en . + + a skos:Concept ; + skos:broader ; + skos:broaderTransitive ; + skos:definition "Nuclear electrical energy is electrical energy with a nuclear origin." ; + skos:prefLabel "nuclear electrical energy"@en . + + a skos:Concept ; + skos:broader ; + skos:broaderTransitive ; + skos:definition "Solar electrical energy is electrical energy that is energy output of a solar energy transformation." ; + skos:prefLabel "solar electrical energy"@en . + + a skos:Concept ; + skos:altLabel "erneuerbarer Elektrolysewasserstoff"@de, + "green hydrogen"@en ; + skos:broader ; + skos:broaderTransitive , + ; + skos:definition "Renewable electrolytic hydrogen is electrolytic hydrogen that is produced with renewable electrical energy." ; + skos:prefLabel "renewable electrolytic hydrogen"@en . + + a skos:Concept ; + skos:altLabel "grey hydrogen" ; + skos:broader ; + skos:broaderTransitive , + ; + skos:definition "Fossil steam reforming hydrogen is hydrogen that is produced from a fossil combustion fuel in a steam reforming process which is not followed by a carbon capture and storage process." ; + skos:prefLabel "fossil steam reforming hydrogen"@en . + + a skos:Concept ; + skos:altLabel "CCS steam reforming hydrogen", + "blue hydrogen" ; + skos:broader ; + skos:broaderTransitive , + ; + skos:definition "Abated steam reforming hydrogen is hydrogen that is output of a steam reforming process which is followed by a carbon capture and storage process." ; + skos:prefLabel "abated steam reforming hydrogen"@en . + + a skos:Concept ; + skos:altLabel "pink hydrogen" ; + skos:broader ; + skos:broaderTransitive , + ; + skos:definition "Nuclear electrolytic hydrogen is electrolytic hydrogen that is produced with nuclear electrical energy." ; + skos:prefLabel "nuclear electric hydrogen"@en . + + a skos:Concept ; + skos:altLabel "yellow hydrogen" ; + skos:broader ; + skos:broaderTransitive , + ; + skos:definition "Solar electrolytic hydrogen is electrolytic hydrogen that is produced with solar electrical energy." ; + skos:prefLabel "solar electrolytic hydrogen"@en . + + a skos:Concept ; + skos:broader ; + skos:broaderTransitive ; + skos:definition "Steam reforming hydrogen is hydrogen that is a physical output of a steam reforming process." ; + skos:narrower , + ; + skos:narrowerTransitive , + ; + skos:prefLabel "steam reforming hydrogen"@en . + + skos:narrower , + , + ; + skos:narrowerTransitive , + , + . + + a skos:Concept ; + skos:altLabel "Elektrolysewasserstoff"@de ; + skos:broader ; + skos:broaderTransitive ; + skos:definition "Electrolytic hydrogen is hydrogen that is a physical output of a water electrolysis process." ; + skos:narrower , + , + ; + skos:narrowerTransitive , + , + ; + skos:prefLabel "electrolytic hydrogen"@en . + + skos:narrower , + , + , + ; + skos:narrowerTransitive , + , + , + , + , + , + , + , + . + diff --git a/sentier_vocab/qudt.py b/sentier_vocab/qudt.py index a773afe..aa67eeb 100644 --- a/sentier_vocab/qudt.py +++ b/sentier_vocab/qudt.py @@ -346,7 +346,8 @@ def add_quantity_kinds_to_graph( The `input_ttl` concept scheme was written by hand (!), but we can make it more useful by positioning each input concept in the QUDT quantity kind hierarchy. """ - output_ttl = input_ttl.with_suffix(".supplemented" + input_ttl.suffix) + output_ttl = Path(__file__).parent / "output" / Path(str(input_ttl.stem)+ ".supplemented" + str(input_ttl.suffix)) + input_graph = Graph().parse(input_ttl) qudt = Graph().parse(qudt_ttl) @@ -368,6 +369,7 @@ def add_quantity_kinds_to_graph( input_graph.add((s, QUDTS.hasQuantityKind, qudt_qk_mapping[o])) input_graph.add((s, QUDTS.hasDimensionVector, qudt_d_mapping[o])) + logger.info(f"Writing {output_ttl}") input_graph.serialize(destination=output_ttl) return output_ttl