Members
A member is a User node. Personal settings are kept apart, in a UserBook node.
Properties of User
| Property | Description |
|---|---|
id | Unique identifier on the platform |
login | Sign-in name, usually built from the first and last names |
firstName, lastName, displayName | Names |
firstNameSearchField, lastNameSearchField, displayNameSearchField | Normalized versions of the names, used for search |
otherNames, surname | Other given names and alternative family name |
birthDate | Date of birth, in ISO 8601 |
address, zipCode, city, country | Postal address |
profiles | Profile of the member: Student, Teacher, Relative, Personnel or Guest |
structures | External identifiers of the organizations the member belongs to |
classes, groups | External identifiers of the member's classes and groups |
level, sector | Level and track the learner is enrolled in |
module, moduleName | Code and name of the program of study |
fieldOfStudy, fieldOfStudyLabels | Codes and names of the subjects followed |
relative, relativeAddress | References to the learner's guardians, as supplied by the import |
externalId, joinKey | Identifier in the external system, and key used to match the member across systems |
ine | The learner's official student number, where the education system defines one |
source | Where the data came from: the name of the provisioning feed, or manual creation |
activationCode | Code that lets the member activate the account. Present until activation. |
enabled | Whether the account is enabled |
emailVerified | Whether the e-mail address has been verified |
status | Current status of the member |
accommodation, transport, scholarshipHolder | Boarding, transport and financial-aid indicators, when the import supplies them |
attachmentId | Reference to an attached file, such as the profile picture |
checksum | Fingerprint of the imported data, used to detect changes |
created, modified | Creation and last modification dates |
UserBook
The UserBook node holds what the member sets for themselves: the theme, the avatar, the storage
quota and its current use.
How a member is linked
Finding a member
By name:
MATCH (u:User)
WHERE toLower(u.lastName) = toLower('Smith')
RETURN u
By identifier or login:
MATCH (u:User { id: $id }) RETURN u
MATCH (u:User { login: 'tom.mate' }) RETURN u
Everything about one member
This query starts from a member and collects their organizations, functions with their scopes, children, parents, groups, administrative attachments and subjects taught:
MATCH (u:User { id: $id })
OPTIONAL MATCH (u)-[:IN]->(:ProfileGroup)-[:DEPENDS]->(s:Structure)
WITH COLLECT(DISTINCT s) AS structureNodes, u
OPTIONAL MATCH (u)-[rf:HAS_FUNCTION]->(f:Function)
WITH COLLECT(DISTINCT [f.externalId, rf.scope]) AS functions, u, structureNodes
OPTIONAL MATCH (u)<-[:RELATED]-(child:User)
WITH COLLECT(DISTINCT {id: child.id, displayName: child.displayName, externalId: child.externalId}) AS children, functions, u, structureNodes
OPTIONAL MATCH (u)-[:RELATED]->(parent:User)
WITH COLLECT(DISTINCT {id: parent.id, displayName: parent.displayName, externalId: parent.externalId}) AS parents, children, functions, u, structureNodes
OPTIONAL MATCH (u)-[:IN]->(fgroup:FunctionalGroup)
WITH COLLECT(DISTINCT {id: fgroup.id, name: fgroup.name}) AS admGroups, parents, children, functions, u, structureNodes
OPTIONAL MATCH (u)-[:ADMINISTRATIVE_ATTACHMENT]->(admStruct:Structure)
WITH COLLECT(DISTINCT {id: admStruct.id}) AS admStruct, admGroups, parents, children, functions, u, structureNodes
OPTIONAL MATCH (u)-[r:TEACHES]->(s:Subject)
WITH COLLECT(DISTINCT s.code) AS subjectCodes, admStruct, admGroups, parents, children, functions, u, structureNodes
OPTIONAL MATCH (u)-[:IN]->(mgroup:ManualGroup)
WITH COLLECT(DISTINCT {id: mgroup.id, name: mgroup.name}) AS manualGroups, subjectCodes, admStruct, admGroups, parents, children, functions, u, structureNodes
RETURN DISTINCT
u.profiles AS type,
structureNodes,
functions,
[x IN COALESCE(children, []) WHERE x.id IS NOT NULL] AS children,
[x IN COALESCE(parents, []) WHERE x.id IS NOT NULL] AS parents,
[x IN COALESCE(admGroups, []) WHERE x.id IS NOT NULL] AS functionalGroups,
[x IN COALESCE(admStruct, []) WHERE x.id IS NOT NULL] AS administrativeStructures,
[x IN COALESCE(subjectCodes, []) WHERE x IS NOT NULL] AS subjectCodes,
manualGroups,
u
Members of an organization
The starting point is always the same path: member, profile group, structure.
MATCH (u:User)-[:IN]->(pg:ProfileGroup)-[:DEPENDS]->(s:Structure {id:$structureId})
RETURN DISTINCT
u.id AS id,
u.profiles[0] AS type,
u.activationCode AS code,
u.login AS login
Optional matches then add what a screen needs:
| To add | Pattern |
|---|---|
| Classes | OPTIONAL MATCH (u)-[:IN]->(:ProfileGroup)-[:DEPENDS]->(class:Class) |
| Possible duplicates, with their match score | OPTIONAL MATCH (u)-[d:DUPLICATE]-(duplicate:User) |
| Functional groups | OPTIONAL MATCH (u)-[:IN]->(fgroup:FunctionalGroup) |
| Manual groups | OPTIONAL MATCH (u)-[:IN]->(mgroup:ManualGroup) |
| Functions and their scope | OPTIONAL MATCH (u)-[rf:HAS_FUNCTION]->(f:Function) |
Each optional match is followed by a WITH that collects its results into a list, empty when
nothing matched, so that one row is returned per member.
Creating a member and their UserBook
CREATE (:User {
id: 'user_123',
login: 'john.smith',
displayName: 'John Smith'
});
MATCH (u:User {id: 'user_123'})
MERGE (u)-[:USERBOOK]->(:UserBook {
userid: 'user_123',
quota: 1073741824,
storage: 536870912
});
Linking a guardian and a learner
MATCH (parent:User {id: 'parent_1'}), (child:User {id: 'user_123'})
MERGE (parent)-[:RELATED]->(child);
Administrative responsibilities are granted through functions, not by editing the graph by hand.