Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RedisGraph Java client
```

### Snapshots
To be used with RedisGraph 2.0 (not officially released)

```xml
<repositories>
Expand All @@ -39,7 +40,7 @@ and
<dependency>
<groupId>com.redislabs</groupId>
<artifactId>jredisgraph</artifactId>
<version>1.0.5-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
```
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/redislabs/redisgraph/RedisGraph.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.redislabs.redisgraph;

import com.redislabs.redisgraph.impl.GraphCache;
import com.redislabs.redisgraph.impl.graph_cache.GraphCache;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

graph_cache or graphCache

import com.redislabs.redisgraph.impl.ResultSetImpl;
import org.apache.commons.text.translate.AggregateTranslator;
import org.apache.commons.text.translate.CharSequenceTranslator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redislabs.redisgraph.impl;
package com.redislabs.redisgraph.graph_entities;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redislabs.redisgraph.impl;
package com.redislabs.redisgraph.graph_entities;


import com.redislabs.redisgraph.ResultSet.ResultSetScalarTypes;
Expand Down Expand Up @@ -51,6 +51,14 @@ public void addProperty(String name, ResultSetScalarTypes type, Object value){

}

/**
*
* @return Entity's property names, as a Set
*/
public Set<String> getEntityPropertyNames(){
return propertyMap.keySet();
}

/**
* Add a property to the entity
* @param property
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redislabs.redisgraph.impl;
package com.redislabs.redisgraph.graph_entities;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redislabs.redisgraph.impl;
package com.redislabs.redisgraph.graph_entities;

import com.redislabs.redisgraph.ResultSet;

Expand Down
10 changes: 6 additions & 4 deletions src/main/java/com/redislabs/redisgraph/impl/ResultSetImpl.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.redislabs.redisgraph.impl;

import com.redislabs.redisgraph.Header;
import com.redislabs.redisgraph.Record;
import com.redislabs.redisgraph.ResultSet;
import com.redislabs.redisgraph.Statistics;
import com.redislabs.redisgraph.*;
import com.redislabs.redisgraph.graph_entities.Edge;
import com.redislabs.redisgraph.graph_entities.GraphEntity;
import com.redislabs.redisgraph.graph_entities.Node;
import com.redislabs.redisgraph.graph_entities.Property;
import com.redislabs.redisgraph.impl.graph_cache.GraphCache;
import redis.clients.jedis.util.SafeEncoder;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redislabs.redisgraph.impl;
package com.redislabs.redisgraph.impl.graph_cache;

import com.redislabs.redisgraph.RedisGraph;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redislabs.redisgraph.impl;
package com.redislabs.redisgraph.impl.graph_cache;

import com.redislabs.redisgraph.Record;
import com.redislabs.redisgraph.RedisGraph;
Expand Down
15 changes: 7 additions & 8 deletions src/test/java/com/redislabs/redisgraph/RedisGraphAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import com.redislabs.redisgraph.impl.Edge;
import com.redislabs.redisgraph.impl.Node;
import com.redislabs.redisgraph.impl.Property;
import com.redislabs.redisgraph.graph_entities.Edge;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why graph_entities? and not graphEntities?

import com.redislabs.redisgraph.graph_entities.Node;
import com.redislabs.redisgraph.graph_entities.Property;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
Expand Down Expand Up @@ -280,6 +280,10 @@ public void testRecord(){
place, since, doubleValue, false, null),
record.values());

Node a = record.getValue("a");
for (String propertyName : expectedNode.getEntityPropertyNames()){
Assert.assertEquals(expectedNode.getProperty(propertyName) ,a.getProperty(propertyName));
}

Assert.assertEquals( "roi", record.getString(2));
Assert.assertEquals( "32", record.getString(3));
Expand Down Expand Up @@ -407,11 +411,6 @@ public void testAdditionToProcedures(){
Assert.assertNotNull(api.query("social", "CREATE (:person{name:'amit',age:30})"));
Assert.assertNotNull(api.query("social", "MATCH (a:person), (b:person) WHERE (a.name = 'roi' AND b.name='amit') CREATE (a)-[:knows]->(b)"));


List<ResultSet> resultSets = IntStream.range(0,16).parallel().
mapToObj(i-> api.query("social", "MATCH (a:person)-[r:knows]->(b:person) RETURN a,r")).
collect(Collectors.toList());

//expected objects init
Property nameProperty = new Property("name", ResultSet.ResultSetScalarTypes.PROPERTY_STRING, "roi");
Property ageProperty = new Property("age", ResultSet.ResultSetScalarTypes.PROPERTY_INTEGER, 32);
Expand Down