@matdata/yasgui-graph-plugin 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -15
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
4
|
[](https://www.npmjs.com/package/yasgui-graph-plugin)
|
|
5
5
|
|
|
6
|
-
A YASGUI plugin for visualizing SPARQL CONSTRUCT query results as interactive graphs with nodes (subjects/objects) and edges (predicates).
|
|
6
|
+
A YASGUI plugin for visualizing SPARQL CONSTRUCT and DESCRIBE query results as interactive graphs with nodes (subjects/objects) and edges (predicates).
|
|
7
7
|
|
|
8
8
|
## ✨ Features
|
|
9
9
|
|
|
10
10
|
- **🔷 Interactive Graph Visualization**: Automatic force-directed layout with smooth physics-based positioning
|
|
11
11
|
- **🎨 Smart Color Coding**:
|
|
12
|
-
- 🔵 Blue = URIs
|
|
13
|
-
- 🟢 Green =
|
|
14
|
-
-
|
|
15
|
-
-
|
|
12
|
+
- 🔵 Light Blue (#97C2FC) = URIs
|
|
13
|
+
- 🟢 Light Green (#a6c8a6ff) = Literals
|
|
14
|
+
- ⚪ Light Grey (#c5c5c5ff) = Blank nodes
|
|
15
|
+
- 🟠 Orange (#e15b13ff) = rdf:type objects (classes)
|
|
16
16
|
- **🔍 Navigation**: Mouse wheel zoom, drag to pan, "Zoom to Fit" button
|
|
17
17
|
- **✋ Drag & Drop**: Reorganize nodes by dragging them to new positions
|
|
18
18
|
- **💬 Tooltips**: Hover for full URI/literal details (300ms delay)
|
|
@@ -66,8 +66,9 @@ const yasgui = new Yasgui(document.getElementById('yasgui'), {
|
|
|
66
66
|
});
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
### Sample
|
|
69
|
+
### Sample Queries
|
|
70
70
|
|
|
71
|
+
**CONSTRUCT Query:**
|
|
71
72
|
```sparql
|
|
72
73
|
PREFIX ex: <http://example.org/>
|
|
73
74
|
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
|
@@ -82,6 +83,14 @@ CONSTRUCT {
|
|
|
82
83
|
WHERE {}
|
|
83
84
|
```
|
|
84
85
|
|
|
86
|
+
**DESCRIBE Query:**
|
|
87
|
+
```sparql
|
|
88
|
+
PREFIX ex: <http://example.org/>
|
|
89
|
+
|
|
90
|
+
# Returns all triples about the specified resources
|
|
91
|
+
DESCRIBE ex:Alice ex:Bob
|
|
92
|
+
```
|
|
93
|
+
|
|
85
94
|
After running the query, click the **"Graph"** tab to see the visualization.
|
|
86
95
|
|
|
87
96
|
## 🎮 User Guide
|
|
@@ -98,11 +107,11 @@ After running the query, click the **"Graph"** tab to see the visualization.
|
|
|
98
107
|
### Understanding Colors
|
|
99
108
|
|
|
100
109
|
| Color | Meaning | Example |
|
|
101
|
-
|
|
102
|
-
| 🔵 Blue | URI nodes | `ex:Person`, `ex:Alice` |
|
|
103
|
-
| 🟢 Green
|
|
104
|
-
|
|
|
105
|
-
|
|
|
110
|
+
|-------|---------|---------||
|
|
111
|
+
| 🔵 Light Blue (#97C2FC) | URI nodes | `ex:Person`, `ex:Alice` |
|
|
112
|
+
| 🟢 Light Green (#a6c8a6ff) | Literal values | `"Alice"`, `"30"^^xsd:integer` |
|
|
113
|
+
| ⚪ Light Grey (#c5c5c5ff) | Blank nodes | `_:b1`, `_:addr1` |
|
|
114
|
+
| 🟠 Orange (#e15b13ff) | rdf:type objects (classes) | `ex:Person` in `ex:Alice rdf:type ex:Person` |
|
|
106
115
|
|
|
107
116
|
## ⚙️ Configuration
|
|
108
117
|
|
|
@@ -213,17 +222,18 @@ Contributions welcome! Please follow the project constitution (`.specify/memory/
|
|
|
213
222
|
## 🐛 Troubleshooting
|
|
214
223
|
|
|
215
224
|
### Plugin tab not showing
|
|
216
|
-
-
|
|
225
|
+
- Verify plugin is registered correctly
|
|
217
226
|
- Check browser console for errors
|
|
218
227
|
- Verify YASGUI version is ^4.0.0
|
|
219
228
|
|
|
220
229
|
### Empty visualization
|
|
221
|
-
-
|
|
222
|
-
-
|
|
230
|
+
- Ensure query type is **CONSTRUCT** or **DESCRIBE**
|
|
231
|
+
- Confirm query returns triples (check "Table" or "Response" tab)
|
|
232
|
+
- Verify results have RDF structure
|
|
223
233
|
|
|
224
234
|
### Performance issues
|
|
225
235
|
- Limit results to <1000 nodes for best performance
|
|
226
|
-
- Disable physics after initial layout
|
|
236
|
+
- Disable physics after initial layout
|
|
227
237
|
- Consider using LIMIT clause in SPARQL query
|
|
228
238
|
|
|
229
239
|
For more help, see [Quickstart Guide - Troubleshooting](./specs/001-construct-graph-viz/quickstart.md#troubleshooting).
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matdata/yasgui-graph-plugin",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"description": "YASGUI plugin for visualizing SPARQL CONSTRUCT query results as interactive graphs",
|
|
4
|
+
"version": "1.0.2",
|
|
5
|
+
"description": "YASGUI plugin for visualizing SPARQL CONSTRUCT and DESCRIBE query results as interactive graphs",
|
|
6
6
|
"main": "dist/yasgui-graph-plugin.min.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
7
12
|
"scripts": {
|
|
8
13
|
"dev": "vite",
|
|
9
14
|
"build:demo": "vite build demo",
|