cancel
Showing results for 
Search instead for 
Did you mean: 

Apoc.schema.assert() compatible with indexing relationship properties?

skerr
Node Clone

Just checking in to see if the latest version of APOC's apoc.schema.assert() procedure is compatible with Neo4j's capability to index relationship properties. Thank you in advance.

1 REPLY 1

skerr
Node Clone

Here is an update:
Using the following graph:

LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/mathbeveridge/gameofthrones/master/data/got-s1-edges.csv" as row
MERGE (s:Character{name:row.Source})
MERGE (t:Character{name:row.Target})
MERGE (s)-[i:INTERACTS]-(t)
SET i.weight = toInteger(row.Weight)

Making apoc.schema.assert() call:

CALL apoc.schema.assert({INTERACTS:['weight']},{});ype or paste code here

Returned we get:

label	key	keys	unique	action
INTERACTS	weight	[weight]	False	CREATED

Which seems to be correct, until the relationship type: INTERACTS is interpreted as a node label:

id	name	state	populationPercent	uniqueness	type	entityType	labelsOrTypes	properties	indexProvider
1	index_343aff4e	ONLINE	100.0	NONUNIQUE	LOOKUP	NODE	None	None	token-lookup-1.0
3	index_804fba7c	ONLINE	100.0	NONUNIQUE	BTREE	NODE	[INTERACTS]	[weight]	native-btree-1.0
2	index_f7700477	ONLINE	100.0	NONUNIQUE	LOOKUP	RELATIONSHIP	None	None	token-lookup-1.0

QUESTION: is the Relationship property "weight" indexed?

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.