Skip to content

Instantly share code, notes, and snippets.

Avatar

Rafal Jacyna rajfal

View GitHub Profile
@rajfal
rajfal / soil-frequency-across-years.cql
Last active Mar 2, 2018
Summarize soil issue frequency across years
View soil-frequency-across-years.cql
UNWIND [2007,2008, 2009, 2010, 2011, 2012, 2013, 2014] as years
MATCH (y:Year {year: years})-[:HAS_MONTH]->(m:Month )-[:HAS_DAY]->(d:Day)<-[r:REPORTED_ON]-()-[*1..2]-(n:Soil_Issue)
WITH y.year as Y, collect( n.type) as Issues
RETURN Y,
size(filter(x IN Issues WHERE x= 'Acidification')) as Acidification,
size(filter(x IN Issues WHERE x= 'Compaction')) as Compaction,
size(filter(x IN Issues WHERE x= 'Erosion')) as Erosion,
size(filter(x IN Issues WHERE x= 'HeavyMetalContamination')) as HeavyMetalContamination,
size(filter(x IN Issues WHERE x= 'HighAlkalinity')) as HighAlkalinity,
size(filter(x IN Issues WHERE x= 'Impermeable')) as Impermeable,
You can’t perform that action at this time.