/// <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); }
/// <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); }