Package org.openbel.framework.common.model

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


        // cache all namespaces of the kam by prefix
        Map<String, Namespace> kamNamespaces = new HashMap<String, Namespace>();
        Map<String, NamespaceDomain> domains =
                new HashMap<String, NamespaceDomain>();
        for (org.openbel.framework.api.internal.KAMStoreDaoImpl.Namespace ns : kAMStore.getNamespaces(kamInfo)) {
            Namespace cns = new Namespace(ns.getPrefix(),
                    ns.getResourceLocation());
            kamNamespaces.put(cns.getPrefix(), cns);
            NamespaceHeader hdr = namespaceResourceService.getHeader(cns
                    .getResourceLocation());
            domains.put(cns.getPrefix(), NamespaceDomain.forDomainString(hdr
                    .getNamespaceBlock().getDomainString()));
        }

        CustomDialect pd = new CustomDialect(kAMStore);
        pd.setKamNamespaces(kamNamespaces);
View Full Code Here


        writeObject(out, param.getValue());
    }

    static Parameter readParameter(ObjectInput in) throws IOException,
            ClassNotFoundException {
        Namespace ns = (Namespace) readObject(in);
        String value = (String) readObject(in);
        return new Parameter(ns, value);
    }
View Full Code Here

                    NS_VALUE9=(Token)match(input,NS_VALUE,FOLLOW_NS_VALUE_in_param527);
                    NS_VALUE9_tree = (Object)adaptor.create(NS_VALUE9);
                    adaptor.addChild(root_0, NS_VALUE9_tree);


                                Namespace ns = null;
                           
                                if(nsp != null) {
                                    String prefix = nsp.getText();
                                    prefix = prefix.substring(0, prefix.length() - 1);
                                    ns = new Namespace(prefix, "FIX_ME");
                                }
                           
                                retval.r = new Parameter();
                                retval.r.setValue(NS_VALUE9.getText());
                                retval.r.setNamespace(ns);
                           

                    }
                    break;
                case 2 :
                    // BELStatement.g:147:9: QUOTED_VALUE
                    {
                    QUOTED_VALUE10=(Token)match(input,QUOTED_VALUE,FOLLOW_QUOTED_VALUE_in_param541);
                    QUOTED_VALUE10_tree = (Object)adaptor.create(QUOTED_VALUE10);
                    adaptor.addChild(root_0, QUOTED_VALUE10_tree);


                                Namespace ns = null;
                               
                                if(nsp != null) {
                                    String prefix = nsp.getText();
                                    prefix = prefix.substring(0, prefix.length() - 1);
                                    ns = new Namespace(prefix, "FIX_ME");
                                }
                               
                                retval.r = new Parameter();
                                retval.r.setNamespace(ns);
View Full Code Here

            ResourceDownloadError {
        if (nulls(p, p.getValue())) {
            throw new InvalidArgument("p", p);
        }

        Namespace ns = p.getNamespace();
        if (ns == null) {
            return;
        }

        String resourceLocation = ns.getResourceLocation();
        if (resourceLocation == null) {
            throw new InvalidArgument("resourceLocation", resourceLocation);
        }

        // check and open namespace for this parameter, if it has one
View Full Code Here

        }

        final List<NamespaceSyntaxWarning> exceptions =
                new ArrayList<NamespaceSyntaxWarning>();
        for (Parameter p : s.getAllParameters()) {
            Namespace ns = p.getNamespace();
            if (ns == null) {
                continue;
            }

            try {
View Full Code Here

                }
            }
        }

        for (final Parameter p : d.getAllParameters()) {
            Namespace ns = p.getNamespace();
            if (ns == null) {
                continue;
            }

            try {
View Full Code Here

            IndexingFailure {
        if (nulls(p, p.getValue())) {
            throw new InvalidArgument("parameter is null");
        }

        Namespace ns = p.getNamespace();
        if (ns == null) {
            return null;
        }

        String resourceLocation = ns.getResourceLocation();
        if (resourceLocation == null) {
            throw new InvalidArgument("resourceLocation", resourceLocation);
        }

        // get opened namespace and lookup namespace parameter encoding
        JDBMNamespaceLookup il = openNamespaces.get(ns.getResourceLocation());
        if (il == null) {
            final String fmt = "Namespace '%s' is not open.";
            final String msg = String.format(fmt, resourceLocation);
            throw new IndexingFailure(resourceLocation, msg);
        }

        String encoding = il.lookup(p.getValue());

        if (encoding == null) {
            String rl = ns.getResourceLocation();
            String pref = ns.getPrefix();
            throw new NamespaceSyntaxWarning(rl, pref, p.getValue());
        }
        return encoding;
    }
View Full Code Here

    private void doVerify(Parameter p) throws NamespaceSyntaxWarning {
        if (p.getValue() == null) {
            throw new InvalidArgument("parameter value is null");
        }

        Namespace ns = p.getNamespace();

        String resourceLocation = ns.getResourceLocation();
        if (resourceLocation == null) {
            throw new InvalidArgument("resourceLocation", resourceLocation);
        }

        // get opened namespace and lookup namespace parameter encoding
        JDBMNamespaceLookup il = openNamespaces.get(ns.getResourceLocation());
        if (il == null) {
            throw new IllegalStateException("namespace index is not open.");
        }

        String encoding = il.lookup(p.getValue());
        if (encoding == null) {
            throw new NamespaceSyntaxWarning(ns.getResourceLocation(),
                    ns.getPrefix(),
                    p.getValue());
        }
    }
View Full Code Here

        //Test extracted symbols
        NamespaceTable namespaceTable = protoNetwork.getNamespaceTable();
        ParameterTable parameterTable = protoNetwork.getParameterTable();
        TermTable termTable = protoNetwork.getTermTable();
        Namespace hgncNs =
                new Namespace(
                        "HGNC",
                        "http://resource.belframework.org/belframework/1.0/ns/hgnc-approved-symbols.belns");

        //check eg default namespace and hgnc specified namespace
        assertEquals(3, namespaceTable.getNamespaces().size());
View Full Code Here

        // Test that SemanticServiceImpl#checkListUsage() does not fail
        // on proper uses of the LIST function type.  The examples here
        // are taken from docs/xbel/corpus/small_corpus.bel.

        final Namespace pfh =
                new Namespace(
                        "PFH",
                        "http://resource.belframework.org/"
                                +
                                "belframework/1.0/namespace/selventa-named-human-protein-families.belns");
        final Namespace hgnc =
                new Namespace(
                        "HGNC",
                        "http://resource.belframework.org/"
                                +
                                "belframework/1.0/namespace/hgnc-approved-symbols.belns");
        final Namespace nch =
                new Namespace(
                        "NCH",
                        "http://resource.belframework.org/"
                                +
                                "belframework/1.0/namespace/selventa-named-human-complexes.belns");
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.