All files / views/trees/definition-tree/nodes/classes class-node.ts

100% Statements 11/11
100% Branches 4/4
100% Functions 5/5
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40                17x       2x   2x 1x     2x       2x   2x 1x     2x       4x       1x      
import { ClassNodeBase } from "./class-node-base";
import { IndividualNode } from "../individuals/individual-node";
 
/**
 * Node of a RDFS or OWL class in the definition tree.
 */
export class ClassNode extends ClassNodeBase {
	override showIndividuals(): boolean {
		return false;
	}
 
	override getContextValue(): string {
		let result = super.getContextValue();
 
		if (this.vocabulary.hasShapes(this.document.graphs, this.uri, this.getQueryOptions({ definedBy: undefined }))) {
			result += " shape-target";
		}
 
		return result;
	}
 
	override getDescription(): string {
		let description = super.getDescription();
 
		if (this.vocabulary.hasEquivalentClass(this.getOntologyGraphs(), this.uri)) {
			description += "≡";
		}
 
		return description;
	}
 
	getClassNode(iri: string) {
		return this.createChildNode(ClassNode, iri);
	}
 
	getIndividualNode(iri: string) {
		return this.createChildNode(IndividualNode, iri);
	}
}