Package org.openbel.framework.common.model

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


    public List<Namespace> getSpeciesNamespaces(final int speciesTaxId) {
        List<Namespace> rlocs = sizedArrayList(headers.size());
        for (final Map.Entry<String, NamespaceHeader> e : headers.entrySet()) {
            NamespaceHeader hdr = e.getValue();
            if (matchesSpecies(hdr, speciesTaxId)) {
                rlocs.add(new Namespace(hdr.getNamespaceBlock().getKeyword(), e.getKey()));
            }
        }
        return Collections.unmodifiableList(rlocs);
    }
View Full Code Here


            SkinnyUUID[] uuids = new SkinnyUUID[params.size()];
            Parameter[] parray = params.toArray(new Parameter[params.size()]);
            boolean missing = false;
            for (int i = 0; i < parray.length; i++) {
                Parameter param = parray[i];
                Namespace ns = param.getNamespace();
                if (ns == null) {
                    missing = true;
                    break;
                }
View Full Code Here

    }

    private static void remapNamespace(List<Parameter> params,
            Map<String, String> nsmap) {
        for (Parameter p : params) {
            Namespace ns = p.getNamespace();
            if (ns != null) {
                String prefix = ns.getPrefix();
                String rloc = nsmap.get(prefix);
                if (rloc == null) {
                    // namespace not supported; remove it
                    p.setNamespace(null);
                } else {
                    p.setNamespace(new Namespace(prefix, rloc));
                }
            }
        }
    }
View Full Code Here

    /**
     * Tests {@link Namespace#copy()}.
     */
    @Test
    public void testCopy() {
        Namespace n1 = new Namespace("prefix", "resourceLocation");
        Namespace n2 = n1.clone();
        assertEquals(n1, n2);
        assertFalse(n1 == n2);

        Set<Object> set = new HashSet<Object>();
        set.add(n1);
View Full Code Here

            List<KAMStoreDaoImpl.Namespace> nsl = kAMStore.getNamespaces(info);
            nsmap = constrainedHashMap(nsl.size());
            for (final KAMStoreDaoImpl.Namespace n : nsl) {
                nsmap.put(n.getPrefix(),
                        new Namespace(n.getPrefix(), n.getResourceLocation()));
            }

            speciesNs = ns.getSpeciesNamespaces(taxId);
        } catch (Exception e) {
            throw new IllegalStateException("Failure to load namespaces.", e);
View Full Code Here

        }
    }

    private Parameter convert(KAMStoreDaoImpl.TermParameter tp) {
        final KAMStoreDaoImpl.Namespace kns = tp.getNamespace();
        final Namespace ns =
                new Namespace(kns.getPrefix(), kns.getResourceLocation());
        return new Parameter(ns, tp.getParameterValue());
    }
View Full Code Here

            // Method choice depends on whether a term has parameters or not

            if (hasItems(params)) {
                // Semantically check terms with parameters
                for (final Parameter p : params) {
                    Namespace ns = p.getNamespace();
                    if (ns == null) {
                        continue;
                    }
                    try {
                        semantics.checkParameterizedTerm(term);
View Full Code Here

                    .getNamespace().getResourceLocation(),
                    equivalenceEntry.getKey(),
                    sourceParameter.getValue());

            if (equivalentValue != null) {
                equivalentParameters.add(new Parameter(new Namespace("",
                        equivalenceEntry.getKey()), equivalentValue));
            }
        }
        return equivalentParameters;
    }
View Full Code Here

            final String equivalentValue = doFindEquivalence(
                    equivalenceEntry.getKey(),
                    sourceUUID);

            if (equivalentValue != null) {
                equivalentParameters.add(new Parameter(new Namespace("",
                        equivalenceEntry.getKey()), equivalentValue));
            }
        }
        return equivalentParameters;
    }
View Full Code Here

         * {@inheritDoc}
         */
        @Override
        public EquivalentParameter convert(Parameter src) {
            SkinnyUUID bucket = null;
            Namespace ns = src.getNamespace();
            String val = src.getValue();
            if (ns != null) {
                String rl = ns.getResourceLocation();
                EquivalenceLookup el = lookup.forResourceLocation(rl);
                if (el != null) {
                    bucket = el.lookup(val);
                }
            }
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.