// ensure inScheme is set. we need it, so set to default if missing
private void addSKOSDataProperties(final OWLNamedIndividual concept,
      final Stream<OWLAnnotation> annos) {
    // Need a method in the OWL API to get Annotation by URI...
    final Map<IRI, OWLDataProperty> annoMap = mapper.getAnnotationMap();
    final AtomicBoolean inSchemeAdded = new AtomicBoolean(false);
    annos.forEach(anno -> {
      final OWLDataProperty prop = annoMap.get(anno.getProperty().getIRI());
      if (prop != null && anno.getValue().asLiteral().isPresent()) {
        final String literal = anno.getValue().asLiteral().get().getLiteral();
        final OWLAxiom ax = factory
            .getOWLDataPropertyAssertionAxiom(prop, concept, factory.getOWLLiteral(literal, "en"));
        axioms.add(ax);
      } else {
        if (Obo2OWLVocabulary.IRI_OIO_hasOboNamespace.sameIRI(anno.getProperty())) {
          final OWLIndividual scheme = anno.getValue().asLiteral().map(OWLLiteral::getLiteral)
              .map(this::getSkosScheme).orElse(skosConceptScheme);
          axioms.add(factory.
              getOWLObjectPropertyAssertionAxiom(inSchemeProperty, concept, scheme));
          inSchemeAdded.set(true);
        } else if (includeUnmappedProperties) {
          // for all other annotation axioms, just add them as they are
          axioms.add(factory.getOWLAnnotationAssertionAxiom(concept.getIRI(), anno));
        }
      }
    });
    // ensure inScheme is set. we need it, so set to default if missing
    if (!inSchemeAdded.get()) {
      axioms.add(factory.
          getOWLObjectPropertyAssertionAxiom(inSchemeProperty, concept, skosConceptScheme));
    }
    // This is an after thought, whole script needs re-writing if i were to do this properly anyway
    // want to use SKOS note to keep the original OBO identifier.
    final String frag = concept.getIRI().getFragment();
    final String oboId = UNDERSCORE.matcher(frag).replaceFirst(":");
    axioms.add(factory.getOWLDataPropertyAssertionAxiom(
        factory.getOWLDataProperty(SKOSVocabulary.NOTE), concept, oboId));
  }
}
});
// ensure inScheme is set. we need it, so set to default if missing
if (!inSchemeAdded.get()) {
axioms.add(factory.
.map(this::getSkosScheme).orElse(skosConceptScheme);
axioms.add(factory.
getOWLObjectPropertyAssertionAxiom(inSchemeProperty, concept, scheme));
inSchemeAdded.set(true);
} else if (includeUnmappedProperties) {
// for all other annotation axioms, just add them as they are
axioms.add(factory.getOWLAnnotationAssertionAxiom(concept.getIRI(), anno));
}
}
});
// ensure inScheme is set. we need it, so set to default if missing
if (!inSchemeAdded.get()) {
axioms.add(factory.
getOWLObjectPropertyAssertionAxiom(inSchemeProperty, concept, skosConceptScheme));
}
// This is an after thought, whole script needs re-writing if i were to do this properly anyway
// want to use SKOS note to keep the original OBO identifier.
final String frag = concept.getIRI().getFragment();
final String oboId = UNDERSCORE.matcher(frag).replaceFirst(":");
axioms.add(factory.getOWLDataPropertyAssertionAxiom(
factory.getOWLDataProperty(SKOSVocabulary.NOTE), concept, oboId));
annos.forEach(anno -> {
final OWLDataProperty prop = annoMap.get(anno.getProperty().getIRI());
if (prop != null && anno.getValue().asLiteral().isPresent()) {
final String literal = anno.getValue().asLiteral().get().getLiteral();
final OWLAxiom ax = factory
.getOWLDataPropertyAssertionAxiom(prop, concept, factory.getOWLLiteral(literal, "en"));
axioms.add(ax);
} else {
if (Obo2OWLVocabulary.IRI_OIO_hasOboNamespace.sameIRI(anno.getProperty())) {
final OWLIndividual scheme = anno.getValue().asLiteral().map(OWLLiteral::getLiteral)
.map(this::getSkosScheme).orElse(skosConceptScheme);
axioms.add(factory.
getOWLObjectPropertyAssertionAxiom(inSchemeProperty, concept, scheme));
inSchemeAdded.set(true);
} else if (includeUnmappedProperties) {
// for all other annotation axioms, just add them as they are
axioms.add(factory.getOWLAnnotationAssertionAxiom(concept.getIRI(), anno));
}
}
});
// ensure inScheme is set. we need it, so set to default if missing
if (!inSchemeAdded.get()) {
axioms.add(factory.
getOWLObjectPropertyAssertionAxiom(inSchemeProperty, concept, skosConceptScheme));
}
// This is an after thought, whole script needs re-writing if i were to do this properly anyway
// want to use SKOS note to keep the original OBO identifier.
final String frag = concept.getIRI().getFragment();
final String oboId = UNDERSCORE.matcher(frag).replaceFirst(":");
axioms.add(factory.getOWLDataPropertyAssertionAxiom(
factory.getOWLDataProperty(SKOSVocabulary.NOTE), concept, oboId));
}