|
| 1 | +/** |
| 2 | + * Copyright (c) 2002-2017 "Neo Technology,"," |
| 3 | + * Network Engine for Objects in Lund AB [http://neotechnology.com] |
| 4 | + * |
| 5 | + * This file is part of Neo4j. |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +import {Node, Path, PathSegment, Relationship, UnboundRelationship} from "../../../types/v1/graph-types"; |
| 21 | +import Integer, {int} from "../../../types/v1/integer"; |
| 22 | + |
| 23 | +const node1: Node = new Node(int(1), ["Person", "Employee"], {name: "Alice"}); |
| 24 | +const node1String: string = node1.toString(); |
| 25 | +const node1Id: Integer = node1.identity; |
| 26 | +const node1Labels: string[] = node1.labels; |
| 27 | +const node1Props: object = node1.properties; |
| 28 | + |
| 29 | +const rel1: Relationship = new Relationship(int(1), int(2), int(3), "KNOWS", {since: 12345}); |
| 30 | +const rel1String: string = rel1.toString(); |
| 31 | +const rel1Id: Integer = rel1.identity; |
| 32 | +const rel1Start: Integer = rel1.start; |
| 33 | +const rel1End: Integer = rel1.end; |
| 34 | +const rel1Type: string = rel1.type; |
| 35 | +const rel1Props: object = rel1.properties; |
| 36 | + |
| 37 | +const rel2: UnboundRelationship = new UnboundRelationship(int(1), "KNOWS", {since: 12345}); |
| 38 | +const rel2String: string = rel2.toString(); |
| 39 | +const rel3: Relationship = rel2.bind(int(1), int(2)); |
| 40 | +const rel2Id: Integer = rel2.identity; |
| 41 | +const rel2Type: string = rel2.type; |
| 42 | +const rel2Props: object = rel2.properties; |
| 43 | + |
| 44 | +const pathSegment1: PathSegment = new PathSegment(node1, rel1, node1); |
| 45 | +const pathSegment1Start: Node = pathSegment1.start; |
| 46 | +const pathSegment1Rel: Relationship = pathSegment1.rel; |
| 47 | +const pathSegment1End: Node = pathSegment1.end; |
| 48 | + |
| 49 | +const path1: Path = new Path(node1, node1, [pathSegment1]); |
| 50 | +const path1Start: Node = path1.start; |
| 51 | +const path1End: Node = path1.end; |
| 52 | +const path1Segments: PathSegment[] = path1.segments; |
| 53 | +const path1Length: number = path1.length; |
0 commit comments