Lint and auto-complete a SemQL query
curl --request POST \
--url https://semantik.noetive.io/v1/lint \
--header 'Content-Type: application/json' \
--data '
{
"query": "MATCH DISTANCE(\"climate change\") WITHIN ",
"cursor": 40
}
'import requests
url = "https://semantik.noetive.io/v1/lint"
payload = {
"query": "MATCH DISTANCE(\"climate change\") WITHIN ",
"cursor": 40
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({query: 'MATCH DISTANCE("climate change") WITHIN ', cursor: 40})
};
fetch('https://semantik.noetive.io/v1/lint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://semantik.noetive.io/v1/lint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'MATCH DISTANCE("climate change") WITHIN ',
'cursor' => 40
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://semantik.noetive.io/v1/lint"
payload := strings.NewReader("{\n \"query\": \"MATCH DISTANCE(\\\"climate change\\\") WITHIN \",\n \"cursor\": 40\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://semantik.noetive.io/v1/lint")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"MATCH DISTANCE(\\\"climate change\\\") WITHIN \",\n \"cursor\": 40\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://semantik.noetive.io/v1/lint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"MATCH DISTANCE(\\\"climate change\\\") WITHIN \",\n \"cursor\": 40\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"normalized": "<string>",
"diagnostics": [
{
"severity": "<string>",
"message": "<string>",
"line": 123,
"col": 123,
"end_line": 123,
"end_col": 123
}
],
"completions": [
{
"label": "<string>",
"kind": "<string>",
"detail": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}Endpoints
Lint and auto-complete a SemQL query
Validates a SemQL query and returns diagnostics (parse/validation errors) and auto-complete suggestions at the given cursor position. Always returns both diagnostics and completions in a single call.
Requires Content-Type: application/json.
POST
/
v1
/
lint
Lint and auto-complete a SemQL query
curl --request POST \
--url https://semantik.noetive.io/v1/lint \
--header 'Content-Type: application/json' \
--data '
{
"query": "MATCH DISTANCE(\"climate change\") WITHIN ",
"cursor": 40
}
'import requests
url = "https://semantik.noetive.io/v1/lint"
payload = {
"query": "MATCH DISTANCE(\"climate change\") WITHIN ",
"cursor": 40
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({query: 'MATCH DISTANCE("climate change") WITHIN ', cursor: 40})
};
fetch('https://semantik.noetive.io/v1/lint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://semantik.noetive.io/v1/lint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'MATCH DISTANCE("climate change") WITHIN ',
'cursor' => 40
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://semantik.noetive.io/v1/lint"
payload := strings.NewReader("{\n \"query\": \"MATCH DISTANCE(\\\"climate change\\\") WITHIN \",\n \"cursor\": 40\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://semantik.noetive.io/v1/lint")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"MATCH DISTANCE(\\\"climate change\\\") WITHIN \",\n \"cursor\": 40\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://semantik.noetive.io/v1/lint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"MATCH DISTANCE(\\\"climate change\\\") WITHIN \",\n \"cursor\": 40\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"normalized": "<string>",
"diagnostics": [
{
"severity": "<string>",
"message": "<string>",
"line": 123,
"col": 123,
"end_line": 123,
"end_col": 123
}
],
"completions": [
{
"label": "<string>",
"kind": "<string>",
"detail": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}{
"error": "<string>",
"message": "<string>",
"request_id": "<string>",
"retry_after_ms": 123
}Body
application/json
Raw SemQL text to lint and auto-complete.
Byte offset in the query where auto-complete context is evaluated. When omitted, defaults to the end of the query.
An explicit 0 is honoured as written and returns
start-of-query completions — it is not treated as "omitted".
An offset past the end of the query, or a negative one, returns
400 invalid_request.
Required range:
x >= 0Response
Lint diagnostics and completions.
Was this page helpful?

