org.semanticweb.owlapi.model.OWLAnnotationAxiom Java Examples

The following examples show how to use org.semanticweb.owlapi.model.OWLAnnotationAxiom. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractConverter.java    From OWL2VOWL with MIT License 6 votes vote down vote up
private void processAnnotationProperties(OWLOntology ontology, VowlData vowlData) {
	for (OWLAnnotationProperty owlAnnotationProperty : ontology.annotationPropertiesInSignature(Imports.INCLUDED)
			.collect(Collectors.toSet())) {
		for (OWLAnnotationAxiom owlAnnotationAxiom : ontology.axioms(owlAnnotationProperty, Imports.INCLUDED)
				.collect(Collectors.toSet())) {
			try {
				String subject = owlAnnotationProperty.getIRI().toString();
				String property = "http://visualdataweb.org/ontologies/gizmo-core#assertionDatatypeValue";
				OWLAnnotationPropertyRangeAxiom ra = (OWLAnnotationPropertyRangeAxiom) owlAnnotationAxiom;
				String value = ra.getRange().toString();
				vowlData.addBaseConstructorAnnotation(subject, property, value);
			} catch (Exception e) {
				// not interesting
			}
		}
	}
}
 
Example #2
Source File: NCBI2OWLTest.java    From owltools with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private void testExactSynonym(OWLOntology ontology) {
	IRI iri = IRI.create("http://www.geneontology.org/formats/oboInOwl#hasExactSynonym");
	OWLDataFactory df = ontology.getOWLOntologyManager().
		getOWLDataFactory();
	OWLAnnotationProperty property = df.getOWLAnnotationProperty(iri);
	assertTrue("Exact Synonym property in signature",
		ontology.containsAnnotationPropertyInSignature(iri));
	
	// Check axioms
	Set<OWLAnnotationAxiom> axioms = ontology.getAxioms(property, Imports.EXCLUDED);
	assertEquals("Count class axioms", 0, axioms.size());

	// Check annotations
	List<String> values = new ArrayList<String>();
	values.add("AnnotationAssertion(rdfs:label <http://www.geneontology.org/formats/oboInOwl#hasExactSynonym> \"has_exact_synonym\"^^xsd:string)");

	Set<OWLAnnotationAssertionAxiom> annotations = 
		ontology.getAnnotationAssertionAxioms(iri);
	assertEquals("Count annotations for Exact", 1, annotations.size());

	checkAnnotations(annotations, values);
}
 
Example #3
Source File: OwlConverter.java    From elk-reasoner with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("static-method")
public ElkAnnotationAxiom convert(OWLAnnotationAxiom owlAnnotationAxiom) {
	return owlAnnotationAxiom.accept(OWL_ANNOTATION_AXIOM_CONVERTER);
}