Example #1
0
        /// <summary>
        /// Builds a new intersection model from this model and a given one
        /// </summary>
        public RDFOntologyModel IntersectWith(RDFOntologyModel model)
        {
            var result = new RDFOntologyModel();

            if (model != null)
            {
                //Intersect the class models
                result.ClassModel = this.ClassModel.IntersectWith(model.ClassModel);

                //Intersect the property models
                result.PropertyModel = this.PropertyModel.IntersectWith(model.PropertyModel);
            }
            return(result);
        }
Example #2
0
        /// <summary>
        /// Builds a new union model from this model and a given one
        /// </summary>
        public RDFOntologyModel UnionWith(RDFOntologyModel model)
        {
            var result = new RDFOntologyModel();

            //Use this class model
            result.ClassModel = result.ClassModel.UnionWith(this.ClassModel);

            //Use this property model
            result.PropertyModel = result.PropertyModel.UnionWith(this.PropertyModel);

            //Manage the given model
            if (model != null)
            {
                //Union with the given class model
                result.ClassModel = result.ClassModel.UnionWith(model.ClassModel);

                //Union with the given property model
                result.PropertyModel = result.PropertyModel.UnionWith(model.PropertyModel);
            }
            return(result);
        }