-
Notifications
You must be signed in to change notification settings - Fork 5
LDPC Types
Each Linked Data Platform container can be a one of a number of types. The types perform different workflows in regard of where they store the data, either by time window, or specific to connections. The workflow is also used to discover a presence endpoint.
There are currently 4 types.
This is a simple workflow that by default pulls data from the LDPC and sends data to that LDPC.
This workflow divides each LDPC into daily sub containers, one per day. The format of the date is dd-mm-yyyy. In general data from today's container will be pulled in, and written to. If no sub container exists, one will be created dynamically, as needed.
This workflow divides each LDPC into daily sub containers, one per friend (as delineated by foaf : knows). The format of the friend is sha256(URI).
This is a combination of friends and daily.
// getChannel
// 4 workflows
//
// single : normal self contained ldpc
// daily : one subdir per day
// friends : one subdir per friends hash
// friendsdaily : subdir by friends, then by day
function getChannel(ldpc, type, date, hash) {
if (!ldpc) {
return;
}
if (!date) date = template.settings.date;
if (!type) type = template.settings.type;
if (!ldpc) ldpc = template.settings.ldpc;
if (!type) hash = template.settings.hash;
var today = new Date().toISOString().substr(0,10);
if (!date) date = today;
if (ldpc.slice(-1) !== '/') {
ldpc += '/';
}
if (type==='single') {
return ldpc;
}
if (type==='daily') {
return ldpc + date + '/';
}
if (type==='friends') {
return ldpc + hash + '/';
}
if (type==='friendsdaily') {
//return ldpc + hash + '/' + date + '/';
return ldpc;
}
return ldpc;
}