mergedServices.SPARQLQueryBuilder.completeQuery C# (CSharp) Method

completeQuery() private method

is thefunction that takes the Sparql Query from Direct and ConnectViamiddleObject functions and complete it it takes the part after where {.... , and completes it depending on the options
private completeQuery ( string coreQuery, Dictionary options, Dictionary vars ) : string
coreQuery string
options Dictionary Options parameters object1,object2,contains,ignoredObjects,ignoredProperties,avoidCycles
vars Dictionary Vars containing the all the variables in the predicates and the objects to be used in the filter function
return string
        private string completeQuery(string coreQuery, Dictionary<string, List<string>> options, Dictionary<string, List<string>> vars)
        {
            string completeQuery = "";
            //foreach (string key in prefixes.Keys)
            //{
            //    completeQuery += "PREFIX" + key + ": <" + prefixes[key] + ">\n";
            //}

            // TODO: we have to ask for an abstract, an imageURL and a link to wikipedia for each information too!

            completeQuery += "Select * WHERE {" + "\n";
            completeQuery += coreQuery + "\n";
            completeQuery += generateFilter(options, vars) + "\n";
            string limit = "";

            if (options.Keys.Contains("limit"))
            {
                limit = "LIMIT " + listToString(options["limit"]);
            }
            completeQuery += "}" + limit;
            completeQuery = completeQuery.Replace('\n', ' ');
            completeQuery = completeQuery.Replace("  ", " ");
            return completeQuery;
        }