Example #1
0
        /// <summary>
        /// Builds a new difference taxonomy from this taxonomy and a given one
        /// </summary>
        internal RDFOntologyTaxonomy DifferenceWith(RDFOntologyTaxonomy taxonomy)
        {
            var result = new RDFOntologyTaxonomy(this.Category);

            if (taxonomy != null)
            {
                //Add difference entries
                foreach (var te in this)
                {
                    if (!taxonomy.ContainsEntry(te))
                    {
                        result.AddEntry(te);
                    }
                }
            }
            else
            {
                //Add entries from this taxonomy
                foreach (var te in this)
                {
                    result.AddEntry(te);
                }
            }
            return(result);
        }
Example #2
0
        /// <summary>
        /// Builds a new intersection taxonomy from this taxonomy and a given one
        /// </summary>
        internal RDFOntologyTaxonomy IntersectWith(RDFOntologyTaxonomy taxonomy)
        {
            var result = new RDFOntologyTaxonomy(this.Category);

            if (taxonomy != null)
            {
                //Add intersection triples
                foreach (var te in this)
                {
                    if (taxonomy.ContainsEntry(te))
                    {
                        result.AddEntry(te);
                    }
                }
            }
            return(result);
        }
Example #3
0
        /// <summary>
        /// Builds a new intersection taxonomy from this taxonomy and a given one
        /// </summary>
        internal RDFOntologyTaxonomy IntersectWith(RDFOntologyTaxonomy taxonomy)
        {
            RDFOntologyTaxonomy result = new RDFOntologyTaxonomy(this.Category, this.AcceptDuplicates);

            if (taxonomy != null)
            {
                //Add intersection triples
                foreach (RDFOntologyTaxonomyEntry te in this)
                {
                    if (taxonomy.ContainsEntry(te))
                    {
                        result.AddEntry(te);
                    }
                }
            }
            return(result);
        }