Skip to content

Commit 91e97b9

Browse files
committed
Merge branch 'main' of github.com:Systemik-Solutions/Glycerine_API
2 parents fc6d746 + 8b0740a commit 91e97b9

87 files changed

Lines changed: 2729 additions & 331 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

JupyterBook/1. Server API/8. Annotations.md

Lines changed: 67 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
Each annotation returned from the API is a JSON object with the following properties:
77

88
- `id`: (read only) The ID of the annotation.
9-
- `annotation_type_id`: The ID of the type of the annotation. To use the default type, set it to `1`.
9+
- `annotation_type_id`: The ID of the type of the annotation.
1010
- `annotation_set_id`: The ID of the annotation set which the annotation belongs to.
11-
- `image_id`: The ID of the image which the annotation belongs to. Only applies to annoations from image annotation
12-
sets.
11+
- `image_id`: The ID of the image which the annotation belongs to. Only applies to annoations from image annotation sets.
1312
- `target`: the Web Annotation target. See [Annotation target](annotation-target) for details.
13+
- `line_color`: The HEX color code used for outline color of the annotation. E.g. `#000000`.
14+
- `line_weight`: The outline color shade of the annotation. The value should be one of the values of `light`, `medium`, and `dark`.
1415
- `fields`: the field data of the annotation. See [Annotation fields](annotation-fields) for details.
16+
- `tags`: list of tags applied to the annotation. See [Annotation Tags](annotation-tags) for details.
1517
- `created_at`: (read only) The datetime when the annotation is created.
1618
- `updated_at`: (read only) The datetime when the annotation is updated.
1719

@@ -36,51 +38,66 @@ Example:
3638
(annotation-fields)=
3739
## Annotation fields
3840

39-
### General format
41+
The `fields` property of an annotation is an array of objects containing the following properties:
4042

41-
The `fields` property of an annotation is an object with field names as keys. The value of each field is an object with
42-
the language codes as keys to support field values in multiple languages. The value of each language code is an object
43-
with the property `values` which is an array of field values in that language. For example:
43+
- `field`: The field information of the value. It can be the field ID or an object with the basic field information:
44+
- `id`: The ID of the field.
45+
- `name`: The name of the field.
46+
- `type`: The type of the field. The value should be one of the following: `text`, `long_text`, `link`, `choice`, `date`.
47+
- `values`: The values of the field. It is an object where each key is a language code and the value is an
48+
array of field values in that language. Each item of the array is a string value, except for the link field
49+
where each item is an object with the `url` and `text` properties.
50+
51+
Example of a `text` field:
4452

4553
```json
4654
{
47-
"title": {
48-
"en": {
49-
"values": [
50-
"Title in English"
51-
]
52-
},
53-
"zh": {
54-
"values": [
55-
"中文标题"
56-
]
57-
}
55+
"field": {
56+
"id": 1,
57+
"name": "Title",
58+
"type": "text"
5859
},
59-
"link": {
60-
"en": {
61-
"values": [
62-
{
63-
"url": "https://example.com",
64-
"text": "Link 1"
65-
},
66-
{
67-
"url": "https://example.com",
68-
"text": "Link 2"
69-
}
70-
]
71-
},
72-
"zh": {
73-
"values": [
74-
{
75-
"url": "https://example.com",
76-
"text": "链接 1"
77-
},
78-
{
79-
"url": "https://example.com",
80-
"text": "链接 2"
81-
}
82-
]
83-
}
60+
"values": {
61+
"en": [
62+
"Title in English"
63+
],
64+
"zh": [
65+
"中文标题"
66+
]
67+
}
68+
}
69+
```
70+
71+
Example of a `link` field:
72+
73+
```json
74+
{
75+
"field": {
76+
"id": 2,
77+
"name": "Link",
78+
"type": "link"
79+
},
80+
"values": {
81+
"en": [
82+
{
83+
"url": "https://example.com",
84+
"text": "Link 1"
85+
},
86+
{
87+
"url": "https://example.com",
88+
"text": "Link 2"
89+
}
90+
],
91+
"zh": [
92+
{
93+
"url": "https://example.com",
94+
"text": "链接 1"
95+
},
96+
{
97+
"url": "https://example.com",
98+
"text": "链接 2"
99+
}
100+
]
84101
}
85102
}
86103
```
@@ -121,31 +138,17 @@ The following is the list of supported language codes:
121138
|tr |Turkish |
122139
|zh |Chinese |
123140

124-
### Title field
125-
126-
A value of the `title` field is a string which is the title of the annotation.
127-
128-
### Description field
129-
130-
A value of the `description` field is a string which is the description of the annotation.
131-
132-
### Link field
141+
(annotation-tags)=
142+
## Annotation Tags
133143

134-
A value of the `link` field is an object with the following properties:
135-
136-
- `url`: The URL of the link.
137-
- `text`: The text of the link.
138-
139-
### Tag field
140-
141-
A value of the `tag` field is an object with the following properties:
144+
The `tags` property of an annotation is an array of objects containing the following properties:
142145

146+
- `term_label`: (required) The label of the tagging term.
147+
- `term_id`: The ID of the tagging term.
143148
- `vocabulary_id`: The ID of the vocabulary which the tag belongs to.
144149
- `vocabulary_name`: The name of the vocabulary which the tag belongs to.
145-
- `term_id`: The ID of the tagging term.
146-
- `term_label`: The label of the tagging term.
147-
- `data`: An object containing additional data of the tagging term such as the description and hierarchy information
148-
of the term. For example:
150+
- `extended_data`: An object containing additional data of the tagging term such as the description and hierarchy
151+
information of the term. For example:
149152

150153
```json
151154
{
@@ -159,28 +162,6 @@ A value of the `tag` field is an object with the following properties:
159162
}
160163
```
161164

162-
### Note field
163-
164-
A value of the `note` field is a string which is the note of the annotation.
165-
166-
### Attribution field
167-
168-
A value of the `attribution` field is a string which is the attribution of the annotation.
169-
170-
### Date field
171-
172-
A value of the `date` field is a string in the format of `YYYY-MM-DD` which is the date of the annotation. For example:
173-
`2021-01-01`.
174-
175-
### Line color field
176-
177-
A value of HEX color code (start with `#`) used for outline color of the annotation. E.g. `#000000`.
178-
179-
### Line weight field
180-
181-
A value of the `line_weight` field is a string which is the outline color shade of the annotation. The value should be
182-
one of the values of `Light`, `Medium`, and `Dark`.
183-
184165
## Get all annotations
185166

186167
```

0 commit comments

Comments
 (0)