@@ -100,198 +100,112 @@ the entire registry, or a CSV diff between two schemas.
100100
101101## API Reference
102102
103- ** Base URL: ** ` https://sensein.group/NeuroGhost `
103+ Static JSON served by GitHub Pages — no auth, no rate limits, CORS open.
104104
105- The registry exposes two kinds of endpoints:
106-
107- | Type | Transport | Auth | Status |
108- | ------| -----------| ------| --------|
109- | Read (schemas, alignments, provenance) | Static JSON via GitHub Pages | None | ✅ Live |
110- | Transform (field mapping between schemas) | Serverless function (planned) | None | 🔜 Planned |
111-
112- CORS is open on all endpoints. No API key required.
105+ | Method | URL | Description | Status |
106+ | --------| -----| -------------| --------|
107+ | ` GET ` | [ ` /data/registry.json ` ] ( https://sensein.group/NeuroGhost/data/registry.json ) | Full registry: all schemas, classes, properties, alignments | ✅ Live |
108+ | ` GET ` | [ ` /data/versions/{version}.json ` ] ( https://sensein.group/NeuroGhost/data/versions/1.7.0.json ) | Frozen snapshot at a specific registry version | ✅ Live |
109+ | ` GET ` | [ ` /data/provenance.json ` ] ( https://sensein.group/NeuroGhost/data/provenance.json ) | Changelog of every schema ingestion | ✅ Live |
110+ | ` GET ` | ` /api/transform?from={schema}&to={schema} ` | Field-to-field mapping between two schemas | 🔜 Planned |
111+ | ` POST ` | ` /api/transform ` | Transform a dataset from one schema format to another | 🔜 Planned |
113112
114113---
115114
116115### ` GET /data/registry.json `
117116
118- Returns the full registry at the current version: all sources, classes,
119- properties, and pre-computed cross-schema alignments.
120-
121117``` bash
122118curl https://sensein.group/NeuroGhost/data/registry.json
123119```
124120
125- ** Response**
126121``` json
127122{
128123 "registry_version" : " 1.7.0" ,
129124 "generated_at" : " 2026-07-23T12:40:24Z" ,
130125 "sources" : [
131- { "label" : " bbqs" , "version" : " 1.0.0" , "class_count" : 29 },
132- { "label" : " bids" , "version" : " 1.9.0" , "class_count" : 1 },
133- { "label" : " dandi" , "version" : " 0.6.8" , "class_count" : 20 },
134- { "label" : " nwb" , "version" : " 2.7.0" , "class_count" : 53 }
126+ { "label" : " bbqs" , "version" : " 1.0.0" , "class_count" : 29 }
135127 ],
136128 "classes" : [
137129 {
138- "uid " : " 8003dcad- ..." ,
130+ "hash_id " : " sha256:abc123 ..." ,
139131 "iri" : " https://registry.sensein.io/obj/Subject" ,
140132 "name" : " Subject" ,
141133 "definition" : " A research participant." ,
142- "abstract" : false ,
143134 "source" : " bbqs" ,
144135 "properties" : [
145- {
146- "uid" : " 807f8fec-..." ,
147- "name" : " age" ,
148- "definition" : " Age in years." ,
149- "datatype" : " xsd:integer" ,
150- "multivalued" : false ,
151- "required" : false ,
152- "source" : " bbqs"
153- }
136+ { "hash_id" : " sha256:def456..." , "name" : " age" , "value_range" : " xsd:integer" , "multivalued" : false , "required" : false }
154137 ],
155138 "alignments" : [
156- {
157- "target_uid" : " f4f8e4a4-..." ,
158- "target_name" : " Participant" ,
159- "target_source" : " bids" ,
160- "distance" : 0.12 ,
161- "method" : " composite" ,
162- "scores" : { "iri" : 0.0 , "name" : 0.08 , "desc" : 0.19 , "slot" : 0.0 }
163- }
139+ { "target_name" : " Participant" , "target_source" : " bids" , "distance" : 0.12 , "method" : " composite" }
164140 ]
165141 }
166142 ]
167143}
168144```
169145
170- ` distance ` ranges from ** 0.0** ( identical) to ** 1.0** ( unrelated) .
146+ ` distance ` : ** 0.0** = identical · ** 1.0** = unrelated.
171147
172148---
173149
174150### ` GET /data/versions/{version}.json `
175151
176- Frozen snapshot of the registry at a specific version. Snapshots never change.
152+ Same shape as ` registry.json ` . Snapshots are permanent — they never change.
177153
178154``` bash
179155curl https://sensein.group/NeuroGhost/data/versions/1.2.0.json
180156```
181157
182- Same shape as ` registry.json ` . To list available versions, check the
183- ` registry_version ` field of the live registry and the ` data/versions/ `
184- directory.
185-
186158---
187159
188160### ` GET /data/provenance.json `
189161
190- Changelog — every schema ingestion: who submitted it, when, and which registry
191- version it produced.
192-
193162``` bash
194163curl https://sensein.group/NeuroGhost/data/provenance.json
195164```
196165
197166---
198167
199- ### Client-side filtering
200-
201- There are no server-side query parameters (static files). Filter in your
202- client after fetching:
203-
204- ``` js
205- const reg = await fetch (" https://sensein.group/NeuroGhost/data/registry.json" )
206- .then (r => r .json ());
207-
208- // All classes from one schema
209- const bbqs = reg .classes .filter (c => c .source === " bbqs" );
210-
211- // Close alignments across any two schemas (distance < 0.35)
212- const pairs = reg .classes .flatMap (c =>
213- c .alignments
214- .filter (a => a .distance < 0.35 )
215- .map (a => ({ from: ` ${ c .source } /${ c .name } ` , to: ` ${ a .target_source } /${ a .target_name } ` , distance: a .distance }))
216- );
217- ```
218-
219- ---
220-
221- ### ` GET /api/transform ` — field mapping * (planned)*
168+ ### ` GET /api/transform?from={schema}&to={schema} ` * (planned)*
222169
223- Returns the computed field-to-field mapping between two schemas, derived from
224- the alignment graph. No data is sent — this is purely a schema-level lookup .
170+ Returns the pre- computed field mapping between two schemas. Derived from the
171+ alignment graph; can be served as a static file with no extra infrastructure .
225172
226- ```
227- GET / api/transform?from=bbqs&to=bids
173+ ``` bash
174+ curl " https://sensein.group/NeuroGhost/ api/transform?from=bbqs&to=bids"
228175```
229176
230- ** Planned response**
231177``` json
232178{
233- "from" : " bbqs" ,
234- "to" : " bids" ,
179+ "from" : " bbqs" , "to" : " bids" ,
235180 "mappings" : [
236181 {
237- "from_class" : " Subject" ,
238- "to_class" : " Participant" ,
239- "distance" : 0.12 ,
182+ "from_class" : " Subject" , "to_class" : " Participant" , "distance" : 0.12 ,
240183 "field_mappings" : [
241- { "from_field" : " age" , "to_field" : " age" , "confidence" : 0.97 },
242- { "from_field" : " species" , "to_field" : " species" , "confidence" : 0.91 },
243- { "from_field" : " subject_id" , "to_field" : " participant_id" ,"confidence" : 0.85 }
184+ { "from_field" : " subject_id" , "to_field" : " participant_id" , "confidence" : 0.85 },
185+ { "from_field" : " age" , "to_field" : " age" , "confidence" : 0.97 }
244186 ]
245187 }
246188 ]
247189}
248190```
249191
250- Because the alignment data is already in ` registry.json ` , this endpoint can be
251- pre-computed at export time and served as a static file — no compute layer
252- needed.
253-
254192---
255193
256- ### ` POST /api/transform ` — data transform * (planned)*
194+ ### ` POST /api/transform ` * (planned)*
257195
258- Send a dataset in one schema's format; receive it mapped to another. Unlike the
259- GET above, this requires a live compute layer (a serverless function that reads
260- the field-mapping and rewrites the payload).
196+ Send a record in one schema's format; receive it remapped to another.
197+ Requires a serverless compute layer (Cloudflare Worker or equivalent).
261198
262199``` bash
263200curl -X POST https://sensein.group/NeuroGhost/api/transform \
264201 -H " Content-Type: application/json" \
265- -d ' {
266- "from": "bbqs",
267- "to": "bids",
268- "data": {
269- "subject_id": "sub-01",
270- "age": 24,
271- "species": "Homo sapiens"
272- }
273- }'
202+ -d ' { "from": "bbqs", "to": "bids", "data": { "subject_id": "sub-01", "age": 24 } }'
274203```
275204
276- ** Planned response**
277205``` json
278- {
279- "from" : " bbqs" ,
280- "to" : " bids" ,
281- "result" : {
282- "participant_id" : " sub-01" ,
283- "age" : 24 ,
284- "species" : " Homo sapiens"
285- },
286- "unmapped_fields" : [],
287- "warnings" : []
288- }
206+ { "from" : " bbqs" , "to" : " bids" , "result" : { "participant_id" : " sub-01" , "age" : 24 }, "unmapped_fields" : [], "warnings" : [] }
289207```
290208
291- This will be implemented as a lightweight serverless function (Cloudflare Worker
292- or equivalent) that reads the static registry alignment map and applies field
293- renaming. Not yet live.
294-
295209---
296210
297211## Adding your own schema
0 commit comments