Class CQLRelation

java.lang.Object
org.z3950.zing.cql.CQLNode
org.z3950.zing.cql.CQLRelation

public class CQLRelation extends CQLNode
Represents a relation between a CQL index and term.
  • Constructor Details

    • CQLRelation

      public CQLRelation(String base)
      Creates a new CQLRelation with the specified base relation. Typical base relations include the usual six ordering relations (<=, invalid input: '&gt', etc.), the text relations any, all and exact, the old server-choice relation scr and profiled relations of the form prefix.name.
  • Method Details

    • getBase

      public String getBase()
      Returns the base relation with which the CQLRelation was originally created.
    • getModifiers

      public List<Modifier> getModifiers()
      Returns an array of the modifiers associated with a CQLRelation.
      Returns:
      An array of Modifier objects.
    • traverse

      public void traverse(CQLNodeVisitor visitor)
      Specified by:
      traverse in class CQLNode
    • toCQL

      public String toCQL()
      Description copied from class: CQLNode
      Decompiles a parse-tree into a CQL query.
      Specified by:
      toCQL in class CQLNode
      Returns:
      A String containing a CQL query equivalent to the parse-tree whose root is this node, so that compiling that query will yield an identical tree.
    • toPQF

      public String toPQF(Properties config) throws PQFTranslationException
      Description copied from class: CQLNode
      Renders a parse-tree into a Yaz-style PQF string. PQF, or Prefix Query Format, is a cryptic but powerful notation that can be trivially mapped, one-to-one, int Z39.50 Type-1 and Type-101 queries. A specification for the format can be found in Chapter 7 (Supporting Tools) of the YAZ manual.
      Specified by:
      toPQF in class CQLNode
      Parameters:
      config - A Properties object containing configuration information that specifies the mapping from CQL indexes, relations, etc. to Type-1 attributes. The mapping specification is described in the CQL-Java distribution's sample PQF-mapping configuration file, etc/pqf.properties, which see.
      Returns:
      A String containing a PQF query equivalent to the parse-tree whose root is this node.
      Throws:
      PQFTranslationException - If the parse-tree cannot be translated into PQF, for example because it contains a CQL relation that is not supported by the PQF configuration.
    • toType1BER

      public byte[] toType1BER(Properties config)
      Description copied from class: CQLNode
      Renders a parser-tree into a BER-endoded packet representing an equivalent Z39.50 Type-1 query. If you don't know what that means, then you don't need this method :-) This is useful primarily for SRW-to-Z39.50 gateways.
      Specified by:
      toType1BER in class CQLNode
      Parameters:
      config - A Properties object containing configuration information that specifies the mapping from CQL indexes, relations, etc. to Type-1 attributes. The mapping specification is described in the CQL-Java distribution's sample PQF-mapping configuration file, etc/pqf.properties, which see.
      Returns:
      A byte array containing the BER packet.
      See Also: