private Set<SkinnyUUID> findUUIDs(final ProtoNetwork network,
            Map<String, JDBMEquivalenceLookup> lookups,
            final List<Statement> stmts) {
        final Set<SkinnyUUID> uuids = new HashSet<SkinnyUUID>();

        for (final Statement stmt : stmts) {
            // Add all the object's parameters
            Object stmtObj = stmt.getObject();
            if (stmtObj == null || stmtObj.getTerm() == null) {
                continue;
            }
            for (final Parameter p : stmtObj.getTerm()) {
                if (!validParameter(p)) {
                    continue;
                }
                Namespace ns = p.getNamespace();
                String val = p.getValue();
                String rl = ns.getResourceLocation();

                JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
                if (jdbmLookup == null) {
                    continue;
                }

                SkinnyUUID uuid = jdbmLookup.lookup(val);
                if (uuid != null) {
                    uuids.add(uuid);
                }
            }
        }

        // Establish set of UUIDs relevant for the proto-network
        Set<SkinnyUUID> pnUUIDs = new HashSet<SkinnyUUID>();
        ParameterTable paramTbl = network.getParameterTable();
        TableParameter[] paramArr = paramTbl.getTableParameterArray();
        for (final TableParameter tp : paramArr) {
            if (!validParameter(tp)) {
                continue;
            }
            TableNamespace namespace = tp.getNamespace();
            String value = tp.getValue();
            String rl = namespace.getResourceLocation();
            JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
            if (jdbmLookup == null) {
                continue;
            }

            SkinnyUUID uuid = jdbmLookup.lookup(value);
            if (uuid != null) {
                pnUUIDs.add(uuid);
            }
        }

        // Two sets of UUIDs have been established at this point.
        // The first set, uuids, is the set based on the statements.
        // The second set, pnUUIDs, is the set based on the proto-network.
        // Make uuids the intersection of the two: (uuids ∩ pnUUIDs)
        uuids.retainAll(pnUUIDs);

        return uuids;
    }
private Set < SkinnyUUID > findUUIDs ( final ProtoNetwork network , Map < String , JDBMEquivalenceLookup > lookups , final List < Statement > stmts ) { final Set < SkinnyUUID > uuids = new HashSet < SkinnyUUID > ( ) ; for ( final Statement stmt : stmts ) { Object stmtObj = stmt . getObject ( ) ; if ( stmtObj == null || stmtObj . getTerm ( ) == null ) { continue ; } for ( final Parameter p : stmtObj . getTerm ( ) ) { if ( ! validParameter ( p ) ) { continue ; } Namespace ns = p . getNamespace ( ) ; String val = p . getValue ( ) ; String rl = ns . getResourceLocation ( ) ; JDBMEquivalenceLookup jdbmLookup = lookups . get ( rl ) ; if ( jdbmLookup == null ) { continue ; } SkinnyUUID uuid = jdbmLookup . lookup ( val ) ; if ( uuid != null ) { uuids . add ( uuid ) ; } } } Set < SkinnyUUID > pnUUIDs = new HashSet < SkinnyUUID > ( ) ; ParameterTable paramTbl = network . getParameterTable ( ) ; TableParameter [ ] paramArr = paramTbl . getTableParameterArray ( ) ; for ( final TableParameter tp : paramArr ) { if ( ! validParameter ( tp ) ) { continue ; } TableNamespace namespace = tp . getNamespace ( ) ; String value = tp . getValue ( ) ; String rl = namespace . getResourceLocation ( ) ; JDBMEquivalenceLookup jdbmLookup = lookups . get ( rl ) ; if ( jdbmLookup == null ) { continue ; } SkinnyUUID uuid = jdbmLookup . lookup ( value ) ; if ( uuid != null ) { pnUUIDs . add ( uuid ) ; } } uuids . retainAll ( pnUUIDs ) ; return uuids ; }
Finds the {@link SkinnyUUID} for every {@link Parameter parameter} in
the {@link ProtoNetwork proto network} that is also referenced in the
{@link Term object term} of each {@link Statement statement}.

@param network {@link ProtoNetwork}, the proto network containing
{@link Parameter parameters} that we'll get {@link String uuids} for
@param lookups {@link Map} of {@link JDBMEquivalenceLookup} keyed by
resource location and assumed to be open / ready for lookups
@param stmts {@link List} of {@link Statement}, the statements
that contain object-term {@link Parameter parameters} that we'll get
{@link SkinnyUUID}s for
@return the {@link SkinnyUUID} intersection between the statement's
object term {@link Parameter parameters} and the proto network's
{@link Parameter parameters}