Spaces:
Sleeping
Sleeping
Download skill_gap.cypher from Win786/careercompass: direct link, hf CLI and curl.
- Browser
- Download file 2.29 kB
-
https://huggingface.co/spaces/Win786/careercompass/resolve/main/skill_gap.cypher
- Command line
-
hf download hf://spaces/Win786/careercompass/skill_gap.cypher
-
curl -L -o skill_gap.cypher https://huggingface.co/spaces/Win786/careercompass/resolve/main/skill_gap.cypher
2.29 kB
| // $skills: canonical skill-name strings; $levels: list of {name, level}. | |
| // Ignore malformed entries. Duplicate valid levels resolve to their maximum. | |
| // All important requirements are returned, including ones the supplied | |
| // levels meet or exceed ("meets_level"), so supplied levels are never | |
| // silently dropped and the row set is consistent across entry paths. | |
| MATCH (o:Occupation {soc: $soc})-[r:REQUIRES]->(s:Skill) | |
| WHERE r.importance_usable = true AND r.importance >= 3.0 | |
| WITH o, r, s, | |
| [x IN coalesce($skills, []) | |
| | toLower(trim(CASE WHEN typeOf(x) = 'String' THEN x ELSE '' END))] AS owned, | |
| [x IN coalesce($levels, []) | |
| | CASE WHEN typeOf(x) = 'Map' THEN x ELSE {} END] AS level_maps | |
| WITH o, r, s, | |
| reduce(unique_names = [], name IN owned | | |
| CASE WHEN name = '' OR name IN unique_names THEN unique_names | |
| ELSE unique_names + [name] END) AS owned, | |
| [x IN level_maps | | |
| {name: toLower(trim(CASE WHEN typeOf(x.name) = 'String' | |
| THEN x.name ELSE '' END)), | |
| level: CASE WHEN typeOf(x.level) IN ['Integer', 'Float'] | |
| THEN x.level ELSE null END}] AS normalized_levels | |
| WITH o, r, s, owned, | |
| [x IN normalized_levels | |
| WHERE x.name = s.name_norm AND x.level >= 0 AND x.level <= 7 | |
| | x.level] AS valid_levels | |
| UNWIND CASE WHEN size(valid_levels) = 0 THEN [null] | |
| ELSE valid_levels END AS supplied | |
| WITH o, r, s, owned, max(supplied) AS user_level | |
| WITH o, r, s, user_level, | |
| CASE WHEN NOT (s.name_norm IN owned) AND user_level IS NULL THEN 'missing' | |
| WHEN user_level IS NULL OR coalesce(r.level_usable, false) = false | |
| THEN 'unassessed' | |
| WHEN user_level < r.level THEN 'weak' | |
| ELSE 'meets_level' END AS status | |
| RETURN o.soc AS soc, s.id AS skill_id, s.name AS skill, s.family AS family, | |
| status, r.importance AS importance, | |
| CASE WHEN r.level_usable THEN r.level ELSE null END AS required_level, | |
| user_level, | |
| CASE WHEN status = 'weak' THEN r.level - user_level ELSE null END AS level_gap, | |
| {median_annual: o.median_annual_wage, year: o.wage_year, soc: o.wage_soc, status: o.wage_status, source_url: o.wage_source_url} AS wage | |
| ORDER BY importance DESC, coalesce(level_gap, -1.0) DESC, skill; | |