/// <summary>
 /// Default-ctor to build an "owl:HasValue" ontology restriction with the given name on the given property and the given required value
 /// </summary>
 public RDFOntologyHasValueRestriction(RDFResource restrictionName, RDFOntologyProperty onProperty, RDFOntologyLiteral requiredValue): base(restrictionName, onProperty) {
     if (requiredValue     != null) {
         this.RequiredValue = requiredValue;
     }
     else {
         throw new RDFSemanticsException("Cannot create RDFOntologyHasValueRestriction because given \"requiredValue\" parameter is null.");
     }
 }
Пример #2
0
 /// <summary>
 /// Removes the "ontologyFact -> rdfs:label -> ontologyLiteral" annotation from the data
 /// </summary>
 public RDFOntologyData RemoveLabelAnnotation(RDFOntologyFact ontologyFact, RDFOntologyLiteral ontologyLiteral)
 {
     if (ontologyFact != null && ontologyLiteral != null)
     {
         this.Annotations.Label.RemoveEntry(new RDFOntologyTaxonomyEntry(ontologyFact, RDFBASEOntology.Instance.Model.PropertyModel.SelectProperty(RDFVocabulary.RDFS.LABEL.ToString()), ontologyLiteral));
     }
     return(this);
 }
Пример #3
0
 /// <summary>
 /// Removes the "ontology -> rdfs:comment -> ontologyLiteral" annotation from the ontology
 /// </summary>
 public RDFOntology RemoveCommentAnnotation(RDFOntologyLiteral ontologyLiteral)
 {
     if (ontologyLiteral != null)
     {
         this.Annotations.Comment.RemoveEntry(new RDFOntologyTaxonomyEntry(this, RDFBASEOntology.Instance.Model.PropertyModel.SelectProperty(RDFVocabulary.RDFS.COMMENT.ToString()), ontologyLiteral));
     }
     return(this);
 }
Пример #4
0
 /// <summary>
 /// Removes the "ontology -> owl:VersionInfo -> ontologyLiteral" annotation from the ontology
 /// </summary>
 public RDFOntology RemoveVersionInfoAnnotation(RDFOntologyLiteral ontologyLiteral)
 {
     if (ontologyLiteral != null)
     {
         this.Annotations.VersionInfo.RemoveEntry(new RDFOntologyTaxonomyEntry(this, RDFBASEOntology.Instance.Model.PropertyModel.SelectProperty(RDFVocabulary.OWL.VERSION_INFO.ToString()), ontologyLiteral));
     }
     return(this);
 }
Пример #5
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);
 }
Пример #6
0
 /// <summary>
 /// Adds the "ontologyFact -> rdfs:comment -> ontologyLiteral" annotation to the data
 /// </summary>
 public RDFOntologyData AddCommentAnnotation(RDFOntologyFact ontologyFact,
                                             RDFOntologyLiteral ontologyLiteral)
 {
     if (ontologyFact != null && ontologyLiteral != null)
     {
         this.Annotations.Comment.AddEntry(new RDFOntologyTaxonomyEntry(ontologyFact, RDFBASEOntology.Instance.Model.PropertyModel.SelectProperty(RDFVocabulary.RDFS.COMMENT.ToString()), ontologyLiteral));
         this.AddLiteral(ontologyLiteral);
     }
     return(this);
 }
Пример #7
0
 /// <summary>
 /// Adds the "ontologyFact -> owl:VersionInfo -> ontologyLiteral" annotation to the data
 /// </summary>
 public RDFOntologyData AddVersionInfoAnnotation(RDFOntologyFact ontologyFact,
                                                 RDFOntologyLiteral ontologyLiteral)
 {
     if (ontologyFact != null && ontologyLiteral != null)
     {
         this.Annotations.VersionInfo.AddEntry(new RDFOntologyTaxonomyEntry(ontologyFact, RDFBASEOntology.Instance.Model.PropertyModel.SelectProperty(RDFVocabulary.OWL.VERSION_INFO.ToString()), ontologyLiteral));
         this.AddLiteral(ontologyLiteral);
     }
     return(this);
 }
Пример #8
0
 /// <summary>
 /// Removes the given literal from the data
 /// </summary>
 public RDFOntologyData RemoveLiteral(RDFOntologyLiteral ontologyLiteral)
 {
     if (ontologyLiteral != null)
     {
         if (this.Literals.ContainsKey(ontologyLiteral.PatternMemberID))
         {
             this.Literals.Remove(ontologyLiteral.PatternMemberID);
         }
     }
     return(this);
 }
Пример #9
0
 /// <summary>
 /// Adds the given literal to the data
 /// </summary>
 public RDFOntologyData AddLiteral(RDFOntologyLiteral ontologyLiteral)
 {
     if (ontologyLiteral != null)
     {
         if (!this.Literals.ContainsKey(ontologyLiteral.PatternMemberID))
         {
             this.Literals.Add(ontologyLiteral.PatternMemberID, ontologyLiteral);
         }
     }
     return(this);
 }
Пример #10
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);
 }
Пример #11
0
 /// <summary>
 /// Default-ctor to build an "owl:HasValue" ontology restriction with the given name on the given property and the given required value
 /// </summary>
 public RDFOntologyHasValueRestriction(RDFResource restrictionName, RDFOntologyProperty onProperty, RDFOntologyLiteral requiredValue) : base(restrictionName, onProperty)
 {
     if (requiredValue != null)
     {
         this.RequiredValue = requiredValue;
     }
     else
     {
         throw new RDFSemanticsException("Cannot create RDFOntologyHasValueRestriction because given \"requiredValue\" parameter is null.");
     }
 }
Пример #12
0
 /// <summary>
 /// Adds the "ontology -> rdfs:label -> ontologyLiteral" annotation to the ontology
 /// </summary>
 public RDFOntology AddLabelAnnotation(RDFOntologyLiteral ontologyLiteral) {
     if (ontologyLiteral != null) {
         this.Annotations.Label.AddEntry(new RDFOntologyTaxonomyEntry(this, RDFOntologyVocabulary.AnnotationProperties.LABEL, ontologyLiteral));
     }
     return this;
 }
Пример #13
0
 /// <summary>
 /// Adds the "ontology -> rdfs:comment -> ontologyLiteral" annotation to the ontology
 /// </summary>
 public RDFOntology AddCommentAnnotation(RDFOntologyLiteral ontologyLiteral) {
     if (ontologyLiteral != null) {
         this.Annotations.Comment.AddEntry(new RDFOntologyTaxonomyEntry(this, RDFOntologyVocabulary.AnnotationProperties.COMMENT, ontologyLiteral));
     }
     return this;
 }
Пример #14
0
 /// <summary>
 /// Adds the "ontology -> owl:VersionInfo -> ontologyLiteral" annotation to the ontology
 /// </summary>
 public RDFOntology AddVersionInfoAnnotation(RDFOntologyLiteral ontologyLiteral) {
     if (ontologyLiteral != null) {
         this.Annotations.VersionInfo.AddEntry(new RDFOntologyTaxonomyEntry(this, RDFOntologyVocabulary.AnnotationProperties.VERSION_INFO, ontologyLiteral));
     }
     return this;
 }