*/
public Set<Subject> setupSubjects(List<Map<URI, List<AttributeValue>>> subjs) {
Set<Subject> subjects = new HashSet<Subject>();
if (subjs == null || subjs.size() == 0) {
subjects.add(new Subject(new HashSet<Attribute>()));
return subjects;
}
// Go through each of the subjects
for (Map<URI, List<AttributeValue>> s : subjs) {
Set<Attribute> attributes = new HashSet<Attribute>();
// Extract and create the attributes for this subject and add them
// to the set
for (URI uri : s.keySet()) {
List<AttributeValue> attributeValues = s.get(uri);
for (AttributeValue attributeValue : attributeValues) {
attributes.add(new Attribute(uri,
null,
null,
attributeValue));
}
}
// Create a new subject and add the attributes for this subject
subjects.add(new Subject(attributes));
}
return subjects;
}