Пример #1
0
 /// <summary>
 /// Adds the given literal as alternative label annotation of the given concept within the conceptScheme
 /// </summary>
 public static RDFSKOSConceptScheme AddAltLabelAnnotation(this RDFSKOSConceptScheme conceptScheme,
                                                          RDFSKOSConcept concept,
                                                          RDFOntologyLiteral altLabelLiteral)
 {
     if (conceptScheme != null && concept != null && altLabelLiteral != null)
     {
         //Only plain literals are allowed as skos:altLabel annotations
         if (altLabelLiteral.Value is RDFPlainLiteral)
         {
             if (RDFSKOSChecker.CheckAltLabel(conceptScheme, concept, altLabelLiteral))
             {
                 //Add altLabel annotation
                 conceptScheme.Annotations.AltLabel.AddEntry(new RDFOntologyTaxonomyEntry(concept, RDFVocabulary.SKOS.ALT_LABEL.ToRDFOntologyAnnotationProperty(), altLabelLiteral));
             }
         }
     }
     return(conceptScheme);
 }
Пример #2
0
        /// <summary>
        /// Adds the given label as alternative label of the given concept within the conceptScheme
        /// </summary>
        public static RDFSKOSConceptScheme AddAltLabelRelation(this RDFSKOSConceptScheme conceptScheme,
                                                               RDFSKOSConcept concept,
                                                               RDFSKOSLabel label,
                                                               RDFOntologyLiteral altLabelLiteral)
        {
            if (conceptScheme != null && concept != null && label != null && altLabelLiteral != null)
            {
                //Only plain literals are allowed as skosxl:altLabel assertions
                if (altLabelLiteral.Value is RDFPlainLiteral)
                {
                    if (RDFSKOSChecker.CheckAltLabel(conceptScheme, concept, altLabelLiteral))
                    {
                        //Add altLabel relation
                        conceptScheme.Relations.AltLabel.AddEntry(new RDFOntologyTaxonomyEntry(concept, RDFVocabulary.SKOS.SKOSXL.ALT_LABEL.ToRDFOntologyObjectProperty(), label));

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