/** * Get a set of default annotation properties. Currenly includes only RDFS label. * * @return a set of annotation properties */ public static Set<OWLAnnotationProperty> getDefaultAnnotationProperties() { Set<OWLAnnotationProperty> annotationProperties = new HashSet<>(); annotationProperties.add(dataFactory.getRDFSLabel()); return annotationProperties; }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value), annotations)} * * @param value The annotation value. * @param annotations annotations * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(OWLAnnotationValue value, Stream<OWLAnnotation> annotations) { return getOWLAnnotation(getRDFSLabel(), value, annotations); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(OWLAnnotationValue value) { return getOWLAnnotation(getRDFSLabel(), value); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(OWLAnnotationValue value) { return getOWLAnnotation(getRDFSLabel(), value); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value), annotations)} * * @param value The annotation value. * @param annotations annotations * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(OWLAnnotationValue value, Stream<OWLAnnotation> annotations) { return getOWLAnnotation(getRDFSLabel(), value, annotations); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(OWLAnnotationValue value) { return getOWLAnnotation(getRDFSLabel(), value); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value), annotations)} * * @param value The annotation value. * @param annotations annotations * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(OWLAnnotationValue value, Stream<OWLAnnotation> annotations) { return getOWLAnnotation(getRDFSLabel(), value, annotations); }
@Nonnull public static OWLAnnotationPropertyData getRdfsLabelData() { return OWLAnnotationPropertyData.get( dataFactory.getRDFSLabel(), OWLRDFVocabulary.RDFS_LABEL.getPrefixedName(), ImmutableMap.of() ); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(String value) { return getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value)); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value), annotations)} * * @param value The annotation value. * @param annotations annotations * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(String value, Stream<OWLAnnotation> annotations) { return getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value), annotations); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(String value) { return getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value)); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value), annotations)} * * @param value The annotation value. * @param annotations annotations * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(String value, Stream<OWLAnnotation> annotations) { return getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value), annotations); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value), annotations)} * * @param value The annotation value. * @param annotations annotations * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(String value, Stream<OWLAnnotation> annotations) { return getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value), annotations); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(String value) { return getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value)); }
public static ShortFormProvider getDefaultShortFormProvider(OWLOntology ontology) { List<OWLAnnotationProperty> annotationProperties = Collections.singletonList(OWLManager.getOWLDataFactory().getRDFSLabel()); List<String> langs = getDefaultLanguages(); return getShortFormProvider(ontology, annotationProperties, langs); }
public static ShortFormProvider getDefaultShortFormProvider(OWLOntology ontology) { List<OWLAnnotationProperty> annotationProperties = Collections.singletonList(OWLManager.getOWLDataFactory().getRDFSLabel()); List<String> langs = getDefaultLanguages(); return getShortFormProvider(ontology, annotationProperties, langs); }
public OWLAxiom createLabelAnnotationAxiom(OWLEntity entity, String label, Optional<String> languageTag) { OWLLiteral value; if (languageTag.isPresent()) { value = owlDataFactory.getOWLLiteral(label, languageTag.get()); } else { value = owlDataFactory.getOWLLiteral(label); } OWLAnnotation labelAnno = owlDataFactory.getOWLAnnotation(owlDataFactory.getRDFSLabel(), value); return owlDataFactory.getOWLAnnotationAssertionAxiom(entity.getIRI(), labelAnno); }
public OWLAnnotation toAnnotation(OBOXRef xref) { OWLAnnotationProperty xrefAnnotationProperty = df.getOWLAnnotationProperty(getXRefPropertyIRI()); String oboId = xref.toOBOId(); Set<OWLAnnotation> descriptionAnnotations; if (xref.getDescription().isEmpty()) { descriptionAnnotations = Collections.emptySet(); } else { OWLAnnotation descriptionAnnotation = df.getOWLAnnotation(df.getRDFSLabel(), df.getOWLLiteral(xref.getDescription())); descriptionAnnotations = Collections.singleton(descriptionAnnotation); } return df.getOWLAnnotation(xrefAnnotationProperty, df.getOWLLiteral(oboId), descriptionAnnotations); }
private OWLAnnotationProperty trTagToAnnotationProp(String tag) { IRI iri = trTagToIRI(tag); OWLAnnotationProperty ap = fac.getOWLAnnotationProperty(iri); if (!apToDeclare.contains(ap)) { apToDeclare.add(ap); add(fac.getOWLDeclarationAxiom(ap)); Obo2OWLVocabulary vocab = Obo2OWLConstants.getVocabularyObj(tag); if(vocab != null){ add (fac.getOWLAnnotationAssertionAxiom(fac.getRDFSLabel(), iri, trLiteral( vocab.getLabel()) ) ); } } return ap; }
private Label getLabel (OWLClass c, OWLOntology ont) { Label classLabel = new Label(null, null); for (OWLAnnotation annotation : c.getAnnotations(ont, this.dataFactory.getRDFSLabel())) { if (annotation.getValue() instanceof OWLLiteral) { OWLLiteral val = (OWLLiteral) annotation.getValue(); classLabel.setText(val.getLiteral().replace("'", "\\'")); classLabel.setLang(val.getLang()); } } return classLabel; }