|
| 1 | +# MetaConfigurator RDF Panel User Guide |
| 2 | + |
| 3 | +This guide explains how to use the RDF panel in MetaConfigurator. You will move from plain JSON to a queryable and visual knowledge graph: |
| 4 | + |
| 5 | +1. Start from structured JSON in the Data tab. |
| 6 | +2. Open the RDF panel. |
| 7 | +3. Convert JSON to JSON-LD with RML (optionally with AI drafting). |
| 8 | +4. Review and edit triples in the RDF panel. |
| 9 | +5. Use ontology assistance when choosing IRIs. |
| 10 | +6. Run SPARQL queries (also with AI drafting). |
| 11 | +7. Explore and refine the graph visually. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Data |
| 16 | + |
| 17 | +We use two main examples throughout this document: a simple simulation dataset and a MOF dataset. |
| 18 | + |
| 19 | +- [`samples/simulation-data.json`](./samples/simulation-data.json) |
| 20 | +- [`samples/simulation-mapping.ttl`](./samples/simulation-mapping.ttl) |
| 21 | +- [`samples/simulation-data.jsonld`](./samples/simulation-data.jsonld) |
| 22 | +- [`samples/simulation-query.sparql`](./samples/simulation-query.sparql) |
| 23 | + |
| 24 | +- [`samples/mof-data.json`](./samples/mof-data.json) |
| 25 | +- [`samples/mof-mapping.ttl`](./samples/mof-mapping.ttl) |
| 26 | +- [`samples/mof-data.jsonld`](./samples/mof-data.jsonld) |
| 27 | +- [`samples/mof-prep-query.sparql`](./samples/mof-prep-query.sparql) |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## 1) Start with JSON Data |
| 32 | + |
| 33 | +Begin with your normal structured JSON (simulation data, lab records, process logs, etc.). |
| 34 | + |
| 35 | +- Simulation example: [`samples/simulation-data.json`](./samples/simulation-data.json) |
| 36 | +- MOF example: [`samples/mof-data.json`](./samples/mof-data.json) |
| 37 | + |
| 38 | +Open the RDF panel in the Data tab by clicking the globe icon. |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +Initially, the panel shows a warning that your data is not in JSON-LD format. This means: |
| 43 | + |
| 44 | +- Your data is already valid JSON. |
| 45 | +- It is not yet ready for semantic querying until converted to JSON-LD. |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +Now you have two options to proceed: |
| 50 | + |
| 51 | +- Use the **JSON to JSON-LD** (RML conversion) tool, or |
| 52 | +- Use **Turtle import** if your data is already in RDF/Turtle format. |
| 53 | + |
| 54 | +Before using RML mapping, please review the RML documentation at [this link](https://rml.io/docs/rml/introduction/). |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +## 2) Convert JSON to JSON-LD with RML |
| 59 | + |
| 60 | +Use the RML mapping dialog to define how JSON fields become RDF entities and relationships. |
| 61 | + |
| 62 | +Again, you can proceed in two ways: |
| 63 | + |
| 64 | +- Paste an existing RML mapping, or |
| 65 | +- Generate a draft mapping with AI and then adjust it. |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | +Sample mappings: |
| 70 | + |
| 71 | +- Simulation mapping: [`samples/simulation-mapping.ttl`](./samples/simulation-mapping.ttl) |
| 72 | +- MOF mapping: [`samples/mof-mapping.ttl`](./samples/mof-mapping.ttl) |
| 73 | + |
| 74 | +Practical recommendation: |
| 75 | + |
| 76 | +- Treat AI-generated mapping as a first draft. |
| 77 | +- Confirm identifiers, classes, and property choices before applying. |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +## 3) Inspect and Edit JSON-LD / RDF Triples |
| 82 | + |
| 83 | +After conversion, the RDF panel gives two synchronized tabs: |
| 84 | + |
| 85 | +- **Context**: manage prefix and context definitions. |
| 86 | +- **Triples**: manage subject-predicate-object statements. |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | +Typical tasks in the **Triples** tab: |
| 95 | + |
| 96 | +- Add, edit, and delete triples. |
| 97 | +- Search and filter across subject, predicate, object. |
| 98 | +- Export graph data as Turtle, N-Triples, or RDF/XML. |
| 99 | +- Open SPARQL and visualization directly from the same toolbar. |
| 100 | + |
| 101 | +Note: If you filter data in the Triples tab and then open the visualization dialog, you will see only the graph for the filtered data, not the entire dataset. |
| 102 | + |
| 103 | +Sample JSON-LD outputs: |
| 104 | + |
| 105 | +- Simulation: [`samples/simulation-data.jsonld`](./samples/simulation-data.jsonld) |
| 106 | +- MOF : [`samples/mof-data.jsonld`](./samples/mof-data.jsonld) |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +## 4) Use Ontology-Assisted IRI Selection |
| 111 | + |
| 112 | +When editing predicates or object IRIs, open **Ontology Explorer** for guided selection. |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | +What you can do there: |
| 119 | + |
| 120 | +- Select a prefix from your current `@context`. |
| 121 | +- Download ontology content by URL or upload an ontology file. |
| 122 | +- Reuse cached ontology data, refresh it, or delete it. |
| 123 | +- Browse `DatatypeProperty`, `ObjectProperty`, and `Class` terms. |
| 124 | +- Use ontology-side SPARQL to discover additional terms quickly. |
| 125 | +- Pick a term and insert it back into the triple editor. |
| 126 | + |
| 127 | +This is especially helpful for consistent use of units, classes, and shared vocabularies. |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## 5) Query with SPARQL (Optional AI Drafting) |
| 132 | + |
| 133 | +Open SPARQL from the triples toolbar to validate and analyze your graph. |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | +In this dialog, you can: |
| 144 | + |
| 145 | +- Write or paste SPARQL manually. |
| 146 | +- Ask AI to draft a query from a natural-language prompt. You can ask question from your data, since a subset of your JSON-LD data is being sent to the AI-endpoint. |
| 147 | +- Run query and inspect results in a filterable table. |
| 148 | +- Export results (CSV for tabular outputs when visualization is disabled, and RDF-based extensions for visualization-based queries). |
| 149 | + |
| 150 | +Visualization note: |
| 151 | + |
| 152 | +- You can enable query-result visualization mode. |
| 153 | +- This mode expects a graph-shaped query result (CONSTRUCT-style output). |
| 154 | +- You can also click the visualization help icon near the toggle for more information on how to create a valid query for visualization. |
| 155 | + |
| 156 | +Sample queries: |
| 157 | + |
| 158 | +- Simulation: [`samples/simulation-query.sparql`](./samples/simulation-query.sparql) |
| 159 | +- MOF prep-step: [`samples/mof-prep-query.sparql`](./samples/mof-prep-query.sparql) |
| 160 | + |
| 161 | +--- |
| 162 | + |
| 163 | +## 6) Visualize and Refine the Knowledge Graph |
| 164 | + |
| 165 | +Use **Visualize** to inspect relationships as a graph. |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | + |
| 170 | + |
| 171 | +Two visualization modes: |
| 172 | + |
| 173 | +- From RDF Triples tab: **editable graph** (rename node, add/delete properties, add/delete nodes). |
| 174 | +- From SPARQL visualizer tab: **read-only graph** for query result exploration. |
| 175 | + |
| 176 | +Useful actions in the visualization dialog: |
| 177 | + |
| 178 | +- Node search and quick focus. |
| 179 | +- Zoom controls and fit-to-view. |
| 180 | +- Optional layout animation. |
| 181 | +- Export graph image. |
| 182 | +- Undo/redo for edits. |
| 183 | + |
| 184 | +For very large graphs, the app warns before rendering and lets you continue or cancel. |
| 185 | + |
| 186 | +--- |
| 187 | + |
| 188 | +## Recommended End-to-End Workflow |
| 189 | + |
| 190 | +1. Validate raw JSON in Data/Schema views. |
| 191 | +2. Convert JSON to JSON-LD using RML (manual or AI draft). |
| 192 | +3. Confirm context prefixes and main entities in RDF panel. |
| 193 | +4. Clean up triples (missing links, wrong predicates, units, datatypes). |
| 194 | +5. Use Ontology Explorer for consistent vocabulary choices. |
| 195 | +6. Run SPARQL checks for your key domain questions. |
| 196 | +7. Inspect the graph visually and refine remaining issues. |
| 197 | +8. Export RDF or query results for downstream use. |
| 198 | + |
| 199 | +--- |
| 200 | + |
| 201 | +## Practical Quality Checks |
| 202 | + |
| 203 | +- Ensure important entities use stable and reusable identifiers. |
| 204 | +- Keep prefix usage consistent between `@context`, triples, and queries. |
| 205 | +- Use ontology IRIs for units/classes/properties instead of only plain text. |
| 206 | +- Review AI-generated mapping/query drafts before trusting them. |
| 207 | +- If the triple list is shortened due to display limits, increase RDF display limits in settings before final review. |
| 208 | +- Use Named Nodes (nodes with `@id`) instead of Blank Nodes. This makes it easier to find and edit triples in the Text view. |
0 commit comments