Class AbstractMapping

    • Field Detail

      • mapper

        protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • AbstractMapping

        protected AbstractMapping()
        Default constructor.
      • AbstractMapping

        protected AbstractMapping​(XtdbOMRSRepositoryConnector xtdbConnector)
        Default constructor.
        Parameters:
        xtdbConnector - connectivity to XTDB
    • Method Detail

      • getKeyword

        public static String getKeyword​(String name)
        Construct a string representation of a keyword.
        Parameters:
        name - of the keyword
        Returns:
        String representation of the form ':name'
      • getKeyword

        public static String getKeyword​(String namespace,
                                        String name)
        Construct a string representation of a keyword.
        Parameters:
        namespace - of the keyword (optional)
        name - of the keyword
        Returns:
        String representation of the form ':namespace/name'
      • getEmbeddedSerializedForm

        protected static clojure.lang.IPersistentMap getEmbeddedSerializedForm​(XtdbOMRSRepositoryConnector xtdbConnector,
                                                                               String type,
                                                                               String property,
                                                                               Object value)
        Retrieve an embedded JSON-serialized form of a given object. This will prevent the object from being searchable, but provides an efficient means to store structured information.
        Parameters:
        xtdbConnector - connectivity to the repository
        type - name of the type into which the value is being serialized
        property - name of the property for which the value is being serialized
        value - to JSON-serialize
        Returns:
        IPersistentMap giving the embedded serialized form
      • getEmbeddedSerializedForm

        protected static clojure.lang.IPersistentMap getEmbeddedSerializedForm​(Object value)
                                                                        throws IOException
        Retrieve an embedded JSON-serialized form of a given object. This will prevent the object from being searchable, but provides an efficient means to store structured information.
        Parameters:
        value - to JSON-serialize
        Returns:
        IPersistentMap giving the embedded serialized form
        Throws:
        IOException - on any issue serializing the value
      • getDeserializedValue

        protected static <T> T getDeserializedValue​(XtdbOMRSRepositoryConnector xtdbConnector,
                                                    String type,
                                                    String property,
                                                    clojure.lang.IPersistentMap embedded,
                                                    com.fasterxml.jackson.databind.JavaType javaType)
        Retrieve the deserialized value given an embedded form. This will prevent the object from being searchable, but provides an efficient means to retrieve structured information.
        Type Parameters:
        T - type of value to deserialize
        Parameters:
        xtdbConnector - connectivity to the repository
        type - name of the type from which the value is being deserialized
        property - name of the property from which the value is being deserialized
        embedded - value to JSON-deserialize
        javaType - the type of value to deserialize
        Returns:
        the deserialized value
      • getDeserializedValue

        protected static <T> T getDeserializedValue​(clojure.lang.IPersistentMap embedded,
                                                    com.fasterxml.jackson.databind.JavaType javaType)
                                             throws IOException
        Retrieve the deserialized value given an embedded form. This will prevent the object from being searchable, but provides an efficient means to retrieve structured information.
        Type Parameters:
        T - type of value to deserialize
        Parameters:
        embedded - value to JSON-deserialize
        javaType - the type of value to deserialize
        Returns:
        the deserialized value
        Throws:
        IOException - on any error deserializing the value