@ldforge/editor 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/docs/renderers.md +19 -16
  2. package/package.json +3 -3
package/docs/renderers.md CHANGED
@@ -25,32 +25,35 @@ The tab appears for results declaring `geometry`. Use `# view=geo` to activate i
25
25
 
26
26
  ### Map display modes
27
27
 
28
- The selector offers **Normal**, **Grouped**, and **Heatmap** (localized in Dutch). Normal draws each feature. Grouped uses Supercluster to combine nearby points, shows their counts, and expands clusters on click or zoom. Heatmap uses simpleheat to show point density with equal weight per point. MultiPoint members are individual observations. Lines and polygons remain visible in all modes and are not interpreted as point observations. When there are only shapes, the original geometry is shown without loading a mode library.
28
+ The compact button group offers **Normal**, **Grouped**, and **Heatmap** (localized in Dutch). Normal draws each feature. Grouped uses Supercluster to combine nearby points, shows their counts, and expands clusters on click or zoom. Heatmap uses simpleheat to show point density with equal weight per point. MultiPoint members are individual observations. Lines and polygons remain visible in all modes and are not interpreted as point observations. When there are only shapes, the original geometry is shown without loading a mode library.
29
29
 
30
- Choose the initial mode with `# view=geo; geo-mode=grouped` or `geo-mode=heatmap`; the host option `mode` supplies the default. Invalid mode directives fall back to Normal. Switching modes preserves map position. Supercluster 8.0.1 and simpleheat 0.4.0 are separate pinned external ESM downloads that happen only when that mode is first selected. Configure `clusterLibraryUrl`/`heatLibraryUrl` or inject `loadClusterLibrary`/`loadHeatLibrary` for self-hosting. Failed mode loads can be retried; late completions after another selection or cleanup cannot replace the active view. Supercluster is ISC licensed and simpleheat is BSD-2-Clause licensed.
30
+ Choose the initial mode with `# view=geo; mode=grouped` or `mode=heatmap`; the host option `mode` supplies the default. `geo-mode` remains supported as an alias; `mode` takes precedence when both are supplied. Invalid mode directives fall back to Normal. Switching modes preserves map position. Supercluster 8.0.1 and simpleheat 0.4.0 are separate pinned external ESM downloads that happen only when that mode is first selected. Configure `clusterLibraryUrl`/`heatLibraryUrl` or inject `loadClusterLibrary`/`loadHeatLibrary` for self-hosting. Failed mode loads can be retried; late completions after another selection or cleanup cannot replace the active view. Supercluster is ISC licensed and simpleheat is BSD-2-Clause licensed.
31
31
 
32
- ### Wikidata example
32
+ ### OpenStreetMap example
33
33
 
34
- Endpoint: `https://query.wikidata.org/sparql` (GET). This bounded query retrieves five Dutch cities using Wikidata's [coordinate location (P625)](https://www.wikidata.org/wiki/Property:P625). Coordinates are returned as WKT points, ready for the plugin. The demo's **Map example (Wikidata)** selects this endpoint and query.
34
+ Endpoint: `https://api.triplydb.com/datasets/osm/osm/services/osm/sparql` (GET). This query retrieves features tagged `leisure=track` with their WKT geometry and an optional name, falling back to “Atletiekbaan”. It starts in Heatmap mode and has no sport filter or result limit. The demo's **Map example (athletics tracks)** selects this endpoint and query.
35
35
 
36
36
  ```sparql
37
- # view=geo; geo-title=Nederlandse plaatsen
38
- PREFIX wd: <http://www.wikidata.org/entity/>
39
- PREFIX wdt: <http://www.wikidata.org/prop/direct/>
40
- PREFIX wikibase: <http://wikiba.se/ontology#>
41
- PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
42
- PREFIX bd: <http://www.bigdata.com/rdf#>
37
+ # view=geo; mode=heatmap; geo-title=Atletiekbanen in Nederland
38
+ PREFIX geo: <http://www.opengis.net/ont/geosparql#>
39
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
40
+ PREFIX osmt: <https://data.osm.pldn.nl/wiki/Key:>
41
+ PREFIX track: <https://data.osm.pldn.nl/wiki/Tag:leisure=track>
42
+ PREFIX athletics: <https://data.osm.pldn.nl/wiki/Tag:sport=athletics>
43
+
43
44
  SELECT ?place ?geometryLabel ?geometry WHERE {
44
- VALUES ?place { wd:Q727 wd:Q36600 wd:Q9920 wd:Q803 wd:Q34370 }
45
- ?place wdt:P625 ?geometry .
46
- SERVICE wikibase:label {
47
- bd:serviceParam wikibase:language "nl,en" .
48
- ?place rdfs:label ?geometryLabel .
45
+ ?place osmt:leisure track: ;
46
+ geo:hasGeometry/geo:asWKT ?geometry .
47
+
48
+ OPTIONAL {
49
+ ?place skos:prefLabel ?name .
49
50
  }
51
+
52
+ BIND(COALESCE(?name, "Atletiekbaan") AS ?geometryLabel)
50
53
  }
51
54
  ```
52
55
 
53
- `P625` provides points. For source lines and polygons, return WKT from an endpoint with GeoSPARQL geometry, such as `?item geo:hasGeometry/geo:asWKT ?geometry`. The OSM swimming-pool query can be used as supplied with `# view=geo` added above its prefixes. Other projections must first be converted to WGS84/CRS84.
56
+ The source supplies geometry through `geo:hasGeometry/geo:asWKT`. Other projections must first be converted to WGS84/CRS84.
54
57
 
55
58
  This deterministic query demonstrates all three basic types on any SPARQL 1.1 endpoint:
56
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldforge/editor",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "LDForge editor: composable SPARQL tooling",
5
5
  "type": "module",
6
6
  "license": "EUPL-1.2",
@@ -35,8 +35,8 @@
35
35
  "@codemirror/lint": "^6.9.8",
36
36
  "@codemirror/state": "^6.7.6",
37
37
  "@codemirror/view": "^6.43.15",
38
- "@ldforge/core": "^0.1.3",
39
- "@ldforge/prefixes": "^0.1.3",
38
+ "@ldforge/core": "^0.1.4",
39
+ "@ldforge/prefixes": "^0.1.4",
40
40
  "@lezer/common": "^1.5.5",
41
41
  "codemirror-lang-sparql": "^2.1.0",
42
42
  "sparql-formatter": "^1.0.2"