added ArcadeDB, gremlin.
This commit is contained in:
parent
0575164236
commit
95d5ba2193
40
pom.xml
40
pom.xml
@ -107,6 +107,46 @@
|
|||||||
<artifactId>arcadedb-server</artifactId>
|
<artifactId>arcadedb-server</artifactId>
|
||||||
<version>24.6.1</version>
|
<version>24.6.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tinkerpop</groupId>
|
||||||
|
<artifactId>gremlin-driver</artifactId>
|
||||||
|
<version>3.7.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.apache.tinkerpop/gremlin-server
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tinkerpop</groupId>
|
||||||
|
<artifactId>gremlin-server</artifactId>
|
||||||
|
<version>3.7.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!- https://mvnrepository.com/artifact/org.opencypher/util-9.0
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opencypher</groupId>
|
||||||
|
<artifactId>util-9.0</artifactId>
|
||||||
|
<version>9.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
leaving these here for now, documentation apparently lied about needing them...
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.apache.tinkerpop/gremlin-groovy -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tinkerpop</groupId>
|
||||||
|
<artifactId>gremlin-groovy</artifactId>
|
||||||
|
<version>3.7.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.opencypher/util-9.0 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opencypher.gremlin</groupId>
|
||||||
|
<artifactId>translation</artifactId>
|
||||||
|
<version>1.0.4</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hashids</groupId>
|
<groupId>org.hashids</groupId>
|
||||||
<artifactId>hashids</artifactId>
|
<artifactId>hashids</artifactId>
|
||||||
|
|||||||
@ -1,14 +1,20 @@
|
|||||||
package com.stktrk.app;
|
package com.stktrk.app;
|
||||||
|
|
||||||
|
import com.arcadedb.gremlin.ArcadeGraph;
|
||||||
|
import com.arcadedb.gremlin.ArcadeGraphFactory;
|
||||||
|
|
||||||
|
import org.apache.tinkerpop.gremlin.structure.Vertex;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.StringJoiner;
|
||||||
|
|
||||||
// https://stackoverflow.com/questions/51221777/failed-to-configure-a-datasource-url-attribute-is-not-specified-and-no-embedd
|
// https://stackoverflow.com/questions/51221777/failed-to-configure-a-datasource-url-attribute-is-not-specified-and-no-embedd
|
||||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||||
@RestController
|
@RestController
|
||||||
@ -20,7 +26,18 @@ public class AppApplication extends SpringBootServletInitializer {
|
|||||||
|
|
||||||
@GetMapping("/hello")
|
@GetMapping("/hello")
|
||||||
public String sayHello(@RequestParam(value = "myName", defaultValue = "World") String name) {
|
public String sayHello(@RequestParam(value = "myName", defaultValue = "World") String name) {
|
||||||
return String.format("Hello %s!", name);
|
|
||||||
|
|
||||||
|
List<Vertex> x = List.of();
|
||||||
|
try (ArcadeGraphFactory pool = ArcadeGraphFactory.withRemote("192.168.178.50", 2480, "graph", "root", "playwithdata")) {
|
||||||
|
try (ArcadeGraph graph = pool.get()) {
|
||||||
|
x = graph.traversal().V().toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
StringJoiner sj = new StringJoiner(", ");
|
||||||
|
x.forEach(v -> sj.add((String) v.property("name").value()));
|
||||||
|
|
||||||
|
return "Hello, " + name + "! There are " + x.size() + " vertices.\n" + sj;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user