Class SSSOMTAnnotateFunction

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

    public class SSSOMTAnnotateFunction
    extends Object
    implements ISSSOMTFunction<IMappingTransformer<org.semanticweb.owlapi.model.OWLAxiom>>, IMappingTransformer<org.semanticweb.owlapi.model.OWLAxiom>
    Represents the SSSOM/T-OWL generator function "annotate".

    That function creates a OWL annotation assertion axiom. It takes three arguments:

    • the name of the entity to annotate;
    • the name of the annotation property;
    • the annotation value.

    All three arguments can contain placeholders so that their value can be derived from the mapping the function is applied to. For example, to annotate the entity that is the object of the current mapping:

     annotate(%{object_id}, MY:PROPERTY, "annotation value");
     

    Additionally, the function can accept three parameters:

    • /type=T, where T is the type of the annotation value; it defaults to xsd:string; any valid OWL2 datatype can be specified, as well as the special value iri to indicate that the annotation value should be treated as a IRI;
    • /annots=A, where A is a list of SSSOM metadata fields to annotate the generated axiom with.
    • /annots_uris=B, where B dictates how metadata fields are rendered into annotation properties (allowed values: direct, standard_map; the default is direct).
    • Constructor Detail

      • SSSOMTAnnotateFunction

        public SSSOMTAnnotateFunction​(SSSOMTOwlApplication application)
        Creates a new instance.
        Parameters:
        application - The SSSOM/T-OWL application.
    • Method Detail

      • getSignature

        public String getSignature()
        Description copied from interface: ISSSOMTFunction
        Gets the expected signature of the function. It should be a string that represents how many arguments (excluding keyed arguments) the function is expecting, where a single S character represents an argument.

        Regular expression syntax may be used to represent arguments that are optional or represent other kinds of constraints about the arguments list.

        Examples:

        • SSS for a function that expects exactly 3 arguments;
        • S+ for a function that expects at least one argument, possibly more;
        • (SS)+ for a function that one or more pairs of arguments (e.g. 2, 4, 6, but not 3 or 5).
        Specified by:
        getSignature in interface ISSSOMTFunction<IMappingTransformer<org.semanticweb.owlapi.model.OWLAxiom>>
        Returns:
        The function signature.
      • call

        public IMappingTransformer<org.semanticweb.owlapi.model.OWLAxiom> call​(List<String> arguments,
                                                                               Map<String,​String> keyedArguments)
                                                                        throws SSSOMTransformError
        Description copied from interface: ISSSOMTFunction
        Executes the function.

        Before this method is called, the arguments list will have been checked against the signature and will be guaranteed to be correct (e.g. if the function declared to expects two arguments, it is guaranteed the arguments list will contains two items).

        Specified by:
        call in interface ISSSOMTFunction<IMappingTransformer<org.semanticweb.owlapi.model.OWLAxiom>>
        Parameters:
        arguments - The arguments to the function. May be empty, but not null.
        keyedArguments - The keyed arguments to the function. May be empty, but null.
        Returns:
        The result of executing the function.
        Throws:
        SSSOMTransformError - If any error occurred when executing the function (which may include the case where the number of arguments was correct but their contents was not).
      • 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.