/// <summary>
 /// Checks if the given childproperty can be set subpropertyof the given motherproperty
 /// </summary>
 internal static Boolean CheckSubPropertyOfCompatibility(RDFOntologyPropertyModel propertyModel,
                                                         RDFOntologyDatatypeProperty childProperty,
                                                         RDFOntologyDatatypeProperty motherProperty)
 {
     return(!propertyModel.CheckIsSubPropertyOf(motherProperty, childProperty) &&
            !propertyModel.CheckIsEquivalentPropertyOf(motherProperty, childProperty));
 }
 /// <summary>
 /// Checks if the given aproperty can be set equivalentpropertyof the given bproperty
 /// </summary>
 internal static Boolean CheckEquivalentPropertyCompatibility(RDFOntologyPropertyModel propertyModel,
                                                              RDFOntologyDatatypeProperty aProperty,
                                                              RDFOntologyDatatypeProperty bProperty)
 {
     return(!propertyModel.CheckIsSubPropertyOf(aProperty, bProperty) &&
            !propertyModel.CheckIsSuperPropertyOf(aProperty, bProperty));
 }
Beispiel #3
0
 /// <summary>
 /// Removes the "ontologyFact -> datatypeProperty -> ontologyLiteral" relation from the data
 /// </summary>
 public RDFOntologyData RemoveAssertionRelation(RDFOntologyFact ontologyFact,
                                                RDFOntologyDatatypeProperty datatypeProperty,
                                                RDFOntologyLiteral ontologyLiteral)
 {
     if (ontologyFact != null && datatypeProperty != null && ontologyLiteral != null)
     {
         this.Relations.Assertions.RemoveEntry(new RDFOntologyTaxonomyEntry(ontologyFact, datatypeProperty, ontologyLiteral));
     }
     return(this);
 }
Beispiel #4
0
 /// <summary>
 /// Adds the "ontologyFact -> datatypeProperty -> ontologyLiteral" relation to the data
 /// </summary>
 public RDFOntologyData AddAssertionRelation(RDFOntologyFact ontologyFact,
                                             RDFOntologyDatatypeProperty datatypeProperty,
                                             RDFOntologyLiteral ontologyLiteral)
 {
     if (ontologyFact != null && datatypeProperty != null && ontologyLiteral != null)
     {
         //Enforce preliminary check on usage of BASE properties
         if (!RDFOntologyChecker.CheckReservedProperty(datatypeProperty))
         {
             this.Relations.Assertions.AddEntry(new RDFOntologyTaxonomyEntry(ontologyFact, datatypeProperty, ontologyLiteral));
             this.AddLiteral(ontologyLiteral);
         }
         else
         {
             //Raise warning event to inform the user: Assertion relation cannot be added to the data because usage of BASE reserved properties compromises the taxonomy consistency
             RDFSemanticsEvents.RaiseSemanticsWarning(String.Format("Assertion relation between fact '{0}' and literal '{1}' cannot be added to the data because usage of BASE reserved properties compromises the taxonomy consistency.", ontologyFact, ontologyLiteral));
         }
     }
     return(this);
 }