@Override
    public List<KamEdge> resolveEdges(Kam kam, List<Edge> edges)
            throws ResolverServiceException {
        final List<KamEdge> resolvedKamEdges = sizedArrayList(edges.size());
        final Equivalencer eq = getEquivalencer();

        Map<String, String> nsmap = namespaces(kam);

        for (final Edge edge : edges) {

            // If relationship type is UNKNOWN then we cannot find it in the
            // KAM.
            if (edge.getRelationship() == RelationshipType.UNKNOWN) {
                continue;
            }

            final Node subject = edge.getSource();
            final Node object = edge.getTarget();

            if (subject == null) {
                throw new InvalidArgument("Edge subject is invalid.");
            }

            if (object == null) {
                throw new InvalidArgument("Edge object is invalid.");
            }

            String subLbl = subject.getLabel();
            String objLbl = object.getLabel();
            final Kam.KamEdge re;
            org.openbel.framework.common.enums.RelationshipType rel;
            rel = convert(edge.getRelationship());

            try {
                re = resolver.resolve(kam, kAMStore, subLbl, rel, objLbl,
                        nsmap, eq);
                resolvedKamEdges.add(convert(kam.getKamInfo(), re));
            } catch (ResolverException e) {
                String fmt = "Failed to resolve BEL edge %s %s %s.";
                throw new ResolverServiceException(format(fmt, subLbl,
                        rel.getAbbreviation(), objLbl), e);
            }
        }

        return resolvedKamEdges;
    }
@ Override public List < KamEdge > resolveEdges ( Kam kam , List < Edge > edges ) throws ResolverServiceException { final List < KamEdge > resolvedKamEdges = sizedArrayList ( edges . size ( ) ) ; final Equivalencer eq = getEquivalencer ( ) ; Map < String , String > nsmap = namespaces ( kam ) ; for ( final Edge edge : edges ) { if ( edge . getRelationship ( ) == RelationshipType . UNKNOWN ) { continue ; } final Node subject = edge . getSource ( ) ; final Node object = edge . getTarget ( ) ; if ( subject == null ) { throw new InvalidArgument ( "Edge subject is invalid." ) ; } if ( object == null ) { throw new InvalidArgument ( "Edge object is invalid." ) ; } String subLbl = subject . getLabel ( ) ; String objLbl = object . getLabel ( ) ; final Kam . KamEdge re ; org . openbel . framework . common . enums . RelationshipType rel ; rel = convert ( edge . getRelationship ( ) ) ; try { re = resolver . resolve ( kam , kAMStore , subLbl , rel , objLbl , nsmap , eq ) ; resolvedKamEdges . add ( convert ( kam . getKamInfo ( ) , re ) ) ; } catch ( ResolverException e ) { String fmt = "Failed to resolve BEL edge %s %s %s." ; throw new ResolverServiceException ( format ( fmt , subLbl , rel . getAbbreviation ( ) , objLbl ) , e ) ; } } return resolvedKamEdges ; }
{@inheritDoc}