public OWLAnnotationAssertionAxiom createOWLAnnotationAssertionAxiom(OWLAnnotationProperty ap, OWLAnnotationSubject as, OWLAnnotationValue value) { return owlDataFactory.getOWLAnnotationAssertionAxiom(ap, as, value); }
static OWLAxiom create(OWLDataFactory d, OWLIndividual s, OWLAnnotation o, Collection<OWLAnnotation> anns) { if (s.isAnonymous()) { return d.getOWLAnnotationAssertionAxiom(s.asOWLAnonymousIndividual(), o, anns); } else { return d.getOWLAnnotationAssertionAxiom(s.asOWLNamedIndividual().getIRI(), o, anns); } }
@Override protected OWLAxiom createAxiom() throws OWLXMLParserException { return getOWLDataFactory().getOWLAnnotationAssertionAxiom(property, subject, object, getAnnotations()); } }
@Override public OWLAnnotationAssertionAxiom buildObject() { return df.getOWLAnnotationAssertionAxiom(getProperty(), verifyNotNull(subject), verifyNotNull(value), annotations); }
@Override public OWLAnnotationAssertionAxiom buildObject() { return df.getOWLAnnotationAssertionAxiom(getProperty(), verifyNotNull(subject), verifyNotNull(value), annotations); }
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))); } })); }
public static OWLAnnotationAssertionAxiom comment(OWLEntity entity, String comment) { return factory.getOWLAnnotationAssertionAxiom( entity.getIRI(), factory.getOWLAnnotation( factory.getOWLAnnotationProperty( OWLRDFVocabulary.RDFS_COMMENT.getIRI() ), factory.getOWLLiteral( comment ) ) ); }
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 OWLAnnotationAssertionAxiom visit(OWLAnnotationAssertionAxiom ax) { return df.getOWLAnnotationAssertionAxiom(t(ax.getProperty()), t(ax.getSubject()), t(ax.getValue()), a(ax)); }
@Override public OWLAnnotationAssertionAxiom visit(OWLAnnotationAssertionAxiom axiom) { return df.getOWLAnnotationAssertionAxiom(get(axiom.getProperty()), get(axiom.getSubject()), get(axiom .getValue()), anns(axiom)); }
@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { OWLDataFactory df = getDataFactory(); OWLAnnotationProperty deprecatedProperty = df.getOWLDeprecated(); OWLLiteral annotationValue = df.getOWLLiteral(true); IRI subject = getIRIFromOBOId(currentId); OWLAnnotationAssertionAxiom ax = df .getOWLAnnotationAssertionAxiom(deprecatedProperty, subject, annotationValue); applyChange(new AddAxiom(getOntology(), ax)); } }
@Override public Object visit(OWLAnnotationAssertionAxiom axiom) { return visitAxiom(axiom, () -> df.getOWLAnnotationAssertionAxiom(t(axiom.getSubject()), t(axiom .getAnnotation()), t(axiom.annotations()))); }
protected void addAnnotation(String id, String uriID, OWLLiteral value) { IRI subject = getIRIFromOBOId(id); OWLAnnotationProperty annotationProperty = getDataFactory() .getOWLAnnotationProperty(getIRIFromOBOId(uriID)); OWLAxiom ax = getDataFactory() .getOWLAnnotationAssertionAxiom(annotationProperty, subject, value); applyChange(new AddAxiom(getOntology(), 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)); } }
private static void addVersion(OWLOntology ontology, String version, OWLOntologyManager manager){ OWLDataFactory fac = manager.getOWLDataFactory(); OWLAnnotationProperty ap = fac.getOWLAnnotationProperty( Obo2Owl.trTagToIRI(OboFormatTag.TAG_REMARK.getTag())); OWLAnnotation ann = fac.getOWLAnnotation(ap, fac.getOWLLiteral(version)); OWLAxiom ax = fac.getOWLAnnotationAssertionAxiom(ontology.getOntologyID().getOntologyIRI(), ann); manager.applyChange(new AddAxiom(ontology, ax)); } }
private void initialiseAnnotationPropertyFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLAnnotationProperty, OWLAnnotationProperty>(x -> parseAnnotationProperty(), SUB_PROPERTY_OF, (s, o, anns) -> df.getOWLSubAnnotationPropertyOfAxiom(s, o, anns)), annotationPropertyFrameSections); initialiseSection(new AnnAxiom<OWLAnnotationProperty, IRI>(x -> parseIRI(), DOMAIN, (s, o, anns) -> df.getOWLAnnotationPropertyDomainAxiom(s, o, anns)), annotationPropertyFrameSections); initialiseSection(new AnnAxiom<OWLAnnotationProperty, IRI>(x -> parseIRI(), RANGE, (s, o, anns) -> df.getOWLAnnotationPropertyRangeAxiom(s, o, anns)), annotationPropertyFrameSections); initialiseSection(new AnnAxiom<OWLAnnotationProperty, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> df.getOWLAnnotationAssertionAxiom(s.getIRI(), o, anns)), annotationPropertyFrameSections); //@formatter:on }
private void initialiseAnnotationPropertyFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLAnnotationProperty, OWLAnnotationProperty>(x -> parseAnnotationProperty(), SUB_PROPERTY_OF, (s, o, anns) -> df.getOWLSubAnnotationPropertyOfAxiom(s, o, anns)), annotationPropertyFrameSections); initialiseSection(new AnnAxiom<OWLAnnotationProperty, IRI>(x -> parseIRI(), DOMAIN, (s, o, anns) -> df.getOWLAnnotationPropertyDomainAxiom(s, o, anns)), annotationPropertyFrameSections); initialiseSection(new AnnAxiom<OWLAnnotationProperty, IRI>(x -> parseIRI(), RANGE, (s, o, anns) -> df.getOWLAnnotationPropertyRangeAxiom(s, o, anns)), annotationPropertyFrameSections); initialiseSection(new AnnAxiom<OWLAnnotationProperty, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> df.getOWLAnnotationAssertionAxiom(s.getIRI(), o, anns)), annotationPropertyFrameSections); //@formatter:on }
private void initialiseDataPropertyFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), SUB_PROPERTY_OF, (s, o, anns) -> df.getOWLSubDataPropertyOfAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), EQUIVALENT_TO, (s, o, anns) -> df.getOWLEquivalentDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), DISJOINT_WITH, (s, o, anns) -> df.getOWLDisjointDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLClassExpression>(x -> parseUnion(), DOMAIN, (s, o, anns) -> df.getOWLDataPropertyDomainAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataRange>(x -> parseDataRange(), RANGE, (s, o, anns) -> df.getOWLDataPropertyRangeAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyCharacteristicAxiom>(this::parseDataPropertyCharacteristic, CHARACTERISTICS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> df.getOWLAnnotationAssertionAxiom(s.getIRI(), o, anns)), dataPropertyFrameSections); //@formatter:on }
private void initialiseDataPropertyFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), SUB_PROPERTY_OF, (s, o, anns) -> df.getOWLSubDataPropertyOfAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), EQUIVALENT_TO, (s, o, anns) -> df.getOWLEquivalentDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), DISJOINT_WITH, (s, o, anns) -> df.getOWLDisjointDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLClassExpression>(x -> parseUnion(), DOMAIN, (s, o, anns) -> df.getOWLDataPropertyDomainAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataRange>(x -> parseDataRange(), RANGE, (s, o, anns) -> df.getOWLDataPropertyRangeAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyCharacteristicAxiom>(this::parseDataPropertyCharacteristic, CHARACTERISTICS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> df.getOWLAnnotationAssertionAxiom(s.getIRI(), o, anns)), dataPropertyFrameSections); //@formatter:on }