This notebook follows the same query-first workflow as the earlier notebooks: validate the graph structure before interpreting the terminology and concept distribution.
From the GitHub issue: https://github.com/TIBHannover/ClimateKG-Data-Bench/issues/1
Which glossary terms appear in all three working group reports?
Question 1
Which glossary terms appear in all three working group reports?
This cell identifies glossary terms that are linked to Working Group I, II, and III reports via P3 and shows the reusable SPARQL query.
Show code
query_all_three_wg =f'''PREFIX wd: <{entity_ns}>PREFIX wdt: <{property_ns}>PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>SELECT ?term ?termLabel (COUNT(DISTINCT ?wg) AS ?workingGroupsCovered) (GROUP_CONCAT(DISTINCT ?wgLabel; separator=", ") AS ?workingGroupReports)WHERE {{ ?term wdt:P1 wd:Q1 ; wdt:P3 ?report . ?report wdt:P1 wd:Q4 ; rdfs:label ?reportLabel . FILTER(LANG(?reportLabel) = "en") BIND( IF(CONTAINS(?reportLabel, "Working Group I:"), "WGI", IF(CONTAINS(?reportLabel, "Working Group II:"), "WGII", IF(CONTAINS(?reportLabel, "Working Group III:"), "WGIII", "Other"))) AS ?wg ) FILTER(?wg != "Other") BIND( IF(?wg = "WGI", "Working Group I", IF(?wg = "WGII", "Working Group II", "Working Group III")) AS ?wgLabel ) OPTIONAL {{ ?term rdfs:label ?termLabel . FILTER(LANG(?termLabel) = "en") }}}}GROUP BY ?term ?termLabelHAVING (COUNT(DISTINCT ?wg) = 3)ORDER BY ?termLabel'''display(Markdown("**SPARQL query (copy/paste into ClimateKG Query UI: https://climatekg.tibwiki.io/query/)**"))display(Markdown("```sparql\n"+ query_all_three_wg +"\n```"))sparql = build_sparql_client(SPARQL_ENDPOINT)sparql.setQuery(query_all_three_wg)sparql.setReturnFormat(JSON)all_three_results = sparql.query().convert()all_three_rows = all_three_results.get("results", {}).get("bindings", [])all_three_df = pd.DataFrame([{k: v["value"] for k, v in row.items()} for row in all_three_rows])if all_three_df.empty:print("No glossary terms were found across all three working group reports.")else: all_three_df = all_three_df.sort_values("termLabel").reset_index(drop=True) all_three_df["termQID"] = all_three_df["term"].astype(str).str.rsplit("/", n=1).str[-1]print(f"Glossary terms found in all three working group reports: {len(all_three_df)}") display(all_three_df[["termQID", "termLabel", "workingGroupsCovered", "workingGroupReports"]])
SPARQL query (copy/paste into ClimateKG Query UI: https://climatekg.tibwiki.io/query/)
PREFIX wd: <https://climatekg.tibwiki.io/entity/>
PREFIX wdt: <https://climatekg.tibwiki.io/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?term ?termLabel
(COUNT(DISTINCT ?wg) AS ?workingGroupsCovered)
(GROUP_CONCAT(DISTINCT ?wgLabel; separator=", ") AS ?workingGroupReports)
WHERE {
?term wdt:P1 wd:Q1 ;
wdt:P3 ?report .
?report wdt:P1 wd:Q4 ;
rdfs:label ?reportLabel .
FILTER(LANG(?reportLabel) = "en")
BIND(
IF(CONTAINS(?reportLabel, "Working Group I:"), "WGI",
IF(CONTAINS(?reportLabel, "Working Group II:"), "WGII",
IF(CONTAINS(?reportLabel, "Working Group III:"), "WGIII", "Other"))) AS ?wg
)
FILTER(?wg != "Other")
BIND(
IF(?wg = "WGI", "Working Group I",
IF(?wg = "WGII", "Working Group II", "Working Group III")) AS ?wgLabel
)
OPTIONAL { ?term rdfs:label ?termLabel . FILTER(LANG(?termLabel) = "en") }
}
GROUP BY ?term ?termLabel
HAVING (COUNT(DISTINCT ?wg) = 3)
ORDER BY ?termLabel
Glossary terms found in all three working group reports: 96
termQID
termLabel
workingGroupsCovered
workingGroupReports
0
Q262
Adaptation
3
Working Group III, Working Group II, Working G...
1
Q270
Adaptation options
3
Working Group III, Working Group II, Working G...
2
Q272
Adaptive capacity
3
Working Group III, Working Group II, Working G...
3
Q280
Aerosol
3
Working Group III, Working Group II, Working G...
4
Q285
Afforestation
3
Working Group III, Working Group II, Working G...
...
...
...
...
...
91
Q1100
Tipping point
3
Working Group I, Working Group II, Working Gro...
92
Q1128
Uncertainty
3
Working Group I, Working Group II, Working Gro...
93
Q1130
United Nations Framework Convention on Climate...
3
Working Group III, Working Group I, Working Gr...
94
Q1131
Uptake
3
Working Group I, Working Group II, Working Gro...
95
Q1147
Vulnerability
3
Working Group I, Working Group III, Working Gr...
96 rows × 4 columns
Interpretation
Each row connects a glossary term to a report or corpus item via the P3 relationship. That lets us see the terminology in context rather than as isolated labels.
This is the right starting point for glossary analysis: once the relation is confirmed, the next step is to count terms by report, identify repeated concepts, and compare the terms against the glossary pages already generated in the site.