@matdata/yasgui-utils 5.2.0 → 5.4.0
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 +128 -144
- package/package.json +1 -1
- package/src/store.d.ts +13 -0
package/README.md
CHANGED
|
@@ -1,196 +1,180 @@
|
|
|
1
1
|
# YASGUI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Go to https://yasgui.matdata.eu/ and use it freely in production. Or fork this repo and extend it yourself. Contributions are certainly welcome!
|
|
6
|
-
|
|
7
|
-
## Table of Contents
|
|
8
|
-
|
|
9
|
-
- [Useful Links](#useful-links)
|
|
10
|
-
- [Features](#features)
|
|
11
|
-
- [Keyboard Shortcuts](#keyboard-shortcuts)
|
|
12
|
-
- [Query Editor (Yasqe)](#query-editor-yasqe)
|
|
13
|
-
- [Fullscreen Mode](#fullscreen-mode)
|
|
14
|
-
- [URI Explorer](#uri-explorer)
|
|
15
|
-
- [Prefix Management](#prefix-management)
|
|
16
|
-
- [Result Visualization Plugins (Yasr)](#result-visualization-plugins-yasr)
|
|
17
|
-
- [Installation](#installation)
|
|
18
|
-
- [npm](#npm)
|
|
19
|
-
- [Yarn](#yarn)
|
|
20
|
-
- [Local Development](#local-development)
|
|
21
|
-
- [License](#license)
|
|
22
|
-
|
|
23
|
-
## Useful Links
|
|
24
|
-
|
|
25
|
-
- Production environment: https://yasgui.matdata.eu/
|
|
26
|
-
- Dev environment: https://yasgui-dev.matdata.eu/ (GitHub Pages - automatically updated with every commit to main branch)
|
|
27
|
-
- User documentation: https://docs.triply.cc/yasgui/
|
|
28
|
-
- Developer documentation: https://docs.triply.cc/yasgui-api/
|
|
29
|
-
- Docker Hub: https://hub.docker.com/r/mathiasvda/yasgui
|
|
3
|
+
**Yet Another SPARQL GUI (YASGUI)** is a powerful, user-friendly web-based interface for querying and exploring RDF data using SPARQL. It combines a feature-rich query editor (YASQE) with a versatile results viewer (YASR) to provide a comprehensive SPARQL IDE.
|
|
30
4
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Themes
|
|
34
|
-
|
|
35
|
-
Yasgui supports both **light** and **dark** themes with instant switching:
|
|
36
|
-
|
|
37
|
-
- **Theme Toggle Button**: Quickly switch between light and dark modes using the button in the tab bar
|
|
38
|
-
- **Persistent Preference**: Your theme choice is automatically saved
|
|
39
|
-
- **System Detection**: Automatically matches your system's dark/light mode preference
|
|
40
|
-
- **Full Coverage**: Consistent theming across all components (editor, results, modals)
|
|
41
|
-
|
|
42
|
-
See the [Theme Guide](./docs/THEME_GUIDE.md) for detailed configuration options and usage examples.
|
|
43
|
-
|
|
44
|
-
See the [Theme Implementation Guide](./docs/THEME_IMPLEMENTATION_GUIDE.md) for detailed instructions on how to implement theme support in your own Yasgui plugins.
|
|
45
|
-
|
|
46
|
-
### Layout Orientation
|
|
47
|
-
|
|
48
|
-
Yasgui supports two layout orientations to optimize screen space usage:
|
|
49
|
-
|
|
50
|
-
- **Vertical Layout (Default)**: YASQE (query editor) positioned above YASR (results viewer)
|
|
51
|
-
- **Horizontal Layout**: YASQE and YASR positioned side-by-side
|
|
52
|
-
|
|
53
|
-
The horizontal layout is particularly useful for wide monitors, allowing you to dedicate the complete height to both the query editor and results viewer.
|
|
54
|
-
|
|
55
|
-
#### Runtime Toggle
|
|
56
|
-
|
|
57
|
-
Users can switch between vertical and horizontal layouts at any time using the **layout toggle button** in the control bar (next to the endpoint selector). This button shows:
|
|
58
|
-
- **Side-by-side rectangles icon** when in vertical mode (click to switch to horizontal)
|
|
59
|
-
- **Stacked rectangles icon** when in horizontal mode (click to switch to vertical)
|
|
60
|
-
|
|
61
|
-
#### Initial Configuration
|
|
62
|
-
|
|
63
|
-
You can also set the initial layout orientation when creating a Yasgui instance:
|
|
64
|
-
|
|
65
|
-
```javascript
|
|
66
|
-
new Yasgui(document.getElementById("yasgui"), {
|
|
67
|
-
orientation: "horizontal" // or "vertical" (default)
|
|
68
|
-
});
|
|
69
|
-
```
|
|
5
|
+
🌐 **Try it now**: [https://yasgui.matdata.eu/](https://yasgui.matdata.eu/)
|
|
70
6
|
|
|
71
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/@matdata/yasgui)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
72
9
|
|
|
73
|
-
|
|
10
|
+
---
|
|
74
11
|
|
|
75
|
-
|
|
76
|
-
.yasgui {
|
|
77
|
-
--yasgui-header-height: 120px; /* Adjust based on your header height */
|
|
78
|
-
--yasgui-min-height: 500px; /* Minimum height for horizontal layout panels */
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Keyboard Shortcuts
|
|
83
|
-
|
|
84
|
-
#### Query Editor (Yasqe)
|
|
85
|
-
- **Ctrl+Enter** / **Cmd+Enter**: Execute the current query
|
|
86
|
-
- **Ctrl+Space**: Trigger autocomplete
|
|
87
|
-
- **Ctrl+S**: Save query to local storage
|
|
88
|
-
- **Shift+Ctrl+F**: Auto-format the query
|
|
89
|
-
- **Ctrl+/**: Comment/uncomment selected lines
|
|
90
|
-
- **Shift+Ctrl+D**: Duplicate the current line
|
|
91
|
-
- **Shift+Ctrl+K**: Delete the current line
|
|
92
|
-
- **Esc**: Remove focus from the editor
|
|
93
|
-
|
|
94
|
-
#### Fullscreen Mode
|
|
95
|
-
- **F11**: Toggle fullscreen mode for the query editor (Yasqe)
|
|
96
|
-
- **F10**: Toggle fullscreen mode for the results viewer (Yasr)
|
|
97
|
-
- **Ctrl+Shift+F**: Switch between Yasqe and Yasr fullscreen modes
|
|
98
|
-
|
|
99
|
-
#### URI Explorer
|
|
100
|
-
- **Ctrl+Click** on any URI in the query editor: Automatically executes a CONSTRUCT query to explore the clicked URI's connections (incoming and outgoing triples). The query runs in the background without modifying your current query in the editor.
|
|
12
|
+
## Quick Links
|
|
101
13
|
|
|
102
|
-
|
|
103
|
-
- **
|
|
104
|
-
- **
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- **
|
|
109
|
-
- **Prefix Autocomplete**: When typing a prefix declaration (e.g., `PREFIX foaf:`), the editor automatically queries [prefix.cc](https://prefix.cc) to suggest and auto-complete the full URI commonly associated with that prefix. This helps you quickly add standard prefixes without needing to remember their full URIs.
|
|
14
|
+
- 📖 **[User Guide](./docs/user-guide.md)** - Complete guide for end users
|
|
15
|
+
- 🛠️ **[Developer Guide](./docs/developer-guide.md)** - API reference and integration guide
|
|
16
|
+
- 🚀 **[Production Environment](https://yasgui.matdata.eu/)** - Live instance
|
|
17
|
+
- 📦 **[npm Package](https://www.npmjs.com/package/@matdata/yasgui)**
|
|
18
|
+
- 🐳 **[Docker Hub](https://hub.docker.com/r/mathiasvda/yasgui)**
|
|
19
|
+
- 📝 **[Releases & Changelog](https://github.com/Matdata-eu/Yasgui/releases)**
|
|
20
|
+
- 💻 **[GitHub Repository](https://github.com/Matdata-eu/Yasgui)**
|
|
110
21
|
|
|
111
|
-
|
|
22
|
+
---
|
|
112
23
|
|
|
113
|
-
|
|
24
|
+
## Documentation
|
|
114
25
|
|
|
115
|
-
|
|
116
|
-
- **User-Defined Buttons**: Users can add their own custom endpoint buttons through the Settings modal
|
|
117
|
-
- **One-Click Switching**: Instantly switch to a different SPARQL endpoint with a single button click
|
|
118
|
-
- **Persistent Custom Buttons**: User-defined buttons are saved in local storage
|
|
119
|
-
- **Fully Themed**: Buttons automatically adapt to light and dark themes
|
|
26
|
+
The **documentation for YASGUI is hosted on GitHub Pages**:
|
|
120
27
|
|
|
121
|
-
|
|
28
|
+
- **📚 Documentation Website**: [https://yasgui-doc.matdata.eu/](https://matdata-eu.github.io/Yasgui/)
|
|
29
|
+
- User Guide, Developer Guide, API Reference
|
|
30
|
+
- Built with Docusaurus
|
|
31
|
+
- Version-tagged with the repository
|
|
122
32
|
|
|
123
|
-
|
|
33
|
+
- **🚀 Development Build**: [https://yasgui-doc.matdata.eu/dev/main/](https://matdata-eu.github.io/Yasgui/dev/main/)
|
|
34
|
+
- Live build from the main branch
|
|
35
|
+
- Updated automatically with every commit
|
|
36
|
+
- Test latest features before release
|
|
124
37
|
|
|
125
|
-
|
|
38
|
+
The documentation is version-tagged with the repository, ensuring consistency between code and documentation across releases.
|
|
126
39
|
|
|
127
|
-
|
|
128
|
-
- **Boolean**: Displays boolean results (true/false) with visual indicators. Automatically used for ASK queries.
|
|
129
|
-
- **Response**: Raw response viewer with syntax highlighting and code folding. Shows the original response from the endpoint in JSON, XML, Turtle, or other formats.
|
|
130
|
-
- **Geo**: Geographic visualization plugin for displaying spatial data on interactive maps. Visualizes geospatial triples with coordinates. See [Yasgui Geo TG Plugin](https://github.com/Thib-G/yasgui-geo-tg) for more details.
|
|
131
|
-
- **Graph**: Visual graph representation of RDF data using nodes and edges. Ideal for CONSTRUCT/DESCRIBE query results. See [Yasgui Graph Plugin](https://github.com/Matdata-eu/yasgui-graph-plugin) for more details.
|
|
132
|
-
- **Error**: Displays error messages and diagnostics when queries fail, including CORS troubleshooting guidance.
|
|
40
|
+
## Features
|
|
133
41
|
|
|
134
|
-
|
|
42
|
+
YASGUI provides a complete SPARQL development environment with powerful features:
|
|
43
|
+
|
|
44
|
+
### ✏️ Advanced Query Editor
|
|
45
|
+
- **[SPARQL Syntax Highlighting](./docs/user-guide.md#yasqe-query-editor)** - Color-coded SPARQL with error detection
|
|
46
|
+
- **[Smart Autocomplete](./docs/user-guide.md#prefix-management)** - Context-aware suggestions for keywords, prefixes, and URIs
|
|
47
|
+
- **[Query Formatting](./docs/user-guide.md#query-formatting)** - One-click query beautification with configurable formatters
|
|
48
|
+
- **[Prefix Management](./docs/user-guide.md#prefix-management)** - Auto-capture and reuse PREFIX declarations
|
|
49
|
+
- **[URI Explorer](./docs/user-guide.md#uri-explorer)** - Ctrl+Click URIs to explore connections
|
|
50
|
+
- **[Keyboard Shortcuts](./docs/user-guide.md#keyboard-shortcuts)** - Efficient query development workflow
|
|
51
|
+
|
|
52
|
+
### 📊 Powerful Visualizations
|
|
53
|
+
- **[Table Plugin](./docs/user-guide.md#table-plugin)** - Sortable, filterable, paginated result tables
|
|
54
|
+
- **[Graph Plugin](./docs/user-guide.md#graph-plugin)** - Interactive RDF graph visualization
|
|
55
|
+
- **[Geo Plugin](./docs/user-guide.md#geo-plugin)** - Geographic data on interactive maps
|
|
56
|
+
- **[Response Plugin](./docs/user-guide.md#response-plugin)** - Raw response viewer with syntax highlighting
|
|
57
|
+
- **[Boolean Plugin](./docs/user-guide.md#boolean-plugin)** - Visual true/false indicators for ASK queries
|
|
58
|
+
- **[Error Plugin](./docs/user-guide.md#error-plugin)** - Detailed error diagnostics
|
|
59
|
+
|
|
60
|
+
### 🎨 Themes & Layouts
|
|
61
|
+
- **[Light & Dark Themes](./docs/user-guide.md#themes)** - Seamless theme switching with persistent preferences
|
|
62
|
+
- **[Flexible Layouts](./docs/user-guide.md#layout-orientation)** - Vertical or horizontal editor/results arrangement
|
|
63
|
+
|
|
64
|
+
### 🔧 Expert Features
|
|
65
|
+
- **[Multiple Tabs](./docs/user-guide.md#query-tabs)** - Work on multiple queries simultaneously
|
|
66
|
+
- **[Endpoint Management](./docs/user-guide.md#endpoint-quick-switch)** - Quick-switch between SPARQL endpoints
|
|
67
|
+
- **[Persistent Storage](./docs/user-guide.md#query-history-and-persistence)** - Auto-save queries and preferences
|
|
68
|
+
- **[URL Sharing](./docs/user-guide.md#share-queries)** - Share queries via URL parameters
|
|
69
|
+
- **[Fullscreen Mode](./docs/user-guide.md#fullscreen-mode)** - Maximize editor or results viewer
|
|
70
|
+
- **[Export Results](./docs/developer-guide.md#yasr-class)** - Download results in various formats
|
|
71
|
+
|
|
72
|
+
For detailed feature documentation, see the **[User Guide](./docs/user-guide.md)**.
|
|
135
73
|
|
|
136
74
|
## Installation
|
|
137
75
|
|
|
138
|
-
Below are instructions on how to include Yasgui in your project.
|
|
139
|
-
If you only want to install Yasr or Yasqe, replace yasgui in the commands below.
|
|
140
|
-
|
|
141
76
|
### npm
|
|
142
77
|
|
|
143
|
-
```
|
|
144
|
-
npm
|
|
78
|
+
```bash
|
|
79
|
+
npm install @matdata/yasgui
|
|
145
80
|
```
|
|
146
81
|
|
|
147
82
|
### Yarn
|
|
148
83
|
|
|
149
|
-
```
|
|
84
|
+
```bash
|
|
150
85
|
yarn add @matdata/yasgui
|
|
151
86
|
```
|
|
152
87
|
|
|
153
|
-
###
|
|
88
|
+
### CDN
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<link rel="stylesheet" href="https://unpkg.com/@matdata/yasgui/build/yasgui.min.css" />
|
|
92
|
+
<script src="https://unpkg.com/@matdata/yasgui/build/yasgui.min.js"></script>
|
|
93
|
+
```
|
|
154
94
|
|
|
155
|
-
|
|
95
|
+
### Docker
|
|
156
96
|
|
|
157
|
-
```
|
|
97
|
+
```bash
|
|
158
98
|
docker pull mathiasvda/yasgui:latest
|
|
159
99
|
docker run -p 8080:8080 mathiasvda/yasgui:latest
|
|
160
100
|
```
|
|
161
101
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
```sh
|
|
102
|
+
**Custom endpoint:**
|
|
103
|
+
```bash
|
|
165
104
|
docker run -p 8080:8080 -e YASGUI_DEFAULT_ENDPOINT=https://your-endpoint.com/sparql mathiasvda/yasgui:latest
|
|
166
105
|
```
|
|
167
106
|
|
|
168
|
-
|
|
107
|
+
For detailed installation instructions and usage examples, see the **[Developer Guide](./docs/developer-guide.md#installation)**.
|
|
108
|
+
|
|
109
|
+
## Quick Start
|
|
110
|
+
|
|
111
|
+
### Basic HTML Usage
|
|
112
|
+
|
|
113
|
+
```html
|
|
114
|
+
<!DOCTYPE html>
|
|
115
|
+
<html>
|
|
116
|
+
<head>
|
|
117
|
+
<link rel="stylesheet" href="https://unpkg.com/@matdata/yasgui/build/yasgui.min.css" />
|
|
118
|
+
</head>
|
|
119
|
+
<body>
|
|
120
|
+
<div id="yasgui"></div>
|
|
121
|
+
|
|
122
|
+
<script src="https://unpkg.com/@matdata/yasgui/build/yasgui.min.js"></script>
|
|
123
|
+
<script>
|
|
124
|
+
const yasgui = new Yasgui(document.getElementById("yasgui"), {
|
|
125
|
+
requestConfig: {
|
|
126
|
+
endpoint: "https://dbpedia.org/sparql"
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
</script>
|
|
130
|
+
</body>
|
|
131
|
+
</html>
|
|
132
|
+
```
|
|
169
133
|
|
|
170
|
-
|
|
134
|
+
### ES Modules / React / Vue / Angular
|
|
171
135
|
|
|
172
|
-
|
|
136
|
+
```javascript
|
|
137
|
+
import Yasgui from '@matdata/yasgui';
|
|
138
|
+
import '@matdata/yasgui/build/yasgui.min.css';
|
|
139
|
+
|
|
140
|
+
const yasgui = new Yasgui(document.getElementById('yasgui'), {
|
|
141
|
+
requestConfig: {
|
|
142
|
+
endpoint: 'https://query.wikidata.org/sparql'
|
|
143
|
+
},
|
|
144
|
+
theme: 'dark',
|
|
145
|
+
orientation: 'horizontal'
|
|
146
|
+
});
|
|
147
|
+
```
|
|
173
148
|
|
|
174
|
-
|
|
149
|
+
For framework-specific examples and advanced usage, see the **[Developer Guide](./docs/developer-guide.md#usage-examples)**.
|
|
175
150
|
|
|
176
|
-
|
|
151
|
+
---
|
|
177
152
|
|
|
178
|
-
|
|
153
|
+
## Contributing
|
|
179
154
|
|
|
180
|
-
|
|
155
|
+
We welcome contributions! To get started:
|
|
181
156
|
|
|
182
|
-
|
|
157
|
+
1. Fork the repository
|
|
158
|
+
2. Clone and install: `npm install`
|
|
159
|
+
3. Run dev server: `npm run dev`
|
|
160
|
+
4. Make your changes
|
|
161
|
+
5. Run tests: `npm test`
|
|
162
|
+
6. Submit a pull request
|
|
183
163
|
|
|
184
|
-
|
|
164
|
+
For detailed contribution guidelines, see the **[Developer Guide](./docs/developer-guide.md#contributing)**.
|
|
165
|
+
|
|
166
|
+
---
|
|
185
167
|
|
|
186
168
|
## License
|
|
187
169
|
|
|
170
|
+
MIT License - see [LICENSE](./LICENSE) file for details.
|
|
171
|
+
|
|
188
172
|
This is a fork from [Zazuko](https://github.com/zazuko/Yasgui) who forked it from [Triply](https://github.com/TriplyDB/Yasgui).
|
|
189
173
|
|
|
190
|
-
|
|
174
|
+
---
|
|
191
175
|
|
|
192
|
-
## Release
|
|
176
|
+
## Release Notes & Changelog
|
|
193
177
|
|
|
194
|
-
Release notes
|
|
178
|
+
Release notes and changelog are available in the [Releases](https://github.com/Matdata-eu/Yasgui/releases) section.
|
|
195
179
|
|
|
196
|
-
|
|
180
|
+
For instructions on writing release notes, see [release_notes_instructions.md](./docs/release_notes_instructions.md)
|
package/package.json
CHANGED
package/src/store.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare module "store" {
|
|
2
|
+
interface StoreAPI {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
get(key: string): any;
|
|
5
|
+
set(key: string, value: any): void;
|
|
6
|
+
remove(key: string): void;
|
|
7
|
+
clearAll(): void;
|
|
8
|
+
each(callback: (value: any, key: string) => void): void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const store: StoreAPI;
|
|
12
|
+
export default store;
|
|
13
|
+
}
|