Class DlSignature

All Implemented Interfaces:
Cloneable, Signature

public class DlSignature extends TripleSetSignature<AtomicConcept,AtomicRole,Individual>
This class models a description logic signature. A signature for a description logic consists of concept names (unary predicates, e.g. "Male(X)"), role names (binary predicates, e.g. "DaughterOf(X,Y)") and individuals (constants, e.g. "Alice").
Author:
Bastian Wolf, Anna Gessler
  • Constructor Details

    • DlSignature

      public DlSignature()
      Creates an empty signature.
    • DlSignature

      public DlSignature(Set<AtomicConcept> concepts, Set<AtomicRole> roles, Set<Individual> individuals)
      Creates a signature with the given concept names, role names and individuals.
      Parameters:
      concepts - atomic concepts of the signature
      roles - atomic roles of the signature
      individuals - individuals of the signature
    • DlSignature

      public DlSignature(Collection<?> c) throws IllegalArgumentException
      Creates a signature with the given objects (individuals, concepts, roles or formulas).
      Parameters:
      c - a collection of items to be added.
      Throws:
      IllegalArgumentException - if at least one of the given objects is neither an individual, a concept, a role or a formula.
  • Method Details

    • getConcepts

      public Set<AtomicConcept> getConcepts()
      Get the atomic concepts of the signature. A concept is an unary (arity 1) predicate.
      Returns:
      the atomic concepts of the signature
    • getRoles

      public Set<AtomicRole> getRoles()
      Get the role names of the signature. A role is a binary predicate (arity 2) consisting of two individuals.
      Returns:
      the role names of the signature
    • getIndividuals

      public Set<Individual> getIndividuals()
      Get the individuals of the signature. An individual is a single object similar to objects used in first-order logic.
      Returns:
      the individuals of the signature
    • getPredicates

      public Set<Predicate> getPredicates()
      Returns:
      all predicates of this signature.
    • getIndividual

      public Individual getIndividual(String s)
      Get the individual with the given name.
      Parameters:
      s - name of individual
      Returns:
      the individual with the given name if it is part of the signature, null otherwise
    • getConcept

      public AtomicConcept getConcept(String s)
      Get the concept with the given name.
      Parameters:
      s - name of concept
      Returns:
      the concept with the given name if it is part of the signature, null otherwise
    • getRole

      public AtomicRole getRole(String s)
      Get the role with the given name.
      Parameters:
      s - name of role
      Returns:
      the role with the given name if it is part of the signature, null otherwise
    • containsIndividual

      public boolean containsIndividual(String s)
      Checks whether the signature contains an individual of the given name.
      Parameters:
      s - the name of the Individual
      Returns:
      true if the the signature contains an individual of the given name, false otherwise
    • containsConcept

      public boolean containsConcept(String s)
      Checks whether the signature contains an atomic concept of the given name.
      Parameters:
      s - the name of the atomic concept
      Returns:
      true if the the signature contains an atomic concept of the given name, false otherwise
    • containsRole

      public boolean containsRole(String s)
      Checks whether the signature contains an atomic role of the given name.
      Parameters:
      s - the name of the atomic role
      Returns:
      true if the the signature contains a role of the given name, false otherwise
    • toString

      public String toString()
      Returns the signature as a string in the order individuals - concept names - role names.
      Specified by:
      toString in interface Signature
      Overrides:
      toString in class TripleSetSignature<AtomicConcept,AtomicRole,Individual>
      Returns:
      a String
    • getCorrespondingFolSignature

      public FolSignature getCorrespondingFolSignature()
      Translates this DlSignature to a FolSignature, i.e. concept names and role names are added as predicates and individuals are added as constants.
      Returns:
      the corresponding FolSignature
    • add

      public void add(Object obj) throws IllegalArgumentException
      Adds single objects to this signature, iff the object is an appropriate concept, role or individual or a formula. For a formula (complex concept) all individuals, concepts and roles of this formula are added to the signature.
      Parameters:
      obj - an object to be added
      Throws:
      IllegalArgumentException - if the object is not an individual, a concept, a role or a DlFormula.
    • remove

      public void remove(Object obj)
      Description copied from interface: Signature
      Removes the given formula from this signature, if it is present (optional operation).
      Parameters:
      obj - some object
    • clone

      public DlSignature clone()
      Description copied from interface: Signature
      clones signature
      Specified by:
      clone in interface Signature
      Specified by:
      clone in class TripleSetSignature<AtomicConcept,AtomicRole,Individual>
      Returns:
      clone