Class AnnotationAxiomGenerator

  • All Implemented Interfaces:
    IMappingTransformer<org.semanticweb.owlapi.model.OWLAxiom>

    public class AnnotationAxiomGenerator
    extends Object
    implements IMappingTransformer<org.semanticweb.owlapi.model.OWLAxiom>
    A class to generate OWL annotation assertion axioms from mappings.
    • Constructor Detail

      • AnnotationAxiomGenerator

        public AnnotationAxiomGenerator​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                        org.semanticweb.owlapi.model.IRI property,
                                        IMappingTransformer<String> texter)
        Creates a new instance. This generator will create an annotation assertion axiom for the subject of the mapping.
        Parameters:
        ontology - The ontology to generate axioms for.
        property - The property to create an annotation with.
        texter - A transformer that will format a mapping into the annotation value. For example, to create an annotation with mapping's subject label as value:
                         AnnotationAxiomGenerator g = new AnnotationAxiomGenerator(ontology, property,
                                 (mapping) -> mapping.getSubjectLabel());
                         
      • AnnotationAxiomGenerator

        public AnnotationAxiomGenerator​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                        org.semanticweb.owlapi.model.IRI property,
                                        IMappingTransformer<String> texter,
                                        boolean invert)
        Creates a new instance to annotate the object of a mapping rather than the subject.
        Parameters:
        ontology - The ontology to generate axioms for.
        property - The property to create an annotation with.
        texter - A transformer that will format a mapping into the annotation value.
        invert - If true, the object of the mapping will be annotated, rather than the subject.
    • Method Detail

      • transform

        public org.semanticweb.owlapi.model.OWLAxiom transform​(Mapping mapping)
        Description copied from interface: IMappingTransformer
        Transform a mapping into something else.
        Specified by:
        transform in interface IMappingTransformer<org.semanticweb.owlapi.model.OWLAxiom>
        Parameters:
        mapping - The mapping to transform.
        Returns:
        The object generated from the mapping.