cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Correct syntax for where clause

andy_hegedus
Graph Fellow

Hi,

Working on refine a query. Here is the starting point.

match (a:cpc)
where a.art contains "ALD" or a.art contains 'atomic layer deposition'
return a.subgroup, a.art

Which returns this:

a.subgroup a.art
C23C16/45525 Atomic layer deposition [ALD]
C23C16/45527 characterized by the ALD cycle, e.g. different flows or temperatures during half-reactions, unusual pulsing sequence, use of precursor mixtures or auxiliary reactants or activations
C23C16/45538 Plasma being used continuously during the ALD cycle
C23C16/4554 Plasma being used non-continuously in between ALD reactions
C23C16/45542 Plasma being used non-continuously during the ALD reactions
C23C16/45546 specially adapted for a substrate stack in the ALD reactor
C23C16/45548 having arrangements for gas injection at different locations of the reactor for each ALD half-reaction
C23C16/45553 characterized by the use of precursors specially adapted for ALD
G05B2219/49027 SALD selective area laser deposition, vapor solidifies on surface
H01J49/0418 for laser desorption, e.g. matrix-assisted laser desorption/ionisation [MALDI], surface enhanced laser desorption/ionisation [SELDI] plates
H01J49/164 Laser desorption/ionisation, e.g. matrix-assisted laser desorption/ionisation [MALDI]
H01L21/0228 deposition by cyclic CVD, e.g. ALD, ALE, pulsed CVD
H01L21/0229 liquid atomic layer deposition
H01L21/28194 by deposition, e.g. evaporation, ALD, CVD, sputtering, laser deposition
H01L21/3141 Deposition using atomic layer deposition techniques [ALD]
H01L45/1616 by chemical vapor deposition, e.g. MOCVD, ALD

So far so good, now I want to further constrain the result to those where the subgroup starts with "H01L"
and started with this query.

MATCH (a:cpc) where a.supgroup starts with 'H01L' and a.art contains 'ALD' or a.art contains 'atomic layer deposition' return a.subgroup as subgroup 

which return this list which seems to evaluate as the first "AND" last clause.

subgroup a.art
H01L21/0229 liquid atomic layer deposition
H01L21/3141 Deposition using atomic layer deposition techniques [ALD]

If I try to put the two "contain" in parentheses since I want either to be true:

MATCH (a:cpc) where a.supgroup starts with 'H01L' and  (a.art contains 'ALD' or a.art contains 'atomic layer deposition') return a.subgroup as subgroup

I get no results. What is the correct syntax that requires subgroup to start with "H01L" and have either of the contain clauses true to return a value. I am looking to get the last 5 rows of the first results table.

Andy

1 ACCEPTED SOLUTION

@andy.hegedus

It seems just a typo
In the 1st query you write supgroup, with P after su,
in the 2nd one instead is subgroup.

View solution in original post

3 REPLIES 3

andy_hegedus
Graph Fellow

Ok update though it needs some explaining.

I took the last query which yield no results

MATCH (a:cpc) 
where a.supgroup starts with 'H01L' and  (a.art contains 'ALD' or a.art contains 'atomic layer deposition')
return a.subgroup as subgroup

and just reversed the order of the clauses with the clauses in parenthesis now coming first

MATCH (a:cpc) 
where (a.art contains 'ALD' or a.art contains 'atomic layer deposition') and a.subgroup starts with 'H01L' 
return a.subgroup as subgroup, a.art

and that returns the desired result

subgroup a.art
H01L21/0228 deposition by cyclic CVD, e.g. ALD, ALE, pulsed CVD
H01L21/0229 liquid atomic layer deposition
H01L21/28194 by deposition, e.g. evaporation, ALD, CVD, sputtering, laser deposition
H01L21/3141 Deposition using atomic layer deposition techniques [ALD]
H01L45/1616 by chemical vapor deposition, e.g. MOCVD, ALD

So the question is why did the order matter?

Andy

@andy.hegedus

It seems just a typo
In the 1st query you write supgroup, with P after su,
in the 2nd one instead is subgroup.

Thank you.

I was focusing on the second part of the test I didn't even see it.
Andy