forked from IIIF-Commons/manifesto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a TextualBody class and the parsing of a bodyValue property def…
…ined on an annotation to a TextualBody resource as an annotation body
- Loading branch information
1 parent
983d702
commit a607494
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
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,30 @@ | ||
import { | ||
IManifestoOptions, | ||
AnnotationBody} from "./internal"; | ||
|
||
/** | ||
An implementation of the TextualBody class (class in JSON-LD sense) | ||
as it is described in Web Annotation Data Model Section 3.2.4 | ||
https://www.w3.org/TR/annotation-model/#embedded-textual-body | ||
**/ | ||
export class TextualBody extends AnnotationBody { | ||
constructor(jsonld?: any, options?: IManifestoOptions) { | ||
super(jsonld, options); | ||
this.isModel = false; | ||
this.isLight = false; | ||
this.isCamera = false; | ||
} | ||
|
||
/** | ||
identify an instance of this typescript as representing a resource | ||
having these json-ld Class relationships. | ||
**/ | ||
get isTextualBody() : boolean { return true;} | ||
get isText() : boolean {return true;} | ||
|
||
/** | ||
The simple string that is the data content of this resource | ||
will return empty string as a default value | ||
**/ | ||
get Value(): string {return this.getProperty("value") || "" ;} | ||
} |
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