@Override @Nullable public OWLAnnotationProperty getOWLAnnotationProperty(String name) { if (annotationPropertyNames.contains(name)) { return df.getOWLAnnotationProperty(getIRI(name)); } return null; } }
private void translateAsAnnotationPropertyRange(IRI s, IRI p, IRI o) { OWLAnnotationProperty prop = df.getOWLAnnotationProperty(s); add(df.getOWLAnnotationPropertyRangeAxiom(prop, o, anns())); consume(s, p, o); }
final public OWLAnnotationProperty AnnotationPropertyIRI() throws ParseException { IRI iri; iri = IRI(); return dataFactory.getOWLAnnotationProperty(iri); }
@Nonnull @Override public Optional<OWLAxiom> visit(@Nonnull OWLAnnotationProperty property) { return strategy.getDeprecatedAnnotationPropertyParentIri() .map(parent -> dataFactory.getOWLSubAnnotationPropertyOfAxiom(property, dataFactory.getOWLAnnotationProperty(parent))); }
public Optional<OWLAnnotation> getAnnotation(OWLDataFactory dataFactory) { Optional<OWLAnnotationValue> annotationValue = annotationValueProvider.getAnnotationValue(dataFactory); return annotationValue.map(v -> { IRI iri = annotationPropertyIriProvider.get(); OWLAnnotationProperty property = dataFactory.getOWLAnnotationProperty(iri); return dataFactory.getOWLAnnotation(property, annotationValue.get()); } ); } }
private static Set<OWLAnnotationProperty> getProperties(OWLDataFactory factory, OboFormatTag... tags) { Set<OWLAnnotationProperty> set = new HashSet<>(); for (OboFormatTag tag : tags) { set.add(factory.getOWLAnnotationProperty(OWLAPIObo2Owl.trTagToIRI(tag.getTag()))); } return set; }
private OWLAnnotationProperty getOWLAnnotationProperty(String name) { OWLAnnotationProperty prop = owlEntityChecker.getOWLAnnotationProperty(name); if (prop == null && annotationPropertyNames.contains(name)) { prop = dataFactory.getOWLAnnotationProperty(getIRI(name)); } return prop; }
private static Map<OWLEntity, IRI> remap(Map<IRI, IRI> iriReplacementMap, OWLDataFactory df) { Map<OWLEntity, IRI> map = new HashMap<>(); iriReplacementMap.forEach((k, v) -> { map.put(df.getOWLClass(k), v); map.put(df.getOWLObjectProperty(k), v); map.put(df.getOWLDataProperty(k), v); map.put(df.getOWLNamedIndividual(k), v); map.put(df.getOWLDatatype(k), v); map.put(df.getOWLAnnotationProperty(k), v); }); return map; }
/** * Tr annotation prop. * * @param relId the rel id * @return the oWL annotation property */ protected OWLAnnotationProperty trAnnotationProp(String relId) { return fac.getOWLAnnotationProperty(oboIdToIRI(mapPropId(relId))); }
@Override public boolean containsAnnotationPropertyInSignature(IRI iri, Imports imports) { boolean result = imports.stream(this).anyMatch(o -> o.containsAnnotationPropertyInSignature(iri)); if (result) { return result; } return checkOntologyAnnotations(df.getOWLAnnotationProperty(iri)); }
private OWLAnnotation getSynonymTypeAnnotation(Matcher matcher) { OWLDataFactory df = getDataFactory(); String synonymType = matcher.group(SYNONYM_TYPE_GROUP); return df.getOWLAnnotation(df.getOWLAnnotationProperty(SYNONYM_TYPE_IRI), df.getOWLLiteral(synonymType)); } }
private OWLAnnotation getSynonymTypeAnnotation(Matcher matcher) { OWLDataFactory df = getDataFactory(); String synonymType = matcher.group(SYNONYM_TYPE_GROUP); return df.getOWLAnnotation(df.getOWLAnnotationProperty(SYNONYM_TYPE_IRI), df.getOWLLiteral(synonymType)); } }
protected void expandAssertions(OWLOntology o, OWLAnnotationProperty p) { OWLAnnotationProperty ap425 = df.getOWLAnnotationProperty(IRI_IAO_0000425.getIRI()); getAnnotationObjects(p, o.importsClosure(), ap425).map(a -> a.getValue().asLiteral()) .filter(v -> v.isPresent()) .forEach(v -> { String str = v.get().getLiteral(); LOG.info("assertion mapping {} to {}", p, str); expandAssertionToMap.put(p.getIRI(), str); }); }
public OWLAnnotationProperty getPreferredLabel() { final List<IRI> iris = OWLRendererPreferences.getInstance().getAnnotationIRIs(); IRI iri = iris.isEmpty() ? OWLRDFVocabulary.RDFS_LABEL.getIRI() : iris.get(0); return mngr.getOWLDataFactory().getOWLAnnotationProperty(iri); }
private OWLAnnotationProperty getOWLAnnotationProperty(String name) { OWLAnnotationProperty prop = checker.getOWLAnnotationProperty(name); if (prop == null && annotationPropertyNames.contains(name)) { prop = df.getOWLAnnotationProperty(getIRI(name)); } if (prop == null) { throw new ExceptionBuilder().withAnn().build(); } return prop; }
private void addDeprecationCode(List<OWLOntologyChange> changes) { profile.getDeprecationCode().ifPresent(deprecationCode -> { info.getDeprecationCode().ifPresent(selectedCode -> { OWLAnnotationAxiom ax = dataFactory.getOWLAnnotationAssertionAxiom( dataFactory.getOWLAnnotationProperty(deprecationCode.getPropertyIri()), info.getEntityToDeprecate().getIRI(), selectedCode ); changes.add(new AddAxiom(getHomeOntology(), ax)); }); }); }
private static void generateChanges(OWLOntologyManager ontologyManager, OWLOntology o, ShortFormProvider provider, IRI annotationIRI, @Nullable String lang) { OWLDataFactory df = ontologyManager.getOWLDataFactory(); OWLAnnotationProperty ap = df.getOWLAnnotationProperty(annotationIRI); new ImportsStructureEntitySorter(o).getObjects().forEach((ont, ent) -> ent.forEach(e -> { if (o.containsEntityInSignature(e)) { ont.add(df.getOWLAnnotationAssertionAxiom(ap, e.getIRI(), action(e, lang, provider, df))); } })); }
@Override public void handleTriple(IRI s, IRI p, IRI o) { if (!isAnon(s)) { OWLAnnotationProperty property = df.getOWLAnnotationProperty(s); add(df.getOWLDeclarationAxiom(property, anns())); consume(s, p, o); } addAp(s, true); } }
private List<? extends OWLOntologyChange> createLabel(OWLEntity owlEntity, String value) { LabelDescriptor descr = getLabelDescriptor(); IRI iri = descr.getIRI(); String lang = descr.getLanguage(); OWLDataFactory df = mngr.getOWLDataFactory(); OWLLiteral con = df.getOWLLiteral(value, lang); OWLAnnotationProperty prop = df.getOWLAnnotationProperty(iri); OWLAxiom ax = df.getOWLAnnotationAssertionAxiom(prop, owlEntity.getIRI(), con); return Collections.singletonList(new AddAxiom(mngr.getActiveOntology(), ax)); }
@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { HasIRI subject = getConsumer().getCurrentEntity(); OWLAnnotationProperty property = getDataFactory() .getOWLAnnotationProperty(OBOVocabulary.ALT_ID); IRI object = getIRIFromOBOId(value); OWLAnnotationAssertionAxiom ax = getDataFactory() .getOWLAnnotationAssertionAxiom(property, subject.getIRI(), object); applyChange(new AddAxiom(getOntology(), ax)); } }