private void createRoundOfNodes() { for ( int id = 0; id < IDS; id++ ) { db.createNode( LABEL ).setProperty( KEY, id ); } }
private void createNode() { try ( Transaction tx = db.beginTx() ) { db.createNode(); tx.success(); } }
@Before public void setup() { for ( int i = 0; i < 100; i++ ) { try ( Transaction tx = db.beginTx() ) { for ( int j = 0; j < 100; j++ ) { Node node = db.createNode( label( "L" ) ); node.setProperty( "prop", i + j ); } tx.success(); } } }
@Test public void shouldBeAbleToCreateRelationshipsInEmptyDenseNode() { // GIVEN Node node; try ( Transaction tx = databaseRule.beginTx() ) { node = databaseRule.createNode(); createRelationshipsBetweenNodes( node, databaseRule.createNode(), denseNodeThreshold( databaseRule ) + 1 ); tx.success(); } try ( Transaction tx = databaseRule.beginTx() ) { node.getRelationships().forEach( Relationship::delete ); tx.success(); } // WHEN Relationship rel; try ( Transaction tx = databaseRule.beginTx() ) { rel = node.createRelationshipTo( databaseRule.createNode(), MyRelTypes.TEST ); tx.success(); } try ( Transaction tx = databaseRule.beginTx() ) { // THEN assertEquals( rel, single( node.getRelationships() ) ); tx.success(); } }
@Before public void setup() { for ( int i = 0; i < 100; i++ ) { try ( Transaction tx = db.beginTx() ) { Node prev = null; for ( int j = 0; j < 100; j++ ) { Node node = db.createNode( label( "L" ) ); if ( prev != null ) { Relationship rel = prev.createRelationshipTo( node, RelationshipType.withName( "T" ) ); rel.setProperty( "prop", i + j ); } prev = node; } tx.success(); } } }
db.createNode( LABEL ).setProperty( KEY, id );
@Before public void addNodes() throws Exception { a = graphDb.createNode(); b = graphDb.createNode(); c = graphDb.createNode(); d = graphDb.createNode(); e = graphDb.createNode(); f = graphDb.createNode(); g = graphDb.createNode(); h = graphDb.createNode(); i = graphDb.createNode(); j = graphDb.createNode(); b.createRelationshipTo(a, OwlRelationships.RDFS_SUBCLASS_OF); c.createRelationshipTo(b, OwlRelationships.RDFS_SUBCLASS_OF); d.createRelationshipTo(c, OwlRelationships.RDFS_SUBCLASS_OF); i.createRelationshipTo(h, OwlRelationships.RDFS_SUBCLASS_OF); i.createRelationshipTo(g, OwlRelationships.RDFS_SUBCLASS_OF); h.createRelationshipTo(j, OwlRelationships.RDFS_SUBCLASS_OF); g.createRelationshipTo(j, OwlRelationships.RDFS_SUBCLASS_OF); e.createRelationshipTo(b, fizz); graphApi = new GraphApi(graphDb, cypherUtil, curieUtil); }
@BeforeClass public static void setup() throws InterruptedException, IOException { path = folder.newFolder().getAbsolutePath(); try (Transaction tx = graphDb.beginTx()) { a = graphDb.createNode(); b = graphDb.createNode(); a.createRelationshipTo(b, type); c = graphDb.createNode(); a.createRelationshipTo(c, type); c.createRelationshipTo(a, type); d = graphDb.createNode(); e = graphDb.createNode(); f = graphDb.createNode(); e.createRelationshipTo(f, type); a.createRelationshipTo(e, type); tx.success(); } index = new ReachabilityIndex(graphDb); index.createIndex(new Predicate<Node>() { @Override public boolean apply(Node input) { return !input.equals(e); } }); }
@Before public void setup() throws InterruptedException, ExecutionException { Transaction tx = graphDb.beginTx(); enableIndexing(); parent = graphDb.createNode(); parent.setProperty(CommonProperties.IRI, "http://example.org/a"); child = graphDb.createNode(); child.createRelationshipTo(parent, OwlRelationships.RDFS_SUBCLASS_OF); grandChild = graphDb.createNode(); grandChild.createRelationshipTo(child, OwlRelationships.RDFS_SUBCLASS_OF); equivalent = graphDb.createNode(); equivalentSubclass = graphDb.createNode(); equivalentSubclass.createRelationshipTo(equivalent, OwlRelationships.RDFS_SUBCLASS_OF); equivalent.createRelationshipTo(child, OwlRelationships.OWL_EQUIVALENT_CLASS); instance = graphDb.createNode(); instance.createRelationshipTo(grandChild, OwlRelationships.RDF_TYPE); tx.success(); postprocessor = new OwlPostprocessor(graphDb, Collections.<String, String>emptyMap()); Map<String, String> categoryMap = new HashMap<>(); categoryMap.put("http://example.org/a", "foo"); tx.close(); postprocessor.processCategories(categoryMap); tx = graphDb.beginTx(); }
@Before public void addNodes() throws Exception { a = graphDb.createNode(); a.setProperty(NodeProperties.IRI, "a"); a.setProperty("foo", "bar"); a.addLabel(Label.label("alabel")); b = graphDb.createNode(); b.setProperty(NodeProperties.IRI, "b"); c = graphDb.createNode(); c.setProperty(NodeProperties.IRI, "c"); b.createRelationshipTo(a, OwlRelationships.RDFS_SUBCLASS_OF); c.createRelationshipTo(b, OwlRelationships.OWL_EQUIVALENT_CLASS); graphApi = new GraphApi(graphDb, cypherUtil, curieUtil); }
@Before public void setup() { graphDb.beginTx(); node = graphDb.createNode(); node.setProperty("foo", "bar"); node.setProperty("fizz", 1); }