/// <summary> /// Adds the given literal form of the given label within the conceptScheme /// </summary> public static RDFSKOSConceptScheme AddLiteralFormAssertion(this RDFSKOSConceptScheme conceptScheme, RDFSKOSLabel label, RDFOntologyLiteral literal) { if (conceptScheme != null && label != null && literal != null) { //Add literalForm relation conceptScheme.Relations.LiteralForm.AddEntry(new RDFOntologyTaxonomyEntry(label, RDFVocabulary.SKOS.SKOSXL.LITERAL_FORM.ToRDFOntologyDatatypeProperty(), literal)); } return(conceptScheme); }
/// <summary> /// Removes the given label from the scheme /// </summary> public RDFSKOSConceptScheme RemoveLabel(RDFSKOSLabel label) { if (label != null) { if (this.Labels.ContainsKey(label.PatternMemberID)) { this.Labels.Remove(label.PatternMemberID); } } return(this); }
/// <summary> /// Adds the given label to the scheme /// </summary> public RDFSKOSConceptScheme AddLabel(RDFSKOSLabel label) { if (label != null) { if (!this.Labels.ContainsKey(label.PatternMemberID)) { this.Labels.Add(label.PatternMemberID, label); } } return(this); }
/// <summary> /// Adds a 'skosxl:labelRelation' relation between the given labels within the conceptScheme /// </summary> public static RDFSKOSConceptScheme AddLabelRelation(this RDFSKOSConceptScheme conceptScheme, RDFSKOSLabel aLabel, RDFSKOSLabel bLabel) { if (conceptScheme != null && aLabel != null && bLabel != null && !aLabel.Equals(bLabel)) { //Add skosxl:labelRelation relation to the scheme conceptScheme.Relations.LabelRelation.AddEntry(new RDFOntologyTaxonomyEntry(aLabel, RDFVocabulary.SKOS.SKOSXL.LABEL_RELATION.ToRDFOntologyObjectProperty(), bLabel)); conceptScheme.Relations.LabelRelation.AddEntry(new RDFOntologyTaxonomyEntry(bLabel, RDFVocabulary.SKOS.SKOSXL.LABEL_RELATION.ToRDFOntologyObjectProperty(), aLabel) .SetInference(RDFSemanticsEnums.RDFOntologyInferenceType.API)); } 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); }