Browse Source

Worked on the skeleton of the gremlin blog post.

pull/4/head
jrtechs 6 years ago
parent
commit
dfbe6d2c5b
3 changed files with 151 additions and 2 deletions
  1. +55
    -0
      README.md
  2. +96
    -0
      entries/programming/gremlin-graph-database-in-10-minutes.md
  3. +0
    -2
      entries/web-development/node-website-optimization.md

+ 55
- 0
README.md View File

@ -100,4 +100,59 @@ jpegoptim --size=500k *.jpg
apt-get install optipng
optipng *.png
```
```
server {
listen 80;
server_name www.jrtechs.net jrtechs.net;
# redirect http requests to https
return 301 https://jrtechs.net$request_uri;
}
server {
listen 443 ssl http2;
server_name jrtechs.net;
ssl_certificate /etc/letsencrypt/live/jrtechs.net/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/jrtechs.net/privkey.pem;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 80;
server_name www.admin.jrtechs.net admin.jrtechs.net;
# redirect http requests to https
return 301 https://admin.jrtechs.net$request_uri;
}
server {
listen 443 ssl http2;
server_name admin.jrtechs.net;
ssl_certificate /etc/letsencrypt/live/admin.jrtechs.net/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/admin.jrtechs.net/privkey.pem;
location / {
proxy_pass http://localhost:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
```

+ 96
- 0
entries/programming/gremlin-graph-database-in-10-minutes.md View File

@ -0,0 +1,96 @@
## Graph Data Base Basics
## Gremlin Installation
## Gremlin Syntax
#### Add a vertex
```gremlin
g.addV('student').property('name', 'Jeffery').property('GPA', 4.0);
```
#### Update a Property
```gremlin
g.V(1).property('name', 'Jeffery R');
```
#### Selection
```gremlin
g.V().hasLabel('student').valueMap();
```
```gremlin
g.V().hasLabel('student').values('name');
```
```gremlin
g.V().hasLabel('student').order().by('gpa', decr).valueMap();
```
#### Adding Edges
```gremlin
g.V(0).as('a').V(1).as('b').addE('knows')
.from('a').to('b');
```
#### Traversing Graph
## Using Gremlin With Java
```maven
<!-- https://mvnrepository.com/artifact/com.tinkerpop/gremlin-core -->
<dependency>
<groupId>com.tinkerpop</groupId>
<artifactId>gremlin-core</artifactId>
<version>3.0.0.M7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tinkerpop/gremlin-driver -->
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-driver</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
<version>3.3.3</version>
</dependency>
```
```java
public class GraphConnection
{
/** Stores/manages client connections **/
private Cluster cluster;
/** Connection to the graph db */
private Client client;
public RemoteConnection()
{
Cluster.Builder b = Cluster.build();
b.addContactPoint("localhost");
b.port(8182);
this.cluster = b.create();
this.client = cluster.connect();
}
public synchronized ResultSet queryGraph(String q)
{
return this.client.submit(q);
}
public void closeConnection()
{
this.cluster.close();
}
}
```

+ 0
- 2
entries/web-development/node-website-optimization.md View File

@ -247,8 +247,6 @@ server's cache.
![Server Cache Example](media/websiteOptimization/serverCache.png)
Server Cache Example
5: Enable Compression
---------------------

Loading…
Cancel
Save