private static Stream < String > getAgentMembers ( final IdentifierConverter < Resource , FedoraResource > translator , final FedoraResource resource , final String hashPortion ) { //resolve list of triples, accounting for hash-uris. final List < Triple > triples = resource . getTriples ( translator , PROPERTIES ) . filter ( triple -> hashPortion == null || triple . getSubject ( ) . getURI ( ) . endsWith ( hashPortion ) ) . collect ( toList ( ) ) ; //determine if there is a rdf:type vcard:Group final boolean hasVcardGroup = triples . stream ( ) . anyMatch ( triple -> triple . matches ( triple . getSubject ( ) , RDF_TYPE_NODE , VCARD_GROUP_NODE ) ) ; //return members only if there is an associated vcard:Group if ( hasVcardGroup ) { return triples . stream ( ) . filter ( triple -> triple . predicateMatches ( VCARD_MEMBER_NODE ) ) . map ( Triple :: getObject ) . flatMap ( WebACRolesProvider :: nodeToStringStream ) . map ( WebACRolesProvider :: stripUserAgentBaseURI ) ; } else { return empty ( ) ; } }
Given a FedoraResource return a list of agents .