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));
  }
private void addSKOSDataProperties(final OWLNamedIndividual concept,
      final Stream<OWLAnnotation> annos) {
   
    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) {
         
          axioms.add(factory.getOWLAnnotationAssertionAxiom(concept.getIRI(), anno));
        }
      }
    });
   
    if (!inSchemeAdded.get()) {
      axioms.add(factory.
          getOWLObjectPropertyAssertionAxiom(inSchemeProperty, concept, skosConceptScheme));
    }
   
   
    final String frag = concept.getIRI().getFragment();
    final String oboId = UNDERSCORE.matcher(frag).replaceFirst(":");
    axioms.add(factory.getOWLDataPropertyAssertionAxiom(
        factory.getOWLDataProperty(SKOSVocabulary.NOTE), concept, oboId));
  }
private void addskosdataproperties(final owlnamedindividual concept, final stream<owlannotation> annos) { 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) { axioms.add(factory.getowlannotationassertionaxiom(concept.getiri(), anno)); } } }); if (!inschemeadded.get()) { axioms.add(factory. getowlobjectpropertyassertionaxiom(inschemeproperty, concept, skosconceptscheme)); } final string frag = concept.getiri().getfragment(); final string oboid = underscore.matcher(frag).replacefirst(":"); axioms.add(factory.getowldatapropertyassertionaxiom( factory.getowldataproperty(skosvocabulary.note), concept, oboid)); }