Ejemplo n.º 1
0
 /// <summary>
 /// Adds a 'skos:narrowMatch' relation between the given concepts within the conceptScheme
 /// </summary>
 public static RDFSKOSConceptScheme AddNarrowMatchRelation(this RDFSKOSConceptScheme conceptScheme,
                                                           RDFSKOSConcept aConcept,
                                                           RDFSKOSConcept bConcept)
 {
     if (conceptScheme != null && aConcept != null && bConcept != null && !aConcept.Equals(bConcept))
     {
         if (RDFSKOSChecker.CheckNarrowerRelation(conceptScheme, aConcept, bConcept))
         {
             //Add skos:narrowMatch relation to the scheme
             conceptScheme.Relations.NarrowMatch.AddEntry(new RDFOntologyTaxonomyEntry(aConcept, RDFVocabulary.SKOS.NARROW_MATCH.ToRDFOntologyObjectProperty(), bConcept));
         }
     }
     return(conceptScheme);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds a 'skos:broaderTransitive' relation between the given concepts within the conceptScheme
 /// </summary>
 public static RDFSKOSConceptScheme AddBroaderTransitiveRelation(this RDFSKOSConceptScheme conceptScheme,
                                                                 RDFSKOSConcept aConcept,
                                                                 RDFSKOSConcept bConcept)
 {
     if (conceptScheme != null && aConcept != null && bConcept != null && !aConcept.Equals(bConcept))
     {
         if (RDFSKOSChecker.CheckBroaderRelation(conceptScheme, aConcept, bConcept))
         {
             //Add skos:broaderTransitive relation to the scheme
             conceptScheme.Relations.BroaderTransitive.AddEntry(new RDFOntologyTaxonomyEntry(aConcept, RDFVocabulary.SKOS.BROADER_TRANSITIVE.ToRDFOntologyObjectProperty(), bConcept));
         }
     }
     return(conceptScheme);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds a 'skos:related' relation between the given concepts within the conceptScheme
 /// </summary>
 public static RDFSKOSConceptScheme AddRelatedRelation(this RDFSKOSConceptScheme conceptScheme,
                                                       RDFSKOSConcept aConcept,
                                                       RDFSKOSConcept bConcept)
 {
     if (conceptScheme != null && aConcept != null && bConcept != null && !aConcept.Equals(bConcept))
     {
         if (RDFSKOSChecker.CheckRelatedRelation(conceptScheme, aConcept, bConcept))
         {
             //Add skos:related relations to the scheme
             conceptScheme.Relations.Related.AddEntry(new RDFOntologyTaxonomyEntry(aConcept, RDFVocabulary.SKOS.RELATED.ToRDFOntologyObjectProperty(), bConcept));
             conceptScheme.Relations.Related.AddEntry(new RDFOntologyTaxonomyEntry(bConcept, RDFVocabulary.SKOS.RELATED.ToRDFOntologyObjectProperty(), aConcept)
                                                      .SetInference(RDFSemanticsEnums.RDFOntologyInferenceType.API));
         }
     }
     return(conceptScheme);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Adds a 'skos:exactMatch' relation between the given concepts within the conceptScheme
 /// </summary>
 public static RDFSKOSConceptScheme AddExactMatchRelation(this RDFSKOSConceptScheme conceptScheme,
                                                          RDFSKOSConcept aConcept,
                                                          RDFSKOSConcept bConcept)
 {
     if (conceptScheme != null && aConcept != null && bConcept != null && !aConcept.Equals(bConcept))
     {
         if (RDFSKOSChecker.CheckCloseOrExactMatchRelation(conceptScheme, aConcept, bConcept))
         {
             //Add skos:exactMatch relation to the scheme
             conceptScheme.Relations.ExactMatch.AddEntry(new RDFOntologyTaxonomyEntry(aConcept, RDFVocabulary.SKOS.EXACT_MATCH.ToRDFOntologyObjectProperty(), bConcept));
             conceptScheme.Relations.ExactMatch.AddEntry(new RDFOntologyTaxonomyEntry(bConcept, RDFVocabulary.SKOS.EXACT_MATCH.ToRDFOntologyObjectProperty(), aConcept)
                                                         .SetInference(RDFSemanticsEnums.RDFOntologyInferenceType.API));
         }
     }
     return(conceptScheme);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Adds the "concept -> skos:hiddenLabel -> hiddenLabelLiteral" annotation to the concept scheme
 /// </summary>
 public static RDFSKOSConceptScheme AddHiddenLabelAnnotation(this RDFSKOSConceptScheme conceptScheme,
                                                             RDFSKOSConcept concept,
                                                             RDFOntologyLiteral hiddenLabelLiteral)
 {
     if (conceptScheme != null && concept != null && hiddenLabelLiteral != null)
     {
         //Only plain literals are allowed as skos:hiddenLabel annotations
         if (hiddenLabelLiteral.Value is RDFPlainLiteral)
         {
             if (RDFSKOSChecker.CheckHiddenLabel(conceptScheme, concept, hiddenLabelLiteral))
             {
                 //Add hiddenLabel annotation
                 conceptScheme.Annotations.HiddenLabel.AddEntry(new RDFOntologyTaxonomyEntry(concept, RDFVocabulary.SKOS.HIDDEN_LABEL.ToRDFOntologyAnnotationProperty(), hiddenLabelLiteral));
             }
         }
     }
     return(conceptScheme);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Adds the given literal as preferred label annotation of the given concept within the conceptScheme
 /// </summary>
 public static RDFSKOSConceptScheme AddPrefLabelAnnotation(this RDFSKOSConceptScheme conceptScheme,
                                                           RDFSKOSConcept concept,
                                                           RDFOntologyLiteral prefLabelLiteral)
 {
     if (conceptScheme != null && concept != null && prefLabelLiteral != null)
     {
         //Only plain literals are allowed as skos:prefLabel annotations
         if (prefLabelLiteral.Value is RDFPlainLiteral)
         {
             if (RDFSKOSChecker.CheckPrefLabel(conceptScheme, concept, prefLabelLiteral))
             {
                 //Add prefLabel annotation
                 conceptScheme.Annotations.PrefLabel.AddEntry(new RDFOntologyTaxonomyEntry(concept, RDFVocabulary.SKOS.PREF_LABEL.ToRDFOntologyAnnotationProperty(), prefLabelLiteral));
             }
         }
     }
     return(conceptScheme);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Adds the given label as hidden label of the given concept within the conceptScheme
        /// </summary>
        public static RDFSKOSConceptScheme AddHiddenLabelRelation(this RDFSKOSConceptScheme conceptScheme,
                                                                  RDFSKOSConcept concept,
                                                                  RDFSKOSLabel label,
                                                                  RDFOntologyLiteral hiddenLabelLiteral)
        {
            if (conceptScheme != null && concept != null && label != null && hiddenLabelLiteral != null)
            {
                //Only plain literals are allowed as skosxl:hiddenLabel assertions
                if (hiddenLabelLiteral.Value is RDFPlainLiteral)
                {
                    if (RDFSKOSChecker.CheckHiddenLabel(conceptScheme, concept, hiddenLabelLiteral))
                    {
                        //Add hiddenLabel relation
                        conceptScheme.Relations.HiddenLabel.AddEntry(new RDFOntologyTaxonomyEntry(concept, RDFVocabulary.SKOS.SKOSXL.HIDDEN_LABEL.ToRDFOntologyObjectProperty(), label));

                        //Add literalForm relation
                        conceptScheme.Relations.LiteralForm.AddEntry(new RDFOntologyTaxonomyEntry(label, RDFVocabulary.SKOS.SKOSXL.LITERAL_FORM.ToRDFOntologyDatatypeProperty(), hiddenLabelLiteral));
                    }
                }
            }
            return(conceptScheme);
        }