Skip to content

Commit

Permalink
Merge f4f792f into 8a4d713
Browse files Browse the repository at this point in the history
  • Loading branch information
kshefchek committed Sep 20, 2018
2 parents 8a4d713 + f4f792f commit 635cd26
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -58,6 +58,10 @@ local.properties
.project
.classpath

### IntelliJ ###
.idea/
*.iml

# External tool builders
.externalToolBuilders/

Expand Down
Expand Up @@ -99,7 +99,7 @@ private static void setupIndex(AutoIndexer<?> index, Collection<String> properti
public static void setupAutoIndexing(GraphDatabaseService graphDb, Neo4jConfiguration config) {
try (Transaction tx = graphDb.beginTx()) {
graphDb.index().forNodes("node_auto_index", INDEX_CONFIG);
Set<String> indexProperties = newHashSet(CommonProperties.IRI);
Set<String> indexProperties = newHashSet();
indexProperties.addAll(config.getIndexedNodeProperties());
indexProperties
.addAll(transform(config.getExactNodeProperties(), new Function<String, String>() {
Expand Down Expand Up @@ -163,7 +163,7 @@ public void run() {
}
});

if (!readOnly) { // No need of auto-indexing in read-only mode
if (!readOnly && configuration.getIndexedNodeProperties().size() > 0) { // No need of auto-indexing in read-only mode
setupAutoIndexing(graphDb, configuration);
}

Expand Down
Expand Up @@ -85,9 +85,9 @@ public void allPropertyKeys_areReturned() {
public void allRelationshipTypes_areReturned() {
// TODO: RelationshipTypeTokens don't equal RelationshipTypes
assertThat(getFirst(graphApi.getAllRelationshipTypes(), null).name(),
is(OwlRelationships.RDFS_SUBCLASS_OF.name()));
assertThat(getLast(graphApi.getAllRelationshipTypes()).name(),
is(OwlRelationships.OWL_EQUIVALENT_CLASS.name()));
assertThat(getLast(graphApi.getAllRelationshipTypes()).name(),
is(OwlRelationships.RDFS_SUBCLASS_OF.name()));
}

@Test
Expand Down
Expand Up @@ -18,6 +18,7 @@
import static com.google.common.collect.Sets.newHashSet;
import io.scigraph.frames.Concept;
import io.scigraph.frames.NodeProperties;
import io.scigraph.frames.CommonProperties;
import io.scigraph.neo4j.GraphTransactionalImpl;
import io.scigraph.neo4j.IdMap;
import io.scigraph.neo4j.Neo4jConfiguration;
Expand All @@ -41,6 +42,7 @@ protected GraphTransactionalImpl createInstance() throws Exception {
Concept.ABREVIATION,
Concept.ACRONYM));
config.getIndexedNodeProperties().addAll(newHashSet(
CommonProperties.IRI,
NodeProperties.LABEL,
Concept.CATEGORY, Concept.SYNONYM,
Concept.ABREVIATION,
Expand Down
Expand Up @@ -48,6 +48,7 @@ public class GraphTestBase {
protected static Graph graph;
protected static CurieUtil curieUtil;
static ConcurrentHashMap<String, Long> idMap = new ConcurrentHashMap<>();
static RelationshipMap relMap = new RelationshipMap();

Transaction tx;

Expand Down Expand Up @@ -75,10 +76,10 @@ public static void setupDb() {
config.getExactNodeProperties().addAll(
newHashSet(NodeProperties.LABEL, Concept.SYNONYM, Concept.ABREVIATION, Concept.ACRONYM));
config.getIndexedNodeProperties().addAll(
newHashSet(NodeProperties.LABEL, Concept.CATEGORY, Concept.SYNONYM, Concept.ABREVIATION,
Concept.ACRONYM));
newHashSet(CommonProperties.IRI, NodeProperties.LABEL, Concept.CATEGORY, Concept.SYNONYM,
Concept.ABREVIATION, Concept.ACRONYM));
Neo4jModule.setupAutoIndexing(graphDb, config);
graph = new GraphTransactionalImpl(graphDb, idMap, new RelationshipMap());
graph = new GraphTransactionalImpl(graphDb, idMap, relMap);
curieUtil = new CurieUtil(Collections.<String, String>emptyMap());
cypherUtil = new CypherUtil(graphDb, curieUtil);
}
Expand All @@ -96,6 +97,7 @@ public void startTransaction() {
@After
public void failTransaction() {
idMap.clear();
relMap.clear();
tx.failure();
// tx.success(); // convenient for debugging
tx.close();
Expand Down
2 changes: 1 addition & 1 deletion SciGraph-core/src/test/resources/cliqueConfiguration.yaml
Expand Up @@ -6,7 +6,7 @@ graphConfiguration:
indexedNodeProperties:
- category
- label
- fragment
- iri
exactNodeProperties:
- label
- synonym
Expand Down
1 change: 1 addition & 0 deletions SciGraph-core/src/test/resources/pizzaExample.yaml
Expand Up @@ -7,6 +7,7 @@ graphConfiguration:
- category
- label
- fragment
- iri
exactNodeProperties:
- label
- synonym
Expand Down
Expand Up @@ -16,7 +16,7 @@ graphConfiguration:
indexedNodeProperties:
- category
- label
- fragment
- iri
exactNodeProperties:
- label
- synonym
Expand Down
Expand Up @@ -18,7 +18,7 @@ graphConfiguration:
indexedNodeProperties:
- category
- label
- fragment
- iri
exactNodeProperties:
- label
- synonym
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -76,7 +76,7 @@
<dropwizard.version>1.1.0</dropwizard.version>
<guice.version>4.0</guice.version>
<blueprints.version>2.6.0</blueprints.version>
<neo4j.version>3.3.1</neo4j.version>
<neo4j.version>3.4.7</neo4j.version>
<neo4j-graphviz.version>3.1.1</neo4j-graphviz.version>
</properties>

Expand Down

0 comments on commit 635cd26

Please sign in to comment.