Package org.openbel.framework.common.protonetwork.model

Examples of org.openbel.framework.common.protonetwork.model.NamespaceTable$TableNamespace


        for (DocumentHeader dh : dt.getDocumentHeaders()) {
            // add new document header
            int did = protoNetwork1.getDocumentTable().addDocumentHeader(dh);

            // union namespaces
            NamespaceTable nt = protoNetwork2.getNamespaceTable();
            for (TableNamespace ns : nt.getNamespaces()) {
                protoNetwork1.getNamespaceTable().addNamespace(ns, did);
            }

            // union annotation definition values
            Map<Integer, Integer> adremap = new HashMap<Integer, Integer>();
View Full Code Here


        ProtoNetworkBuilder protoNetworkBuilder =
                new ProtoNetworkBuilder(document);
        ProtoNetwork protoNetwork = protoNetworkBuilder.buildProtoNetwork();

        //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());
        assertEquals(11, parameterTable.getTableParameters().size());

        assertEquals(9, termTable.getTermValues().size());
        assertTrue(parameterTable.getTableParameters().contains(
                new TableParameter(new TableNamespace(hgncNs), "AIFM1")));
View Full Code Here

        // Establish access to the relevant table objects
        final ParameterTable paramTbl = pn.getParameterTable();
        final TermTable termTbl = pn.getTermTable();
        final List<String> terms = termTbl.getTermValues();
        final NamespaceTable nsTbl = pn.getNamespaceTable();

        final int[][] indata = pn.getTermIndices();

        final Set<String> literalSet = constrainedHashSet(literals.length);
        for (final String s : literals) {
            literalSet.add(s);
        }

        // Search indata for elements of the term literal set
        for (int i = 0; i < indata.length; i++) {
            int tid = indata[i][TERM_INDEX];
            String string = terms.get(tid);
            if (!literalSet.contains(string)) {
                continue;
            }

            int pid = indata[i][PARAM_INDEX];
            final TableParameter tp = paramTbl.getTableParameter(pid);

            final String inval = tp.getValue();
            int nid = indata[i][NAMESPACE_INDEX];

            final TableNamespace tns = nsTbl.getTableNamespace(nid);
            String inrl = null;
            if (tns != null) inrl = tns.getResourceLocation();

            final TableEntry te = new TableEntry(inval, inrl);
            ret.add(te);
View Full Code Here

            final String msg = "Error loading documents";
            throw new DatabaseError(schema, msg, e);
        }

        // load namespaces
        NamespaceTable nt = p2pn.getNamespaceTable();
        Set<TableNamespace> nsl = nt.getNamespaces();
        Map<TableNamespace, Integer> nsi = nt.getNamespaceIndex();
        for (TableNamespace ns : nsl) {
            try {
                jkl.loadNamespace(nsi.get(ns), ns);
            } catch (SQLException e) {
                final String fmt = "Error loading namespace %s/%s";
                final String msg =
                        format(fmt, ns.getPrefix(), ns.getResourceLocation());
                throw new DatabaseError(schema, msg, e);
            }
        }

        // load annotation definitions
        try {
            jkl.loadAnnotationDefinitions(p2pn.getAnnotationDefinitionTable());
        } catch (SQLException e) {
            final String msg = "Error loading annotation definitions";
            throw new DatabaseError(schema, msg, e);
        }

        try {
            // load annotations
            jkl.loadAnnotationValues(p2pn.getAnnotationValueTable());
        } catch (SQLException e) {
            final String msg = "Error loading annotation values";
            throw new DatabaseError(schema, msg, e);
        }

        try {
            // load document to namespace map
            jkl.loadDocumentNamespaceMap(nt.getDocumentNamespaces());
        } catch (SQLException e) {
            final String msg = "Error loading document namespaces";
            throw new DatabaseError(schema, msg, e);
        }
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.protonetwork.model.NamespaceTable$TableNamespace

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.