Interface StoredQueries

  • All Superinterfaces:
    java.lang.Iterable<StoredQuery>

    public interface StoredQueries
    extends java.lang.Iterable<StoredQuery>
    A mutable collection of stored queries.
    Since:
    4.2
    Version:
    5.0.2
    Author:
    Evren Sirin, Michael Grove
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(StoredQuery query)
      Stores the given query.
      void clear()
      Removes all the stored queries.
      StoredQuery get​(java.lang.String name)
      Returns the stored query with the given name.
      java.util.Iterator<StoredQuery> iterator()
      Returns an iterator of all stored queries.
      java.lang.Iterable<StoredQuery> list​(java.util.Optional<java.lang.String> db)
      Lists all stored queries and if provided filter the stored queries for the given database name or the regular expression.
      void remove​(java.lang.String name)
      Removes the stored query with the given name.
      void rename​(java.lang.String oldName, java.lang.String newName)
      Renames the stored query.
      void update​(StoredQuery query)
      Updates the stored query with the given name.
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • add

        void add​(StoredQuery query)
          throws StardogException
        Stores the given query. If there is an existing stored query with the given name the request will fail.
        Parameters:
        query - the query being stored
        Throws:
        com.complexible.stardog.server.QueryExistsException - if there is an existing stored query with the given name
        StardogException - An error occurs while storing the query
      • update

        void update​(StoredQuery query)
             throws StardogException
        Updates the stored query with the given name. If no query with the given name exists the given query is stored.
        Parameters:
        query - the query being updated
        Throws:
        StardogException - An error occurs while updating the query
      • get

        StoredQuery get​(java.lang.String name)
                 throws StardogException
        Returns the stored query with the given name.
        Parameters:
        name - the name of the stored query being sought
        Returns:
        the stored query with the given name
        Throws:
        com.complexible.stardog.server.QueryNotFoundException - if the stored query with the given name does not exist
        StardogException - An error occurs while getting the query
      • iterator

        java.util.Iterator<StoredQuery> iterator()
        Returns an iterator of all stored queries. Users can only see their own stored queries and stored queries that have been shared by others.
        Specified by:
        iterator in interface java.lang.Iterable<StoredQuery>
        Returns:
        iterator of all stored queries
      • list

        java.lang.Iterable<StoredQuery> list​(java.util.Optional<java.lang.String> db)
        Lists all stored queries and if provided filter the stored queries for the given database name or the regular expression. If the db is not provided, all the stored queries that the user can access will be returned. Users can only see their own stored queries and stored queries that have been shared by others.
        Parameters:
        db - Name or regular expression to filter stored queries based on database
        Returns:
        iterator of all stored queries
      • remove

        void remove​(java.lang.String name)
             throws StardogException
        Removes the stored query with the given name.
        Parameters:
        name - the name of the stored query being removed
        Throws:
        com.complexible.stardog.server.QueryNotFoundException - if the stored query with the given name does not exist
        StardogException - An error occurs while removing the query
      • rename

        void rename​(java.lang.String oldName,
                    java.lang.String newName)
             throws StardogException
        Renames the stored query.
        Parameters:
        oldName - the name of the stored query being removed
        newName - new name for the stored query
        Throws:
        StardogException - An error occurs while renaming the query