Package org.openbel.framework.ws.model

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


        }

        final NamespaceValue sourceNsValue = verifyNamespaceValue(request
                .getNamespaceValue());

        final Namespace targetNamespace = verifyNamespace(request
                .getTargetNamespace());

        try {
            final NamespaceValue equivalentNsValue = equivalencerService
                    .findNamespaceEquivalence(sourceNsValue, targetNamespace);
View Full Code Here


            // get all namespaces we know about
            namespaces =
                    new ArrayList<Namespace>(resourceIndex
                            .getNamespaceResources().size());
            for (ResourceLocation rl : resourceIndex.getNamespaceResources()) {
                Namespace ns = new Namespace();
                ns.setPrefix(""); // empty prefix, doesn't matter, just can't be null
                ns.setResourceLocation(rl.getResourceLocation());
                namespaces.add(ns);
            }
        } else {
            namespaces = request.getNamespaces();
        }

        List<Pattern> patterns =
                new ArrayList<Pattern>(request.getPatterns().size());
        for (String s : request.getPatterns()) {
            patterns.add(verifyPattern(s));
        }

        FindNamespaceValuesResponse response =
                OBJECT_FACTORY.createFindNamespaceValuesResponse();
        for (Namespace ns : namespaces) {
            ns = verifyNamespace(ns);
            try {
                // get namespace values
                List<String> vals = new ArrayList<String>();
                for (Pattern p : patterns) {
                    vals.addAll(
                            namespaceService.search(ns.getResourceLocation(), p));
                }

                // get equivalences
                List<NamespaceValue> values = new ArrayList<NamespaceValue>();
                for (String v : vals) {
View Full Code Here

        if (sourceNamespaceValue.getEquivalence() != null) {
            uuid = convert(sourceNamespaceValue.getEquivalence());
            equivalenceValue =
                    equivalencer.equivalence(uuid, convert(targetNamespace));
        } else {
            final Namespace sourceNs = sourceNamespaceValue.getNamespace();
            final org.openbel.framework.common.model.Namespace sns =
                    convert(sourceNs);
            final String sourceValue = sourceNamespaceValue.getValue();
            equivalenceValue = equivalencer.equivalence(
                    convert(sourceNs),
View Full Code Here

        SkinnyUUID uuid;
        if (sourceNamespaceValue.getEquivalence() != null) {
            uuid = convert(sourceNamespaceValue.getEquivalence());
            equivalenceMap = equivalencer.equivalence(uuid);
        } else {
            final Namespace sourceNs = sourceNamespaceValue.getNamespace();
            final String sourceValue = sourceNamespaceValue.getValue();
            final org.openbel.framework.common.model.Namespace sns =
                    convert(sourceNs);
            equivalenceMap = equivalencer.equivalence(sns, sourceValue);
            uuid = equivalencer.getUUID(sns, sourceValue);
View Full Code Here

                resourceLocation);
    }

    private Namespace convert(
            final org.openbel.framework.common.model.Namespace ns) {
        final Namespace wsNs = new Namespace();
        wsNs.setPrefix(ns.getPrefix());
        wsNs.setResourceLocation(ns.getResourceLocation());
        return wsNs;
    }
View Full Code Here

     */
    public static Namespace
            convert(KAMStoreDaoImpl.Namespace objNamespace,
                    final KamInfo kamInfo) {

        Namespace namespace = OBJECT_FACTORY.createNamespace();
        namespace.setId(KamStoreObjectRef.encode(kamInfo, objNamespace));
        namespace.setPrefix(objNamespace.getPrefix());
        namespace.setResourceLocation(objNamespace.getResourceLocation());

        return namespace;
    }
View Full Code Here

     * @param ns
     * @return
     */
    public static Namespace convert(
            final org.openbel.framework.common.model.Namespace ns) {
        Namespace ws = OBJECT_FACTORY.createNamespace();
        ws.setPrefix(ns.getPrefix());
        ws.setResourceLocation(ns.getResourceLocation());
        return ws;
    }
View Full Code Here

        // Get the Dialect (may be null)
        final Dialect dialect = getDialect(req.getDialect());
        final org.openbel.framework.api.Kam kam = getKam(
                handle, dialect);

        final Namespace ns = req.getNamespace();
        if (ns == null) {
            throw new RequestException("Namespace is missing");
        }

        final List<String> values = req.getValues();
View Full Code Here

    @Override
    public List<NamespaceDescriptor> getAllNamespaceDescriptors() {
        List<NamespaceDescriptor> l =
                new ArrayList<NamespaceDescriptor>(headers.size());
        for (Map.Entry<String, NamespaceHeader> entry : headers.entrySet()) {
            Namespace ns = new Namespace();
            ns.setPrefix(entry.getValue().getNamespaceBlock().getKeyword());
            ns.setResourceLocation(entry.getKey());
            NamespaceDescriptor nsd = OBJECT_FACTORY.createNamespaceDescriptor();
            nsd.setNamespace(ns);
            nsd.setName(entry.getValue().getNamespaceBlock().getNameString());
            l.add(nsd);
        }
View Full Code Here

        Map<String, String> nsmap = new HashMap<String, String>();

        // find namespaces in resource index
        List<NamespaceDescriptor> ns = nsrsvc.getAllNamespaceDescriptors();
        for (NamespaceDescriptor n : ns) {
            Namespace the_ns = n.getNamespace();
            nsmap.put(the_ns.getPrefix(), the_ns.getResourceLocation());
        }

        // then find namespaces identified by the KAM
        List<org.openbel.framework.api.internal.KAMStoreDaoImpl.Namespace> nsl =
                kAMStore.getNamespaces(kam);
View Full Code Here

TOP

Related Classes of org.openbel.framework.ws.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.