Package com.complexible.stardog.api.reasoning

# Interface SchemaManager

All Known Implementing Classes:
  `DefaultSchemaManager`

public interface SchemaManager
Convenience class to manage reasoning schemas for a database. Named graphs for the default schema are defined by the `ReasoningOptions.SCHEMA_GRAPHS` option whereas the named graphs for named schemas are defined by the `ReasoningOptions.SCHEMAS` option. Instead of dealing with these configuration options directly this class can be used to add, update or remove schemas.

Author:
  Evren Sirin

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Set<IRI>`
  `getSchemaGraphs(String theSchema)`
  Returns the named graphs associated with the given schema.
  `Set<String>`
  `getSchemas()`
  Returns the names of schemas defined for the database.
  `void`
  `removeSchema(String theSchema)`
  Removes the given schema from the database.
  `void`
  `setSchemaGraphs(String theSchema, Set<IRI> theSchemaGraphs)`
  Associates a schema with a set of named graphs.

- ## Method Details

  - ### getSchemas

    Set<String> getSchemas()
    Returns the names of schemas defined for the database. The returned set will always contain the `default schema`.
    Returns:
      unmodifiable set of schema names

  - ### getSchemaGraphs

    Set<IRI> getSchemaGraphs(String theSchema)
    Returns the named graphs associated with the given schema.
    Parameters:
      `theSchema` - schema name
    Returns:
      unmodifiable set of named graphs

  - ### removeSchema

    void removeSchema(String theSchema)
    Removes the given schema from the database. The `default schema` cannot be removed but calling this function will cause it to be associated with an empty set of named graphs so the default schema will become empty. If the schema does not exist no error will be raised.
    Parameters:
      `theSchema` - scheme name

  - ### setSchemaGraphs

    void setSchemaGraphs(String theSchema, Set<IRI> theSchemaGraphs)
    Associates a schema with a set of named graphs. If the set is empty then the schema will be removed except for the default schema that will always exist even with empty set of named graph association. If the schema already existed associated graphs will be replaced with the given graphs. New schemas will be added with the given graphs.
    Parameters:
      `theSchema` - schema name
      `theSchemaGraphs` - set of named graphs