-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Web batch annotations * example * add examples
- Loading branch information
Showing
4 changed files
with
270 additions
and
14 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
data-model/annotations/0.1.0/examples/example-annotation-event-for-web.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"data": { | ||
"type": "annotation", | ||
"attributes": { | ||
"annotations": [ | ||
{ | ||
"oa:motivation": "oa:commenting", | ||
"oa:target": { | ||
"ods:id": "https://hdl.handle.net/20.500.125/1111111", | ||
"ods:type": "https://doi.org/21.T11148/894b1e6cad57e921764e", | ||
"oa:selector": { | ||
"ods:type": "ClassSelector", | ||
"oa:class": "specimenName" | ||
} | ||
}, | ||
"oa:body": { | ||
"ods:type": "body", | ||
"oa:value": [], | ||
"dcterms:reference": "reference", | ||
"ods:score": 0.9 | ||
} | ||
} | ||
], | ||
"batchMetadata": [ | ||
{ | ||
"searchParams": [ | ||
{ | ||
"inputField": "field", | ||
"inputValue": "value" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
189 changes: 189 additions & 0 deletions
189
data-model/annotations/0.1.0/schema/annotation-event-for-web.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://schemas.dissco.tech/schemas/annotations/0.1.0/annotation-event-for-web.json", | ||
"description": "Web batch annotation. For DiSSCo internal use only.", | ||
"$comment": "Fewer fields are required in this schema because these requests are sent to the backend for processing.", | ||
"properties": { | ||
"data": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"const": "annotation" | ||
}, | ||
"attributes": { | ||
"type": "object", | ||
"properties": { | ||
"annotations": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"ods:id": { | ||
"type": "string" | ||
}, | ||
"rdf:type": { | ||
"const": "Annotation" | ||
}, | ||
"oa:motivation": { | ||
"enum": [ | ||
"ods:adding", | ||
"oa:assessing", | ||
"oa:editing", | ||
"oa:commenting" | ||
] | ||
}, | ||
"oa:motivatedBy": { | ||
"type": "string" | ||
}, | ||
"oa:target": { | ||
"type": "object", | ||
"properties": { | ||
"ods:id": { | ||
"type": "string" | ||
}, | ||
"ods:type": { | ||
"type": "string" | ||
}, | ||
"oa:selector": { | ||
"type": "object", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"ods:type": { | ||
"const": "FieldSelector" | ||
}, | ||
"ods:field": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"ods:type", | ||
"ods:field" | ||
] | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"ods:type": { | ||
"const": "ClassSelector" | ||
}, | ||
"oa:class": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"ods:type", | ||
"oa:class" | ||
] | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"ods:type": { | ||
"const": "FragmentSelector" | ||
}, | ||
"ac:hasRoi": { | ||
"type": "object", | ||
"properties": { | ||
"ac:xFrac": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 1 | ||
}, | ||
"ac:yFrac": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 1 | ||
}, | ||
"ac:widthFrac": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 1 | ||
}, | ||
"ac:heightFrac": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 1 | ||
} | ||
}, | ||
"required": [ | ||
"ac:xFrac", | ||
"ac:yFrac", | ||
"ac:widthFrac", | ||
"ac:heightFrac" | ||
] | ||
}, | ||
"dcterms:conformsTo": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"ods:type", | ||
"ac:hasRoi" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"ods:id", | ||
"ods:type" | ||
] | ||
}, | ||
"oa:body": { | ||
"type": "object", | ||
"properties": { | ||
"ods:type": { | ||
"type": "string" | ||
}, | ||
"oa:value": { | ||
"type": "array" | ||
}, | ||
"dcterms:reference": { | ||
"type": "string" | ||
}, | ||
"ods:score": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 1 | ||
} | ||
}, | ||
"required": [ | ||
"ods:type", | ||
"oa:value" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"oa:motivation", | ||
"oa:target", | ||
"oa:body" | ||
] | ||
}, | ||
"minItems": 1, | ||
"maxItems": 1 | ||
}, | ||
"batchMetadata": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "https://schemas.dissco.tech/schemas/fdo-types/0.1.0/annotation-batch-metadata.json" | ||
}, | ||
"minItems": 1, | ||
"maxItems": 1 | ||
} | ||
}, | ||
"required": [ | ||
"annotations", | ||
"batchMetadata" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"type", | ||
"attributes" | ||
] | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://schemas.dissco.tech/schemas/fdo-types/0.1.0/annotation-batch-metadata.json", | ||
"properties": { | ||
"placeInBatch": { | ||
"type": "integer" | ||
}, | ||
"searchParams": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"inputField": { | ||
"type": "string", | ||
"description": "JsonPath (mixed notation) of field used to base annotation reasoning on. Indexes must be wildcards", | ||
"examples": [ | ||
"digitalSpecimenWrapper.occurrences[*].location.dwc:country" | ||
] | ||
}, | ||
"inputValue": { | ||
"type": "string", | ||
"description": "Value stored at the field indicated in inputField", | ||
"examples": [ | ||
"Netherlands" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"inputField", | ||
"inputValue" | ||
] | ||
}, | ||
"minItems": 1 | ||
} | ||
}, | ||
"required": [ | ||
"placeInBatch", | ||
"searchParams" | ||
], | ||
"additionalProperties": false | ||
} |