Class GraphLibrary

    • Field Detail

      • A_GRAPH_LIBRARY_CAN_T_BE_ADDED_WITH_A_NULL_S_GRAPH_ID_S

        public static final String A_GRAPH_LIBRARY_CAN_T_BE_ADDED_WITH_A_NULL_S_GRAPH_ID_S
        See Also:
        Constant Field Values
    • Constructor Detail

      • GraphLibrary

        public GraphLibrary()
    • Method Detail

      • initialise

        public abstract void initialise​(String path)
      • add

        public void add​(String graphId,
                        Schema schema,
                        StoreProperties properties)
                 throws OverwritingException
        Add a new relationship between a graphId, Schema and StoreProperties.
        Parameters:
        graphId - The graphId to relate to.
        schema - The schema that relates to the graphId.
        properties - The StoreProperties that relate to the graphId.
        Throws:
        OverwritingException - If the graphId already has a related Schema and/or StoreProperties.
      • add

        public void add​(String graphId,
                        String schemaId,
                        Schema schema,
                        String propertiesId,
                        StoreProperties properties)
                 throws OverwritingException
        Add a new relationship between a graphId, Schema and StoreProperties.
        Parameters:
        graphId - The graphId to relate to.
        schemaId - the schema id
        schema - The schema that relates to the graphId.
        propertiesId - the properties id
        properties - The StoreProperties that relate to the graphId.
        Throws:
        OverwritingException - If the graphId already has a related Schema and/or StoreProperties.
      • addOrUpdate

        public void addOrUpdate​(String graphId,
                                Schema schema,
                                StoreProperties properties)
        Adds a new relationship between a graphId, Schema and StoreProperties. If there is already a relationship using the graphId, it will update it.
        Parameters:
        graphId - The graphId to relate to.
        schema - The schema that relates to the graphId.
        properties - The StoreProperties that relate to the graphId.
      • addOrUpdate

        public void addOrUpdate​(String graphId,
                                String schemaId,
                                Schema schema,
                                String propertiesId,
                                StoreProperties properties)
        Adds a new relationship between a graphId, Schema and StoreProperties. If there is already a relationship using the graphId, it will update it.
        Parameters:
        graphId - The graphId to relate to.
        schemaId - the schema id
        schema - The schema that relates to the graphId.
        propertiesId - the properties id
        properties - The StoreProperties that relate to the graphId.
      • getSchema

        public Schema getSchema​(String schemaId)
        Gets the Schema given the schemaId.
        Parameters:
        schemaId - The schemaId.
        Returns:
        The Schema related to the schemaId.
      • getProperties

        public StoreProperties getProperties​(String propertiesId)
        Gets the StoreProperties given the storePropertiesId.
        Parameters:
        propertiesId - The storePropertiesId
        Returns:
        The StoreProperties related to the storePropertiesId.
      • exists

        public boolean exists​(String graphId)
        Checks if the graphId with a relationship already exists.
        Parameters:
        graphId - The GraphId.
        Returns:
        True if a relationship exists.
      • addSchema

        public void addSchema​(String id,
                              Schema schema)
                       throws OverwritingException
        Adds a new relationship between a Schema and a schemaId.
        Parameters:
        id - the schema ID
        schema - the Schema.
        Throws:
        OverwritingException - If there is already a relationship.
      • addOrUpdateSchema

        public void addOrUpdateSchema​(String id,
                                      Schema schema)
        Adds a new relationship between a Schema and schemaId. If there is already an existing relationship, it will update it.
        Parameters:
        id - The schema id
        schema - The schema
      • addProperties

        public void addProperties​(String id,
                                  StoreProperties properties)
                           throws OverwritingException
        Adds a new relationship between a StoreProperties and a storePropertiesId.
        Parameters:
        id - the properties ID.
        properties - the StoreProperties.
        Throws:
        OverwritingException - If there is already a relationship.
      • addOrUpdateProperties

        public void addOrUpdateProperties​(String id,
                                          StoreProperties properties)
        Adds a new relationship between a StoreProperties and a storePropertiesId. If there is already an existing relationship, it will update it.
        Parameters:
        id - the properties ID.
        properties - the StoreProperties.