Lingua:Graphs
Glossary Graphs Manual[edit]
This page provides instructions for using and interpreting the glossary graphs on the OODA.wiki, which visualize connections between terms in using the SemanticMediaWiki properties `Glossary-Term` and `Glossary-Definition`. The graphs are powered by two gadgets: `GlossaryGraph` for individual term graphs and `GlobalGlossaryGraph` for a comprehensive graph of all glossary terms. Both are rendered in a retro IBM terminal aesthetic (green-on-black, monospaced font).
Overview[edit]
Glossary graphs display relationships between terms based on mentions in their `Glossary-Definition` properties. Each term in is a node, and an edge is drawn when one term's definition mentions another term. For example, if Lingua:Scriptum's definition mentions "Dictum," an edge connects Lingua:Scriptum to Lingua:Dictum.
- Individual Graphs: Appear on each glossary term page (e.g., Lingua:Dictum) under the "Semantic Graph" section, showing connections to terms that mention the current term in their definitions.
- Global Graph: Displayed at Lingua:Global Glossary Graph, showing all glossary terms and their connections.
Both graphs use the D3.js library for interactivity (draggable nodes) and are styled with green nodes (#00CC00), green lines (#00FF00), green labels (#00FF00), and a black background (#000000).
Setup[edit]
The graphs rely on the following components, which are already configured:
- SemanticMediaWiki (SMW): Stores `Glossary-Term` and `Glossary-Definition` properties for pages in .
- Template:GlossaryEntry: Defines glossary terms with `Term` and `Definition` parameters, setting SMW properties.
- Gadgets: `GlossaryGraph` and `GlobalGlossaryGraph` are enabled in MediaWiki:Gadgets-definition.
- CSS: MediaWiki:Common.css defines the `IBMPlexMono` font for the IBM aesthetic, with `Courier New` as a fallback.
- D3.js: Loaded from `/var/www/mediawiki/resources/d3.min.js` for graph rendering.
To enable the gadgets:
- Go to Special:Preferences#mw-prefsection-gadgets.
- Check `GlossaryGraph` and `GlobalGlossaryGraph` under the Gadgets section.
- Save preferences.
Usage[edit]
Individual Term Graphs[edit]
- Navigate to a glossary term page (e.g., Lingua:Dictum).
- Find the "Semantic Graph" section, which contains a ``.
- The graph shows:
* A node for the current term (e.g., "Dictum"). * Nodes for terms whose `Glossary-Definition` mentions the current term (e.g., "TestTerm", "Scriptum"). * Green lines (#00FF00) connecting related terms. * Green node circles (#00CC00) with green labels (#00FF00) in `IBMPlexMono` or `Courier New`.
- Interact with the graph:
* Hover over a node to see its full page title (e.g., "Lingua:Dictum") in a tooltip. * Click and drag nodes to reposition them.
- If the graph shows "No connections found," no other terms mention the current term in their `Glossary-Definition`.
Global Glossary Graph[edit]
- Navigate to Lingua:Global Glossary Graph.
- The graph shows:
* Nodes for all terms in (e.g., "Dictum", "Scriptum", "Artifex"). * Edges where one term’s `Glossary-Definition` mentions another term. * Same styling as individual graphs (green nodes, lines, labels, black background).
- Interact with the graph:
* Drag nodes to explore connections. * Hover for tooltips with full page titles. * Isolated nodes (no edges) indicate terms not mentioned in any `Glossary-Definition`, highlighting areas needing additional definitions.
Adding Connections[edit]
To create connections in the graphs:
- Edit a glossary term page (e.g., Lingua:TestTerm).
- In the `Definition` parameter of `Graphs
Semantic Graph[edit]
`, mention another term (e.g., "This term relates to Dictum").
- Save and purge the page (`?action=purge`).
- The graph will update to show an edge to the mentioned term (e.g., from Lingua:TestTerm to Lingua:Dictum).
- To make connections bidirectional, ensure terms mention each other (e.g., add "TestTerm" to Lingua:Dictum’s definition).
Interpreting the Graphs[edit]
- Nodes: Represent glossary terms (e.g., "Dictum", "Scriptum"). Labels show the short term name; tooltips show the full page title (e.g., "Lingua:Dictum").
- Edges: Indicate that one term’s `Glossary-Definition` mentions another term. For example, if Lingua:TestTerm’s definition includes "Dictum," an edge connects "TestTerm" to "Dictum."
- Isolated Nodes: Terms with no incoming or outgoing edges are not mentioned in any `Glossary-Definition`. These are gaps where definitions can be added to enhance connectivity.
- Dense Clusters: Indicate highly interconnected terms, suggesting a well-defined concept group.
- Use the Lingua:Global Glossary Graph to identify isolated nodes or sparse areas needing more definitions.
Troubleshooting[edit]
- Graph Shows "Error: API request failed":
* Check the browser console (F12 > Console) for "SMW API error details." * Verify the SMW API is working: ``` curl "https://www.ooda.wiki/api.php?action=askargs&conditions=Category:Glossary%20Entries&printouts=Glossary-Term%7CGlossary-Definition¶meters=limit=50&format=json&formatversion=2" ``` * Ensure the gadgets are enabled in Special:Preferences#mw-prefsection-gadgets.
- Graph Shows "No connections found":
* Check if other terms mention the current term in their `Glossary-Definition` at . * Verify SMW properties at Special:Browse/:Lingua:Dictum (replace with the term’s page title).
- Labels Missing or Styling Incorrect:
* Ensure MediaWiki:Common.css includes: ```css @font-face { font-family: "IBMPlexMono"; src: url("https://www.ooda.wiki/resources/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: normal; font-style: normal; } .global-glossary-graph, .glossary-graph, .documentation, .documentation-metadata, .documentation-heading, .documentation-toolbar, .documentation h2, .documentation h3, .documentation h4 { font-family: "IBMPlexMono", "Courier New", monospace; } ``` * Purge MediaWiki:Common.css (`?action=purge`).
- Graph Not Updating:
* Purge the affected page (e.g., Lingua:Dictum?action=purge). * Run maintenance scripts (as admin): ``` php maintenance/run.php runJobs php maintenance/run.php refreshLinks php extensions/SemanticMediaWiki/maintenance/rebuildData.php ```
- If issues persist, contact an admin with console errors and debug logs:
``` cat /var/www/mediawiki/debug.log | tail -n 50 ```
Enhancing the Glossary[edit]
To improve the graphs and address gaps:
- Visit Lingua:Global Glossary Graph.
- Identify isolated nodes (terms with no edges).
- Edit those terms’ pages to add mentions of other terms in their `Glossary-Definition`.
- Example: To connect Lingua:TestTerm, edit its definition:
```wikitextTestTermThis is a test term mentioning Dictum and Scriptum.
Semantic Graph[edit]
```
- Purge the page and check Lingua:Global Glossary Graph for updated connections.