MCPcopy Create free account
hub / github.com/alephdata/aleph / match

Method match

ui/src/react-ftm/types/EdgeType.ts:18–35  ·  view source on GitHub ↗
(source: Entity, target: Entity)

Source from the content-addressed store, hash-verified

16 }
17
18 match(source: Entity, target: Entity): boolean {
19 if (!source) {
20 return false;
21 }
22 if (this.property && source.schema.hasProperty(this.property)) {
23 return target.schema.isA(this.property.getRange());
24 }
25 if (this.schema && this.schema.edge && target) {
26 const sourceProperty = this.schema.getProperty(this.schema.edge.source);
27 const targetProperty = this.schema.getProperty(this.schema.edge.target);
28 if (source.schema.isA(sourceProperty.getRange())) {
29 if (target.schema.isA(targetProperty.getRange())) {
30 return true;
31 }
32 }
33 }
34 return false;
35 }
36
37 isPropertyEdgeType() {
38 return this.property !== undefined;

Callers 12

svgIconFunction · 0.45
renderMethod · 0.45
onChangeTypeMethod · 0.45
isValidMethod · 0.45
isReversibleMethod · 0.45
getTypesMethod · 0.45
getLabelFromIdMethod · 0.45
util.jsFile · 0.45
parseQueryTextFunction · 0.45
reformatDateStringFunction · 0.45
FileImportClass · 0.45
hexToRgbFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected