Skip to main content

Members

A member is a User node. Personal settings are kept apart, in a UserBook node.

Properties of User​

PropertyDescription
idUnique identifier on the platform
loginSign-in name, usually built from the first and last names
firstName, lastName, displayNameNames
firstNameSearchField, lastNameSearchField, displayNameSearchFieldNormalized versions of the names, used for search
otherNames, surnameOther given names and alternative family name
birthDateDate of birth, in ISO 8601
address, zipCode, city, countryPostal address
profilesProfile of the member: Student, Teacher, Relative, Personnel or Guest
structuresExternal identifiers of the organizations the member belongs to
classes, groupsExternal identifiers of the member's classes and groups
level, sectorLevel and track the learner is enrolled in
module, moduleNameCode and name of the program of study
fieldOfStudy, fieldOfStudyLabelsCodes and names of the subjects followed
relative, relativeAddressReferences to the learner's guardians, as supplied by the import
externalId, joinKeyIdentifier in the external system, and key used to match the member across systems
ineThe learner's official student number, where the education system defines one
sourceWhere the data came from: the name of the provisioning feed, or manual creation
activationCodeCode that lets the member activate the account. Present until activation.
enabledWhether the account is enabled
emailVerifiedWhether the e-mail address has been verified
statusCurrent status of the member
accommodation, transport, scholarshipHolderBoarding, transport and financial-aid indicators, when the import supplies them
attachmentIdReference to an attached file, such as the profile picture
checksumFingerprint of the imported data, used to detect changes
created, modifiedCreation 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 addPattern
ClassesOPTIONAL MATCH (u)-[:IN]->(:ProfileGroup)-[:DEPENDS]->(class:Class)
Possible duplicates, with their match scoreOPTIONAL MATCH (u)-[d:DUPLICATE]-(duplicate:User)
Functional groupsOPTIONAL MATCH (u)-[:IN]->(fgroup:FunctionalGroup)
Manual groupsOPTIONAL MATCH (u)-[:IN]->(mgroup:ManualGroup)
Functions and their scopeOPTIONAL 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.