Skip to content

Commit

Permalink
Merge pull request #31 from arturo-lang/drkameleon-patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
drkameleon committed Nov 2, 2023
2 parents 1ea11ba + 11fe7b3 commit d95b20c
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* [Delete an existing Node](#delete-an-existing-node)
* [Delete an existing Relationship](#delete-an-existing-relationship)
* [More complex queries](#more-complex-queries)
* [Reverse edge queries](#reverse-edge-queries)
* [Using filters](#using-filters)
* [Preview a Set of Nodes](#preview-a-set-of-nodes)
* [Command Reference](#command-reference)
Expand Down Expand Up @@ -260,6 +261,16 @@ graph.create "mygraph" [
]
```

The exact same thing using node helpers:

```red
graph.create "mygraph"
.helpers: [person]
[
person.new [name: "John", sex: 'm]
]
```

### Create Relationships between Nodes

```red
Expand All @@ -271,14 +282,35 @@ graph.create "mygraph" [
]
```

The exact same thing using node helpers and some syntactic sugar:

```red
graph.create "mygraph"
.helpers: [person]
[
john: person.new [name: "John", sex: 'm]
joan: person.new [name: "Joan", sex: 'f]
john <~> 'marriedTo joan
]
```

### Search Nodes

```red
graph "mygraph" [
inspect fetch 'person [name: "Joan"]
]
```
The exact same thing using node helpers:

```red
graph "mygraph"
.helpers: [person]
[
inspect person [name: "Joan"]
]
```

### Delete an existing Node

Expand Down Expand Up @@ -308,6 +340,29 @@ graph "mygraph" [
]
```

The exact same thing using node helpers:

```red
graph "mygraph"
.helpers: [person]
[
inspect person [
sex: "m"
marriedTo: person [name: "Joan"]
]
]
```

#### Reverse edge queries

```red
; using our sample11.art graph
movie [
directed: <| person "Clint Eastwood"
]
```

#### Using filters

```red
Expand Down

0 comments on commit d95b20c

Please sign in to comment.