module.exports.getIdentifier = function (resource, system){
    var assert = require('../assert');

    if (!resource) {
        throw new Error('resource undefined');
    }

    if (!system) {
        throw new Error('url undefined');
    }

    if (!resource.identifier) {
        return;
    }

    var hasSystem = assert.identifier.hasSystem(system);
    var match = resource.identifier.filter(hasSystem);
    return match[0];
};
