Concept details retrieval shouldn't always go back to server with AJAX to retrieve semantic types for insertion

Issue #103 resolved
Richard Bruskiewich created an issue

Refactor the following code such that the semantic_types.json is only read once into memory then reused (because it is static).

Note that we are now reading the array into memory for other purposes (i.e. semantic node coloring) so perhaps a consolidated solution is feasible merging functionality of the system at that point in the code base.

c.a. Line 1211 in gbk_discovery.js // Handle semtype mapping special case if( key === "semtype" ) {

                    // override previous work
                    keyTitle = "Semantic Type";

                    // define callback
                    var semTypeCodeMatch = function( data ) {
                        // search for semcode
                        var n = 0;
                        var semantic_type_length = data["subtypes"].length;
                        while( n < semantic_type_length ) {
                            if( data["subtypes"][n]["code"] === val ){
                                val = data["subtypes"][n]["name"];
                                break
                            } else {
                                n += 1;
                            }
                        }
                    }

                    // run local resource query
                    $.ajax({
                        url: semantic_type_url, // located as global in discovery.jade
                        dataType: 'json',
                        data: data,
                        success: semTypeCodeMatch,
                        async: false
                    });

Comments (1)

  1. Log in to comment