@oml/server
v0.26.1
Published
Standalone OML server host
Readme
@oml/server
Standalone OML server runtime package.
The only user-facing CLI is oml from @oml/cli. Use oml server start, oml server stop, and oml server status to manage the server.
Options
--host,-h: bind host. Default:127.0.0.1--port,-p: bind port. Default:8080--workspace,-w: workspace root used to initialize the server. Default: current working directory--token: bearer token required for REST endpoints (except/health)--refresh-token: optional refresh token used by server auth refresh--token-expires-at: optional access-token expiration time (epoch ms)
Canonical CLI
From a local checkout:
node packages/cli/bin/cli.js server startWhen installed from npm:
oml server startServer management commands:
oml server start
oml server status
oml server stopIf the requested port is already occupied, startup fails immediately with a clear message naming the occupied host and port.
REST API
The server exposes only these endpoints:
GET /healthGET /openapi.jsonGET /v0/modelsPOST /v0/queryPOST /v0/updatePOST /v0/fuzzysearchPOST /v0/lintPOST /v0/reasonPOST /v0/validatePOST /v0/renderPOST /v0/export
Health check:
curl http://127.0.0.1:8080/healthRun a SPARQL query:
curl -X POST http://127.0.0.1:8080/v0/query \
-H 'content-type: application/json' \
-d '{
"modelUri": "file:///absolute/path/to/model.oml",
"sparql": "SELECT * WHERE { ?s ?p ?o } LIMIT 10"
}'Run update request:
curl -X POST http://127.0.0.1:8080/v0/update \
-H 'content-type: application/json' \
-d '{
"operations": [
{
"createInstance": {
"descriptionIri": "https://example.com/demo#",
"instanceName": "alice"
}
}
]
}'Run fuzzy search:
curl -X POST http://127.0.0.1:8080/v0/fuzzysearch \
-H 'content-type: application/json' \
-d '{
"text": "firefighter",
"limit": 10
}'