Package com.complexible.stardog.api.reasoning

# Class DefaultSchemaManager

java.lang.Object
com.complexible.stardog.api.reasoning.DefaultSchemaManager

All Implemented Interfaces:
  `SchemaManager`

public class DefaultSchemaManager extends Object implements SchemaManager

Author:
  Evren Sirin

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultSchemaManager(AdminConnection theAdminConnection, String theDb)`
  `DefaultSchemaManager(Connection theConnection)`

- ## 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.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DefaultSchemaManager

    public DefaultSchemaManager(Connection theConnection)

  - ### DefaultSchemaManager

    public DefaultSchemaManager(AdminConnection theAdminConnection, String theDb)

- ## Method Details

  - ### getSchemas

    public Set<String> getSchemas()
    Description copied from interface: `SchemaManager`
    Returns the names of schemas defined for the database. The returned set will always contain the `default schema`.
    Specified by:
      `getSchemas` in interface `SchemaManager`
    Returns:
      unmodifiable set of schema names

  - ### getSchemaGraphs

    public Set<IRI> getSchemaGraphs(String theSchema)
    Description copied from interface: `SchemaManager`
    Returns the named graphs associated with the given schema.
    Specified by:
      `getSchemaGraphs` in interface `SchemaManager`
    Parameters:
      `theSchema` - schema name
    Returns:
      unmodifiable set of named graphs

  - ### removeSchema

    public void removeSchema(String theSchema)
    Description copied from interface: `SchemaManager`
    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.
    Specified by:
      `removeSchema` in interface `SchemaManager`
    Parameters:
      `theSchema` - scheme name

  - ### setSchemaGraphs

    public void setSchemaGraphs(String theSchema, Set<IRI> theSchemaGraphs)
    Description copied from interface: `SchemaManager`
    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.
    Specified by:
      `setSchemaGraphs` in interface `SchemaManager`
    Parameters:
      `theSchema` - schema name
      `theSchemaGraphs` - set of named graphs