API reference
Entities
Entities endpoints of the SemanticsOn REST API.
List entities
GET/projects/{projectId}/entitiesEntities with their attributes and relations. relations lists every relation the entity takes part in, in both directions: fromName —predicate→ toName (e.g. Espresso —is brewed with→ Espresso machine).
Path parameters
projectIdstringrequired
Query parameters
limitintegeroptionalItems per page, 1–100.
1–100 · default 25
cursorstringoptionalPass
nextCursorfrom the previous page to get the next one.at most 200 characters
searchstringoptionalat most 200 characters
centralstringoptionaltruefor the central entity onlyOne of:
true,false
curl https://semanticson.com/api/v1/projects/PROJECT_ID/entities \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Response · 200 OK
A list object: { "object": "list", "data": [ … ], "hasMore": false, "nextCursor": null }. See pagination.
Errors use the standard error object.
Create an entity
POST/projects/{projectId}/entitiesNames are unique per project (case-insensitive); a duplicate returns 409 entity_exists.
Accepts an Idempotency-Key header for safe retries.
Path parameters
projectIdstringrequired
Request body
namestringrequired1–160 characters
typestringoptionale.g. Thing, Product, Person, Place, Concept
at most 80 characters · default ""
descriptionstringoptionalat most 2,000 characters · default ""
isCentralbooleanoptionalMake this the project's central entity (unsets the previous one and updates the project's
centralEntity)default false
sameAsarray of stringsoptionalAuthoritative URLs for the entity, e.g. Wikipedia or Wikidata
at most 20 items · default []
attributesarray of objectsoptionalReplaces all attributes
at most 200 items · default []
attributes[].attributestringrequired1–160 characters
attributes[].valuestringoptionalat most 500 characters · default ""
attributes[].unitstringoptionalat most 40 characters · default ""
attributes[].kindstringoptionalroot (every entity of this type has it), rare (some have it) or unique (only this one)
One of:
root,rare,uniquedefault "root"
curl -X POST https://semanticson.com/api/v1/projects/PROJECT_ID/entities \
-H "Authorization: Bearer $SEMANTICSON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Espresso",
"type": "Beverage",
"isCentral": true,
"sameAs": [
"https://en.wikipedia.org/wiki/Espresso"
],
"attributes": [
{
"attribute": "Brew ratio",
"value": "1:2",
"kind": "root"
},
{
"attribute": "Pressure",
"value": "9",
"unit": "bar"
}
]
}'Response · 201 Created
A JSON object. Objects carry an object type and an id; timestamps are ISO 8601 strings.
Errors use the standard error object.
Get an entity
GET/entities/{entityId}relations lists every relation the entity takes part in, in both directions: fromName —predicate→ toName (e.g. Espresso —is brewed with→ Espresso machine).
Path parameters
entityIdstringrequiredThe entity id
1–64 characters
curl https://semanticson.com/api/v1/entities/ENTITY_ID \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Response · 200 OK
A JSON object. Objects carry an object type and an id; timestamps are ISO 8601 strings.
Errors use the standard error object.
Update an entity
PATCH/entities/{entityId}Send only the fields to change. attributes and sameAs replace the whole list. isCentral: true makes this the project's only central entity and sets the project's centralEntity; isCentral: false on the central entity unsets it (and clears the project's centralEntity if it still names this entity). Renaming the central entity renames the project's centralEntity too.
Accepts an Idempotency-Key header for safe retries.
Path parameters
entityIdstringrequiredThe entity id
1–64 characters
Request body
namestringoptional1–160 characters
typestringoptionale.g. Thing, Product, Person, Place, Concept
at most 80 characters
descriptionstringoptionalat most 2,000 characters
isCentralbooleanoptionalMake this the project's central entity (unsets the previous one and updates the project's
centralEntity)sameAsarray of stringsoptionalAuthoritative URLs for the entity, e.g. Wikipedia or Wikidata
at most 20 items
attributesarray of objectsoptionalReplaces all attributes
at most 200 items
attributes[].attributestringrequired1–160 characters
attributes[].valuestringoptionalat most 500 characters · default ""
attributes[].unitstringoptionalat most 40 characters · default ""
attributes[].kindstringoptionalroot (every entity of this type has it), rare (some have it) or unique (only this one)
One of:
root,rare,uniquedefault "root"
curl -X PATCH https://semanticson.com/api/v1/entities/ENTITY_ID \
-H "Authorization: Bearer $SEMANTICSON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Concentrated coffee brewed under pressure",
"attributes": [
{
"attribute": "Brew ratio",
"value": "1:2"
}
]
}'Response · 200 OK
A JSON object. Objects carry an object type and an id; timestamps are ISO 8601 strings.
Errors use the standard error object.
Delete an entity
DELETE/entities/{entityId}Deletes the entity with its attributes and relations.
Accepts an Idempotency-Key header for safe retries.
Path parameters
entityIdstringrequiredThe entity id
1–64 characters
curl -X DELETE https://semanticson.com/api/v1/entities/ENTITY_ID \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Response · 204 No Content
Success returns an empty body (204) or a small confirmation object.
Errors use the standard error object.
Relate this entity to another
POST/entities/{entityId}/relationsCreates the relation this entity —predicate→ toId (another entity in the same project). The same triple can exist once (409 relation_exists). The relation appears in both entities' relations.
Accepts an Idempotency-Key header for safe retries.
Path parameters
entityIdstringrequiredThe entity id
1–64 characters
Request body
toIdstringrequiredThe target entity id
1–64 characters
predicatestringrequiredThe relationship, e.g. “is brewed with”, “is a type of”
1–120 characters
curl -X POST https://semanticson.com/api/v1/entities/ENTITY_ID/relations \
-H "Authorization: Bearer $SEMANTICSON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"toId": "cm1entity…",
"predicate": "is brewed with"
}'Response · 201 Created
A JSON object. Objects carry an object type and an id; timestamps are ISO 8601 strings.
Errors use the standard error object.
Remove a relation
DELETE/entities/{entityId}/relations/{relationId}Removes a relation this entity takes part in (in either direction).
Accepts an Idempotency-Key header for safe retries.
Path parameters
entityIdstringrequiredThe entity id
1–64 characters
relationIdstringrequiredThe relation id
1–64 characters
curl -X DELETE https://semanticson.com/api/v1/entities/ENTITY_ID/relations/RELATION_ID \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Response · 204 No Content
Success returns an empty body (204) or a small confirmation object.
Errors use the standard error object.