Package org.openbel.framework.common.model

Examples of org.openbel.framework.common.model.Namespace


     */
    @Override
    public XBELParameter convert(Parameter source) {
        if (source == null) return null;

        Namespace namespace = source.getNamespace();
        String value = source.getValue();

        XBELParameter xp = new XBELParameter();

        if (namespace != null)
            xp.setNs(namespace.getPrefix());
        if (value != null)
            xp.setValue(value);

        return xp;
    }
View Full Code Here


            parameters = stmt.getSubject().getAllParameters();
            for (final Parameter p : parameters) {
                if (!validParameter(p)) {
                    continue;
                }
                Namespace ns = p.getNamespace();
                String val = p.getValue();
                String rl = ns.getResourceLocation();

                // ... do we have the family?
                if (networkLiterals.contains(new TableEntry(val, rl))) {
                    continue FAMILIES;
                }
            }

            Object stmtObj = stmt.getObject();
            if (haveUUIDs && stmtObj != null && stmtObj.getTerm() != null) {
                // ... all family members
                parameters = stmtObj.getTerm().getAllParameters();
                for (final Parameter p : parameters) {
                    if (!validParameter(p)) {
                        continue;
                    }
                    Namespace ns = p.getNamespace();
                    String val = p.getValue();
                    String rl = ns.getResourceLocation();

                    // ... do we have set membership?
                    JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
                    if (jdbmLookup != null) {
                        SkinnyUUID uuid = jdbmLookup.lookup(val);
View Full Code Here

                final List<Parameter> sp = stmt.getSubject().getAllParameters();
                for (final Parameter fp : sp) {
                    if (!validParameter(fp)) {
                        continue;
                    }
                    Namespace ns = fp.getNamespace();
                    String val = fp.getValue();
                    String rl = ns.getResourceLocation();

                    // have we seen a molecular activity function for this
                    // protein family parameter
                    entry = new TableEntry(val, rl);
                    if (entries.contains(entry)) {
                        // construct family term once, in case we find matches
                        final Term fpt = new Term(PROTEIN_ABUNDANCE);
                        fpt.addFunctionArgument(new Parameter(ns, val));
                        final Term fat = new Term(f);
                        fat.addFunctionArgument(fpt);

                        // since we found a molecular activity function for a
                        // protein family look up UUIDs for all entries
                        // ... loading uuids on demand to save resources
                        if (eu == null) {
                            eu = findUUIDs(entries, lookups);
                        }

                        // search protein family member parameters for same
                        // molecular activity function
                        final List<Parameter> op = stmt.getObject().getTerm()
                                .getAllParameters();
                        for (final Parameter mp : op) {
                            Namespace mns = mp.getNamespace();
                            String mval = mp.getValue();
                            String mrl = mns.getResourceLocation();

                            // lookup UUID for protein family member
                            JDBMEquivalenceLookup jdbmLookup = lookups.get(mrl);
                            if (jdbmLookup == null) {
                                continue;
View Full Code Here

            parameters = stmt.getSubject().getAllParameters();
            for (final Parameter p : parameters) {
                if (!validParameter(p)) {
                    continue;
                }
                Namespace ns = p.getNamespace();
                String val = p.getValue();
                String rl = ns.getResourceLocation();

                // ... do we have the complex?
                if (networkLiterals.contains(new TableEntry(val, rl))) {
                    continue COMPLEXES;
                }
            }

            Object stmtObj = stmt.getObject();
            if (haveUUIDs && stmtObj != null && stmtObj.getTerm() != null) {
                // ... all complex components
                parameters = stmtObj.getTerm().getAllParameters();
                for (final Parameter p : parameters) {
                    if (!validParameter(p)) {
                        continue;
                    }
                    Namespace ns = p.getNamespace();
                    String val = p.getValue();
                    String rl = ns.getResourceLocation();

                    // ... do we have set membership?
                    JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
                    if (jdbmLookup != null) {
                        SkinnyUUID uuid = jdbmLookup.lookup(val);
View Full Code Here

            final List<Parameter> parameters = stmt.getAllParameters();
            for (final Parameter p : parameters) {
                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 genes.
        // The second set, pnUUIDs, is the set based on the proto-network.

        // Make uuids the intersection of the two: (uuids ∩ pnUUIDs)
        uuids.retainAll(pnUUIDs);

        final Set<Statement> toPrune = new HashSet<Statement>();
        int pruned = 0;

        // Pruning is simply a matter of iterating all statements in genes...
        GENES: for (final Statement stmt : genes) {
            List<Parameter> parameters = stmt.getAllParameters();

            // ... and all parameters in each statement...
            for (final Parameter p : parameters) {
                if (!validParameter(p)) {
                    continue;
                }

                Namespace ns = p.getNamespace();
                String val = p.getValue();
                String rl = ns.getResourceLocation();

                // ... do we have set membership?
                JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
                if (jdbmLookup == null) {
                    continue;
View Full Code Here

            }
            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;
                }
View Full Code Here

                }

                // find UUID for subject parameter
                SkinnyUUID uuid = paramcache.get(subjectParam);
                if (uuid == null) {
                    final Namespace ns = subjectParam.getNamespace();
                    final JDBMEquivalenceLookup lookup = lookups.get(ns
                            .getResourceLocation());
                    if (lookup == null) {
                        continue;
                    }

                    uuid = lookup.lookup(subjectParam.getValue());
                    paramcache.put(subjectParam, uuid);
                }

                // if there is a proto network term with this UUID contained, then
                // this orthologous statement intersects the proto network, continue
                if (uuid != null) {
                    Set<Integer> tids = uuidterms.get(uuid);
                    if (hasItems(tids)) {
                        for (final Integer tid : tids) {
                            final Term t = tt.getIndexedTerms().get(tid);
                            if (t.getFunctionEnum() == subf) {
                                pnterms.add(sub);
                                pnterms.add(t);
                                pnterms.add(obj);

                                continue ORTHO_STATEMENT;
                            }
                        }
                    }
                }

                // lookup exact match of object term
                if (pnterms.contains(obj)) {
                    pnterms.add(sub);
                    continue;
                }

                // find UUID for object parameter
                uuid = paramcache.get(objectParam);
                if (uuid == null) {
                    final Namespace ns = objectParam.getNamespace();
                    final JDBMEquivalenceLookup lookup = lookups.get(ns
                            .getResourceLocation());
                    if (lookup == null) {
                        continue;
                    }
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.model.Namespace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.