Rename or retype an entity
curl --request PATCH \
--url http://127.0.0.1:4319/memory/entities/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "PostgreSQL",
"entityType": "technology"
}
'import requests
url = "http://127.0.0.1:4319/memory/entities/{id}"
payload = {
"name": "PostgreSQL",
"entityType": "technology"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: 'PostgreSQL', entityType: 'technology'})
};
fetch('http://127.0.0.1:4319/memory/entities/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:4319/memory/entities/{id}"
payload := strings.NewReader("{\n \"name\": \"PostgreSQL\",\n \"entityType\": \"technology\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "4319",
CURLOPT_URL => "http://127.0.0.1:4319/memory/entities/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'PostgreSQL',
'entityType' => 'technology'
]),
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;
}require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:4319/memory/entities/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"PostgreSQL\",\n \"entityType\": \"technology\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.patch("http://127.0.0.1:4319/memory/entities/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"PostgreSQL\",\n \"entityType\": \"technology\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("http://127.0.0.1:4319/memory/entities/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"name\": \"PostgreSQL\",\n \"entityType\": \"technology\"\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
{
"ok": true
}{
"error": "invalid request body",
"issues": [
{
"path": "query",
"message": "query must be a non-empty string"
}
]
}Schema & entities
Rename or retype an entity
A rename re-embeds the entity, since the embedding is computed from the name. It is refused with 409 when another entity already owns that name key; use merge instead. A retype must name an active vocabulary type.
PATCH
/
memory
/
entities
/
{id}
Rename or retype an entity
curl --request PATCH \
--url http://127.0.0.1:4319/memory/entities/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "PostgreSQL",
"entityType": "technology"
}
'import requests
url = "http://127.0.0.1:4319/memory/entities/{id}"
payload = {
"name": "PostgreSQL",
"entityType": "technology"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: 'PostgreSQL', entityType: 'technology'})
};
fetch('http://127.0.0.1:4319/memory/entities/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:4319/memory/entities/{id}"
payload := strings.NewReader("{\n \"name\": \"PostgreSQL\",\n \"entityType\": \"technology\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "4319",
CURLOPT_URL => "http://127.0.0.1:4319/memory/entities/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'PostgreSQL',
'entityType' => 'technology'
]),
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;
}require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:4319/memory/entities/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"PostgreSQL\",\n \"entityType\": \"technology\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.patch("http://127.0.0.1:4319/memory/entities/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"PostgreSQL\",\n \"entityType\": \"technology\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("http://127.0.0.1:4319/memory/entities/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"name\": \"PostgreSQL\",\n \"entityType\": \"technology\"\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
{
"ok": true
}{
"error": "invalid request body",
"issues": [
{
"path": "query",
"message": "query must be a non-empty string"
}
]
}⌘I