Class DlSignature

  • All Implemented Interfaces:
    java.lang.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 Detail

      • DlSignature

        public DlSignature()
        Creates an empty signature.
      • DlSignature

        public DlSignature​(java.util.Set<AtomicConcept> concepts,
                           java.util.Set<AtomicRole> roles,
                           java.util.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​(java.util.Collection<?> c)
                    throws java.lang.IllegalArgumentException
        Creates a signature with the given objects (individuals, concepts, roles or formulas).
        Parameters:
        c - a collection of items to be added.
        Throws:
        java.lang.IllegalArgumentException - if at least one of the given objects is neither an individual, a concept, a role or a formula.
    • Method Detail

      • getConcepts

        public java.util.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 java.util.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 java.util.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 java.util.Set<Predicate> getPredicates()
        Returns:
        all predicates of this signature.
      • getIndividual

        public Individual getIndividual​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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
      • 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​(java.lang.Object obj)
                 throws java.lang.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:
        java.lang.IllegalArgumentException - if the object is not an individual, a concept, a role or a DlFormula.
      • remove

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