/** * @return for IRI values, the IRI, else an empty Optional */ default Optional<IRI> iriValue() { return annotationValue().asIRI(); }
/** * @return for IRI values, the IRI, else an empty Optional */ default Optional<IRI> iriValue() { return annotationValue().asIRI(); }
/** * @return for IRI values, the IRI, else an empty Optional */ default Optional<IRI> iriValue() { return annotationValue().asIRI(); }
protected static boolean handleIAO227(boolean isMerged, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { return Obo2OWLConstants.IRI_IAO_0000227.equals(asIRI.get()); } unrelatedAxioms.add(axiom); return isMerged; }
protected static boolean handleIAO227(boolean isMerged, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { return Obo2OWLConstants.IRI_IAO_0000227.equals(asIRI.get()); } unrelatedAxioms.add(axiom); return isMerged; }
protected static boolean handleIAO227(boolean isMerged, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { return Obo2OWLConstants.IRI_IAO_0000227.equals(asIRI.get()); } unrelatedAxioms.add(axiom); return isMerged; }
protected static boolean handleIAO227(boolean isMerged, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { return Obo2OWLConstants.IRI_IAO_0000227.equals(asIRI.get()); } unrelatedAxioms.add(axiom); return isMerged; }
@Nullable protected static String handleIAO10001(@Nullable String replacedBy, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<OWLLiteral> asLiteral = value.asLiteral(); if (asLiteral.isPresent()) { return asLiteral.get().getLiteral(); } // fallback: also check for an IRI Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { // translate IRI to OBO style ID return getIdentifier(asIRI.get()); } unrelatedAxioms.add(axiom); return replacedBy; }
public static String getValueAsLiteralOrURI(OWLAnnotationValue v){ try{ return v.asIRI().get().getIRIString(); }catch(Exception e){ //instead of a resource, it was added as a String return v.asLiteral().get().getLiteral(); } }
@Nullable protected static String handleIAO10001(@Nullable String replacedBy, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<OWLLiteral> asLiteral = value.asLiteral(); if (asLiteral.isPresent()) { return asLiteral.get().getLiteral(); } // fallback: also check for an IRI Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { // translate IRI to OBO style ID return getIdentifier(asIRI.get()); } unrelatedAxioms.add(axiom); return replacedBy; }
@Nullable protected static String handleIAO10001(@Nullable String replacedBy, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<OWLLiteral> asLiteral = value.asLiteral(); if (asLiteral.isPresent()) { return asLiteral.get().getLiteral(); } // fallback: also check for an IRI Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { // translate IRI to OBO style ID return getIdentifier(asIRI.get()); } unrelatedAxioms.add(axiom); return replacedBy; }
@Nullable protected static String handleIAO10001(@Nullable String replacedBy, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<OWLLiteral> asLiteral = value.asLiteral(); if (asLiteral.isPresent()) { return asLiteral.get().getLiteral(); } // fallback: also check for an IRI Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { // translate IRI to OBO style ID return getIdentifier(asIRI.get()); } unrelatedAxioms.add(axiom); return replacedBy; }
private Constant getValue(OWLAnnotationValue value) throws TranslationException { try { if (value instanceof IRI) { return termFactory.getConstantIRI(rdfFactory.createIRI(value.asIRI().get().toString())); } else if (value instanceof OWLLiteral) { return getValueOfLiteral(value.asLiteral().get()); } else throw new OWLAPITranslatorOWL2QL.TranslationException("Found anonymous individual, this feature is not supported:" + value); } catch (OWLRuntimeException ore) { throw new OWLAPITranslatorOWL2QL.TranslationException(ore.getMessage()); } }
com.google.common.base.Optional<IRI> valueIRI = ax.getValue().asIRI(); if (valueIRI.isPresent()) { if (valueIRI.get().equals(owlEntity.getIRI())) {
com.google.common.base.Optional<IRI> valueIRI = ax.getValue().asIRI(); if (valueIRI.isPresent()) { if (valueIRI.get().equals(owlEntity.getIRI())) {
ontology.annotations().forEach(a -> a.getValue().asIRI().ifPresent(iri -> { if (ontologyIRIs.contains(iri)) { candidateIRIs.remove(iri);
ontology.annotations().forEach(a -> a.getValue().asIRI().ifPresent(iri -> { if (ontologyIRIs.contains(iri)) { candidateIRIs.remove(iri);
ontology.annotations().forEach(a -> a.getValue().asIRI().ifPresent(iri -> { if (ontologyIRIs.contains(iri)) { candidateIRIs.remove(iri);
ontology.annotations().forEach(a -> a.getValue().asIRI().ifPresent(iri -> { if (ontologyIRIs.contains(iri)) { candidateIRIs.remove(iri);
.equals(IRI.create("http://purl.obolibrary.org/obo/IAO_0100001"))) { OWLAnnotationValue val = aaa.getValue(); IRI valIRI = val.asIRI().orNull(); if (valIRI != null) { logger.info("Using URI replacement: " + valIRI);