Skip to content

Commit 4cc7987

Browse files
committed
Release 0.9.0
1 parent e2b9566 commit 4cc7987

File tree

2 files changed

+45
-21
lines changed

2 files changed

+45
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
- **0.9.0**
3+
- **0.9.0** (March 23 2021)
44
- Features:
55
- `Neo4jExecutor#create_index`. This function call adds an index to the database on the node attribute specified, in order to improve query performance (#95)
66
- `dotmotif.ingest.EdgelistConverter` now supports importing from a dask or pandas dataframe edgelist in addition to files on disk (#99)

README.md

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,65 @@
1111
<a href="https://codecov.io/gh/aplbrain/dotmotif"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/aplbrain/dotmotif?style=for-the-badge"></a>
1212
</p>
1313

14-
# Usage
14+
---
1515

16-
## Writing a motif
17-
18-
DotMotif is a custom language that specializes in subgraph query notation:
19-
20-
`threecycle.motif`
16+
DotMotif is a custom language that specializes in subgraph query notation. It looks like this:
2117

2218
```yml
23-
# A excites B
19+
# Neuron A excites B:
2420
A -> B [type = "excitatory"]
25-
# B inhibits C
21+
# ...and B inhibits C:
2622
B -> C [type = "inhibitory"]
2723
```
2824

29-
## Ingesting the motif into dotmotif
25+
Or like this:
3026

31-
```python
32-
import dotmotif
27+
```yml
28+
TwitterInfluencer(person) {
29+
# An influencer has more than a million
30+
# followers and is verified.
31+
person.followers > 1000000
32+
person.verified = true
33+
}
34+
35+
InfluencerAwkward(person1, person2) {
36+
# Two people who are both influencers...
37+
TwitterInfluencer(person1)
38+
TwitterInfluencer(person2)
39+
# ...where one follows the other, but...
40+
person1 -> person2
41+
# ...the other doesn't follow back
42+
person2 !> person1
43+
}
3344

34-
dm = dotmotif.Motif("threecycle.motif")
45+
# Search for all awkward twitter influencer
46+
# relationships in the dataset:
47+
InfluencerAwkward(X, Y)
3548
```
3649

37-
## Inline code in Python
50+
# Get Started
3851

39-
Alternatively, you can inline your motif in the python code when creating your `dotmotif` object:
52+
> To follow along in an interactive Binder without installing anything, launch a Jupyter Notebook here:
53+
>
54+
> [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gist/j6k4m8/7da63dc9c049c4263fc2749d4ce880cd#file-get-started-dotmotif-ipynb/HEAD)
55+
56+
If you have [DotMotif](https://github.com/aplbrain/dotmotif/wiki/Installation), a NetworkX graph, and a curious mind, you already have everything you need to start using DotMotif:
4057

4158
```python
42-
dm = dotmotif.Motif("""
43-
# A excites B
44-
A -> B [type = "excitatory"]
45-
# B inhibits C
46-
B -> C [type = "inhibitory"]
59+
from dotmotif import Motif, GrandIsoExecutor
60+
61+
executor = GrandIsoExecutor(graph=my_networkx_graph)
62+
63+
triangle = Motif("""
64+
A -> B
65+
B -> C
66+
C -> A
4767
""")
68+
69+
results = executor.find(triangle)
4870
```
4971

50-
## Parameters
72+
# Parameters
5173

5274
You can also pass optional parameters into the constructor for the `dotmotif` object. Those arguments are:
5375

@@ -60,6 +82,8 @@ You can also pass optional parameters into the constructor for the `dotmotif` ob
6082

6183
For more details on how to write a query, see [Getting Started](https://github.com/aplbrain/dotmotif/wiki/Getting-Started).
6284

85+
---
86+
6387
# Citing
6488

6589
If this tool is helpful to your research, please consider citing it with:

0 commit comments

Comments
 (0)