Relationship labels

Hello,

I am on page Using WHERE to Filter Queries - Querying with Cypher in Neo4j 4.x. The query I'm executing is

MATCH (p:Person)-[r:ACTED_IN]->(m:Movie)
WHERE 'Neo' IN r.roles AND m.title='The Matrix'
RETURN p.name

What I don't understand is where is the roles label in ACTED_IN. I tried looking for it by doing a Call db.schema.visualization() and this is what I get:

{
"identity": -31,
"start": -11,
"end": -12,
"type": "ACTED_IN",
"properties": {

}
}

How can I visualise what I can filter on?

Thanks

AFAIK db.schema.visualization() only displays available indexes. You could use the APOC schema functions: apoc.meta.relTypeProperties - APOC Extended Documentation

Be aware that APOC only sample the data, so if you need to be 100% sure, you will have to retrieve the properties for the labels and relation type you are interested in like that:

MATCH (p:Person)-[r:ACTED_IN]->(m:Movie)
RETURN DISTINCT keys(r) AS properties

Hello @chribonn and welcome to the Community!

In Neo4j Browser, if you hover over the relationships, the roles property should be viewable at the bottom.

You might want to perform this query to see all of the roles for these relationships;

MATCH (p:Person)-[r:ACTED_IN]->(m:Movie)
RETURN p.name, r.roles, m.title

Properties are not required for a relationship so there are probably ACTED_IN relationships with no roles property defined,

Elaine

I find myself nodding along as I read, appreciating the depth of your insights. This blog is a valuable resource, and I look forward to future posts. Jira Tutorial