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()); } ); } }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSComment(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:comment annotation with provided value */ default OWLAnnotation getRDFSComment(OWLAnnotationValue value) { return getOWLAnnotation(getRDFSComment(), value); }
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 OWLAnnotationAssertionAxiom convertToAnnotation(OWLNamedIndividual ind, OWLDataPropertyAssertionAxiom ax) { OWLDataProperty hasIRI = ax.getProperty().asOWLDataProperty(); OWLAnnotation anno = df .getOWLAnnotation(df.getOWLAnnotationProperty(hasIRI), ax.getObject()); return df.getOWLAnnotationAssertionAxiom(ind.getIRI(), anno); } }
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()); } ); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSComment(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:comment annotation with provided value */ default OWLAnnotation getRDFSComment(OWLAnnotationValue value) { return getOWLAnnotation(getRDFSComment(), value); }
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 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)); } }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value), annotations)} * * @param value The annotation value. * @param annotations annotations * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(OWLAnnotationValue value, Stream<OWLAnnotation> annotations) { return getOWLAnnotation(getRDFSLabel(), value, annotations); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSComment(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:comment annotation with provided value */ default OWLAnnotation getRDFSComment(String value) { return getOWLAnnotation(getRDFSComment(), getOWLLiteral(value)); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSComment(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:comment annotation with provided value */ default OWLAnnotation getRDFSComment(String value) { return getOWLAnnotation(getRDFSComment(), getOWLLiteral(value)); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSComment(), getOWLLiteral(value), annotations)} * * @param value The annotation value. * @param annotations annotations * @return an rdfs:comment annotation with provided value */ default OWLAnnotation getRDFSComment(String value, Stream<OWLAnnotation> annotations) { return getOWLAnnotation(getRDFSComment(), getOWLLiteral(value), annotations); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value))} * * @param value The annotation value. * @return an rdfs:label annotation with provided value */ default OWLAnnotation getRDFSLabel(String value) { return getOWLAnnotation(getRDFSLabel(), getOWLLiteral(value)); }
/** * Shorthand for * {@code getOWLAnnotation(getRDFSComment(), getOWLLiteral(value), annotations)} * * @param value The annotation value. * @param annotations annotations * @return an rdfs:comment annotation with provided value */ default OWLAnnotation getRDFSComment(String value, Stream<OWLAnnotation> annotations) { return getOWLAnnotation(getRDFSComment(), getOWLLiteral(value), annotations); }
@Override public Object read(OWLInputStream in) throws IOException { OWLAnnotationProperty property = (OWLAnnotationProperty) in.read(); OWLAnnotationValue value = (OWLAnnotationValue) in.read(); return in.getOWLDataFactory().getOWLAnnotation(property, value); }
@Override public OWLAnnotation visit(OWLAnnotation node) { return df.getOWLAnnotation(t(node.getProperty()), t(node.getValue()), node.annotations().map(this::t)); }
private OWLAnnotation generateLabelAnnotation(String label) { OWLDataFactory df = mngr.getOWLDataFactory(); OWLAnnotationProperty aProp = getPreferredLabel(); String lang = getPreferredLanguage(); OWLLiteral value = df.getOWLLiteral(label, lang); return df.getOWLAnnotation(aProp, value); }
public void visit(OWLAnnotation node) { node.getProperty().accept(this); OWLAnnotationProperty prop = (OWLAnnotationProperty) obj; node.getValue().accept(this); OWLAnnotationValue val = (OWLAnnotationValue) obj; obj = dataFactory.getOWLAnnotation(prop, val); }
public OWLAnnotation getAnnotation() { OWLAnnotationProperty property = annotationPropertySelector.getSelectedObject(); if (property != null){ lastSelectedProperty = property; OWLDataFactory dataFactory = owlEditorKit.getModelManager().getOWLDataFactory(); OWLAnnotationValue obj = getSelectedEditor().getEditedObject(); if (obj != null) { return dataFactory.getOWLAnnotation(property, obj); } } return null; }
@Override public Object visit(OWLAnnotation node) { return visit(node, () -> df.getOWLAnnotation(t(node.getProperty()), t(node.getValue()), t(node .annotations()))); }