示例#1
0
        public string toJSON(bool showAsObject = true)
        {
            string delimiter;
            string result = "";


            if (!showAsObject)
            {
                result = JSONUtils.JSONFriendly(this.text);
            }
            else
            {
                result  = "{";
                result += JSONUtils.toJSON("text", this.text);

                delimiter = "";
                result   += ",\"linkedConcepts\":[";
                foreach (clsConcept concept in this.concepts)
                {
                    result   += delimiter + concept.toJSON();
                    delimiter = ",";
                }
                result += "]";
                result += "}";
            }
            return(result);
        }
示例#2
0
        public string toJSON(bool showAsObject = true)
        {
            string result = "";

            if (!showAsObject)
            {
                result += JSONUtils.JSONFriendly(subjectConcept.firstPattern.toJSON(false) + " " + typeConcept.firstPattern.toJSON(false) + " " + objectConcept.firstPattern.toJSON(false));
            }
            else
            {
                result  = "{";
                result += JSONUtils.toJSON("relationShip", subjectConcept.firstPattern.toJSON(false) + " " + typeConcept.firstPattern.toJSON(false) + " " + objectConcept.firstPattern.toJSON(false));
                result += "}";
            }

            return(result);
        }