Annotation Semantics

  • All Implemented Interfaces:

    @Target(allowedTargets = {AnnotationTarget.FIELD, AnnotationTarget.PROPERTY}) 
    public @interface Semantics
    
                        

    Defines semantic metadata for a property. This annotation allows attaching arbitrary key-value metadata to properties, which can be used for semantic processing such as proposition extraction, relationship mapping, and natural language generation.

    Common semantic properties include:

    • predicate: The natural language predicate for the relationship (e.g., "works at")

    • inverse: The inverse predicate for bidirectional reasoning (e.g., "employs")

    • aliases: Alternative phrasings that map to this relationship

    Kotlin example:

    data class Person(
        val name: String,
    
        @Semantics([
            With("predicate", "works at"),
            With("inverse", "employs"),
            With("aliases", "is employed by, works for")
        ])
        val worksAt: Company
    )

    Java example (class with field):

    public class Person {
        private String name;
    
        @Semantics({
            @With(key = "predicate", value = "works at"),
            @With(key = "inverse", value = "employs"),
            @With(key = "aliases", value = "is employed by, works for")
        })
        private Company worksAt;
    }

    Java example (interface with getter):

    public interface HasEmployment {
        @Semantics({
            @With(key = "predicate", value = "works at"),
            @With(key = "inverse", value = "employs")
        })
        Company getWorksAt();
    }

    The metadata is accessible via PropertyDefinition.metadata as a Map<String, String>.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Array<With> value
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail