Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F77679151
word.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 15, 20:31
Size
3 KB
Mime Type
text/x-java
Expires
Sat, Aug 17, 20:31 (2 d)
Engine
blob
Format
Raw Data
Handle
19907251
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
word.ts
View Options
import { TlnPositionalObject } from './positional_object';
import { Word } from '../models';
/**
* This is the word instantiation of an element of {@link /interfaces/FusekiResults.html|FusekiResults}.
* It extends {@link /classes/BasicResultBindingElement.html|BasicResultBindingElement}.
**/
export class TlnWord extends TlnPositionalObject implements Word {
/**
* the SPARQL-query of this datatype.
**/
static readonly query: string = `
PREFIX tln: <http://www.nie.org/ontology/nietzsche#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?id ?text ?edited_text ?left ?top ?width ?height ?transform ?line ?line_number ?deleted ?deletion_path WHERE {
?page tln:hasWords/rdf:rest*/rdf:first ?id.
?id tln:wordBelongsToLine ?line;
tln:hasText ?text;
tln:hasTranskriptionPosition ?tp.
?tp tln:hasLeft ?left; tln:hasTop ?top; tln:hasWidth ?width; tln:hasHeight ?height.
?line tln:lineHasNumber ?line_number.
BIND(exists{
{?id tln:wordIsDeletedByPath ?path}
UNION{ ?id tln:wordHasWordParts/rdf:rest*/rdf:first ?word_part.
?word_part tln:hasTranskriptionPosition ?tp; tln:wordIsDeletedByPath ?path}
} as ?deleted)
OPTIONAl { ?tp tln:hasTransform ?transform.}
OPTIONAl { ?id tln:hasEditedText ?edited_text.}
OPTIONAl { ?id tln:wordIsDeletedByPath/tln:hasDAttribute ?deletion_path.}
OPTIONAl { ?id tln:wordHasWordParts/rdf:rest*/rdf:first ?word_part.
?word_part tln:hasTranskriptionPosition ?tp; tln:wordIsDeletedByPath/tln:hasDAttribute ?deletion_path}
} `;
/**
* the text of this word
**/
text: string;
/**
* the text of this word as it has been edited by the editors.
**/
edited_text?: string;
/**
* the id of the line to which this word belongs.
**/
line: string;
/**
* the number of the line to which this word belongs.
* */
line_number: number;
/**
* is this word deleted.
**/
deleted: boolean;
/**
* a deletion path
**/
deletion_path?: string;
/**
* The constructor creates a datatype from the data.
*
* @param id if omitted the id will be retrieved from data
**/
constructor(data: any, id?: string, service?: any){
super(data, id, service)
this.text = this.getData4Key('text');
this.edited_text = this.getData4Key('edited_text');
this.line = this.getData4Key('line');
this.line_number = this.getData4Key('line_number');
this.deleted = this.getData4Key('deleted');
this.deletion_path = this.getData4Key('deletion_path');
}
}
/**
* This is the faksimile word instantiation of an element of {@link /interfaces/FusekiResults.html|FusekiResults}.
* It extends {@link /classes/BasicResultBindingElement.html|BasicResultBindingElement}.
**/
export class FaksimileWord extends TlnWord {
/**
* the SPARQL-query of this datatype.
**/
static readonly query: string = `
PREFIX tln: <http://www.nie.org/ontology/nietzsche#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?id ?text ?edited_text ?left ?top ?width ?height ?transform ?line ?line_number ?deleted WHERE {
?page tln:hasWords/rdf:rest*/rdf:first ?id.
?id tln:wordBelongsToLine ?line;
tln:hasText ?text;
tln:hasFaksimilePosition ?fp.
?fp tln:hasLeft ?left; tln:hasTop ?top; tln:hasWidth ?width; tln:hasHeight ?height.
?line tln:lineHasNumber ?line_number.
BIND(exists{{?id tln:wordIsDeletedByPath ?path} UNION { ?id tln:wordHasWordParts/rdf:rest*/rdf:first/tln:wordIsDeletedByPath ?path}
} as ?deleted)
OPTIONAl { ?fp tln:hasTransform ?transform.}
OPTIONAl { ?id tln:hasEditedText ?edited_text.}
} `;
}
Event Timeline
Log In to Comment