Skip to content

Latest commit

 

History

History
283 lines (211 loc) · 6.84 KB

pifu.md

File metadata and controls

283 lines (211 loc) · 6.84 KB

PIFU

PIFU is a Norwegian Standard (NS 4170:2008) for "Flow of person-related information in education". The aim is to make it possible to exchange information about persons, groups, organizational units, and relationships in the context of education between different ICT systems, without needing to take into account the products that are used in the various components.

Ironally the standard is not available on the Web. Only printouts are allowed so that standard.no can sell this 70-pages document for NOK 1000,- a piece. To make this information somewhat accessible I've summarized the main points of the standard below:

PIFU is an information model that represents 3 classes of objects:

  • Person
  • Group
  • OrgUnit

and the relationships between them represented by Relation objects.

The following attributes are common for all these objects (including Relation):

  • TimeFrame?
  • Privacy?
  • Extension*

Group, OrgUnit and Relation objects also have the attribute:

  • Type

Relation objects also have the attribute:

  • PrimaryRelation?

Person, Group and OrgUnit objects also have these attributes:

  • ID+
  • Name*
  • ContactInfo*

Person objects also have these attributes:

  • Status*
  • DateOfBirth?
  • Gender?
  • Picture?
  • PreferredLanguage?
  • NativeTongue*
  • SpecialNeed*

The cardinality of attributes described is indicated by the trailing ‘?’, ‘*’, or ‘+’ character. The meaning is the same as when they occur in regular expressions. The ‘?’ means 0 or 1 occurrence. The ‘*’ means 0 or more occurrences. The ‘+’ means 1 or more occurrences. No cardinality modifier means exactly 1 occurrence (only used for Type above).

From this follows that the only mandatory attribute for Person is ID, while Group and OrgUnit objects in addition to ID has Type as mandatory attribute.

The Relation objects can be used to form pairs in any combination with Person, Group and OrgUnit objects to create a web of relationships. The pairs can also include two objects of the same kind.

The attribute values are themselves objects with structure and their own attributes.

The ID attributes values have the following attributes:

  • Type
  • Value
  • Scope?
  • AuthInfo*
  • IsUnique?

where the AuthInfo attribute value have the following attributes:

  • Type
  • Value

The Name attribute values have the following attributes:

  • Type
  • Value
  • Language?

The ContactInfo attribute values have the following attributes:

  • Type
  • Value?
  • Priority?
  • AddressInfo*
  • PostalCode?
  • City?

The TimeFrame attribute values have the following attributes:

  • From?
  • To?
  • Extension*

The Privacy attribute values have the following attributes:

  • DoNotDistributeObject?
  • DoNotShowObject?
  • DoNotDistributeAttribute*
  • DoNotShowAttribute*
  • Extension*

The Extension attribute values have the following attributes:

  • Type
  • Value
  • Privacy?

The Status attribute values have the following attributes:

  • Type
  • Value

The Picture attribute values have the following attributes:

  • Type
  • Format?
  • Value

All the rest of the attributes values have the following attributes:

  • Content
  • Source?

where Content is either a string, a date-time, an integer or a boolean scalar; and Source is a string scalar.

The attributes with date-time Content are From, To, DateOfBirth.

The attributes with integer Content are Priority and PostalCode.

The attributes with boolean Content are DoNotDistributeObject, DoNotShowObject, PrimaryRelation, and IsUnique.

The rest of the basic attribute values have string Content. These include Type, Value, Format, Language, etc.

PIFU does not specify what encoding to use for values or what Type attribute values to use. The standard is supposed to be used with profiles that specify this and the concrete mapping of the information model to some concrete syntax based on XML or JSON.

An example PIFU profile is PIFU-FK which is an XML based representation. There appears to be confusion about the ownership of PIFU-FK, so it might have been superceded by PIFU-IMS.

Mapping to JSON

To make this the PIFU model more concrete it might help to try to express it using the JSON syntax. No such mapping is specified by the standard itself. This is just my reinterpretaion of the standard in JSON.

Let’s build the structures bottom up this time and start with the basic attribute objects representing the primary values which are represented with objects like:

{
  "Content": "A string value",
  "Source": "ISO 8601"
}

in most cases the “Source” attribute isn’t really used and we can simplify this to:

"A string value"

For date-time values we use strings like:

"2017-04-20 14:05:30"

while integer and boolean values have a natural mapping in JSON. We don’t use null values as PIFU has no such concept (just optional attributes).

Attributes that can repeat more than once (suffixed by ‘*’ or ‘+’ in the attribute listings above) are always represented by JSON arrays. These arrays will never be empty, since this will be represented by the attribute itself not being present.

All other objects and attributes values are represented by JSON objects with keys that match the attributes in PIFU.

A minimal Person object can thus be represented as:

{
  "ID": [
    {
      "Type": "feideName",
      "Value": "[email protected]"
    }
  ]
}

and if we add some more attributes we end up with:

{
  "ID": [
    {
      "Type": "feideName",
      "Value": "[email protected]"
    }
  ],
  "Name": [
    {
      "Type": "firstName",
      "Value": "Gisle"
    },
    {
      "Type": "lastName",
      "Value": "Aas"
    }
  ],
  "Gender": {
    "Content": "1",
    "Source": "ISO/IEC 5218"
  },
  "PreferredLanguage": {
    "Content": "nb",
    "Source": "ISO 639-1"
  }
}

The Type values used above isn't part of the PIFU standard, but is used in some of the examples in the standard. For a more comprehensive example take a look at:

Attributes

Extension

The attribute value has the form:

[
  {
    "Type": "someExtraField",
    "Value": "some value"
    "Privacy": {
      "DoNotShowObject": true
    }
  },
  {
    "Type": "anotherExtraField",
    "Value": 42
  }
]

It's a list of key/value pairs that can be used to add info that's not part of the standard PIFU model to most objects.

Timeframe

The attribute value has the form:

{
  "From": "2017-01-01 00:00:00",
  "To":   "2017-04-30 23:59:59",
}

This indicates at what time period the attached information is valid for. The From and To attributes are optional.