예제 #1
0
        /// <summary>
        /// Checks if the skos:narrower/skos:narrowerTransitive/skos:narrowMatch relation can be added to the given aConcept with the given bConcept
        /// </summary>
        internal static Boolean CheckNarrowerRelation(RDFSKOSConceptScheme conceptScheme,
                                                      RDFSKOSConcept aConcept,
                                                      RDFSKOSConcept bConcept)
        {
            var canAddNarrowerRel = false;

            //Avoid clash with hierarchical relations
            canAddNarrowerRel = !conceptScheme.CheckHasBroaderConcept(aConcept, bConcept);

            //Avoid clash with associative relations
            if (canAddNarrowerRel)
            {
                canAddNarrowerRel = !conceptScheme.CheckHasRelatedConcept(aConcept, bConcept);
            }

            //Avoid clash with mapping relations
            if (canAddNarrowerRel)
            {
                canAddNarrowerRel = (!conceptScheme.CheckHasBroadMatchConcept(aConcept, bConcept) &&
                                     !conceptScheme.CheckHasCloseMatchConcept(aConcept, bConcept) &&
                                     !conceptScheme.CheckHasExactMatchConcept(aConcept, bConcept) &&
                                     !conceptScheme.CheckHasRelatedMatchConcept(aConcept, bConcept));
            }

            return(canAddNarrowerRel);
        }
예제 #2
0
 /// <summary>
 /// Adds the given concept to the collection
 /// </summary>
 public RDFSKOSCollection AddConcept(RDFSKOSConcept concept)
 {
     if (concept != null)
     {
         if (!this.Concepts.ContainsKey(concept.PatternMemberID))
         {
             this.Concepts.Add(concept.PatternMemberID, concept);
         }
     }
     return(this);
 }
예제 #3
0
 /// <summary>
 /// Removes the given concept from the collection
 /// </summary>
 public RDFSKOSCollection RemoveConcept(RDFSKOSConcept concept)
 {
     if (concept != null)
     {
         if (this.Concepts.ContainsKey(concept.PatternMemberID))
         {
             this.Concepts.Remove(concept.PatternMemberID);
         }
     }
     return(this);
 }
예제 #4
0
 /// <summary>
 /// Adds the given concept to the collection
 /// </summary>
 public RDFSKOSOrderedCollection AddConcept(RDFSKOSConcept concept)
 {
     if (concept != null)
     {
         if (!this.Concepts.ContainsKey(concept.PatternMemberID))
         {
             this.Concepts.Add(concept.PatternMemberID, new Tuple <Int32, RDFSKOSConcept>(this.ConceptsSequentialCounter++, concept));
         }
     }
     return(this);
 }