Search in sources :

Example 1 with GremlinGroovyModule

use of com.tinkerpop.frames.modules.gremlingroovy.GremlinGroovyModule in project pentaho-metaverse by pentaho.

the class MetaverseValidationIT method init.

@BeforeClass
public static void init() throws Exception {
    IntegrationTestUtil.initializePentahoSystem("src/it/resources/solution/system/pentahoObjects.spring.xml");
    // we only care about the demo folder
    FileSystemLocator fileSystemLocator = PentahoSystem.get(FileSystemLocator.class);
    IDocumentLocatorProvider provider = PentahoSystem.get(IDocumentLocatorProvider.class);
    // remove the original locator so we can set the modified one back on it
    provider.removeDocumentLocator(fileSystemLocator);
    fileSystemLocator.setRootFolder(ROOT_FOLDER);
    provider.addDocumentLocator(fileSystemLocator);
    MetaverseUtil.setDocumentController(PentahoSystem.get(IDocumentController.class));
    // build the graph using our updated locator/provider
    graph = IntegrationTestUtil.buildMetaverseGraph(provider);
    reader = PentahoSystem.get(IMetaverseReader.class);
    framedGraphFactory = new FramedGraphFactory(new GremlinGroovyModule());
    framedGraph = framedGraphFactory.create(graph);
    root = (RootNode) framedGraph.getVertex("entity", RootNode.class);
}
Also used : IMetaverseReader(org.pentaho.metaverse.api.IMetaverseReader) IDocumentLocatorProvider(org.pentaho.metaverse.api.IDocumentLocatorProvider) GremlinGroovyModule(com.tinkerpop.frames.modules.gremlingroovy.GremlinGroovyModule) IDocumentController(org.pentaho.metaverse.api.IDocumentController) FramedGraphFactory(com.tinkerpop.frames.FramedGraphFactory) FileSystemLocator(org.pentaho.metaverse.locator.FileSystemLocator) BeforeClass(org.junit.BeforeClass)

Example 2 with GremlinGroovyModule

use of com.tinkerpop.frames.modules.gremlingroovy.GremlinGroovyModule in project frames by tinkerpop.

the class FramedVertexTest method before.

@Before
public void before() {
    graph = TinkerGraphFactory.createTinkerGraph();
    framedGraph = new FramedGraphFactory(new GremlinGroovyModule()).create(graph);
    marko = framedGraph.frame(graph.getVertex(1), Person.class);
    vadas = framedGraph.frame(graph.getVertex(2), Person.class);
    lop = framedGraph.frame(graph.getVertex(3), Project.class);
    josh = framedGraph.frame(graph.getVertex(4), Person.class);
    ripple = framedGraph.frame(graph.getVertex(5), Project.class);
    peter = framedGraph.frame(graph.getVertex(6), Person.class);
    markoKnowsVadas = framedGraph.frame(graph.getEdge(7), Knows.class);
    markowKnowsJosh = framedGraph.frame(graph.getEdge(8), Knows.class);
    markoCreatedLop = framedGraph.frame(graph.getEdge(9), CreatedInfo.class);
    joshCreatedRipple = framedGraph.frame(graph.getEdge(10), CreatedInfo.class);
    joshCreatedLop = framedGraph.frame(graph.getEdge(11), CreatedInfo.class);
    peterCreatedLop = framedGraph.frame(graph.getEdge(12), CreatedInfo.class);
}
Also used : Project(com.tinkerpop.frames.domain.classes.Project) GremlinGroovyModule(com.tinkerpop.frames.modules.gremlingroovy.GremlinGroovyModule) CreatedInfo(com.tinkerpop.frames.domain.incidences.CreatedInfo) Knows(com.tinkerpop.frames.domain.incidences.Knows) Person(com.tinkerpop.frames.domain.classes.Person) Before(org.junit.Before)

Aggregations

GremlinGroovyModule (com.tinkerpop.frames.modules.gremlingroovy.GremlinGroovyModule)2 FramedGraphFactory (com.tinkerpop.frames.FramedGraphFactory)1 Person (com.tinkerpop.frames.domain.classes.Person)1 Project (com.tinkerpop.frames.domain.classes.Project)1 CreatedInfo (com.tinkerpop.frames.domain.incidences.CreatedInfo)1 Knows (com.tinkerpop.frames.domain.incidences.Knows)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1 IDocumentController (org.pentaho.metaverse.api.IDocumentController)1 IDocumentLocatorProvider (org.pentaho.metaverse.api.IDocumentLocatorProvider)1 IMetaverseReader (org.pentaho.metaverse.api.IMetaverseReader)1 FileSystemLocator (org.pentaho.metaverse.locator.FileSystemLocator)1