Package net.sf.tweety.logics.dl.syntax
Class DlSignature
- java.lang.Object
-
- net.sf.tweety.commons.TripleSetSignature<AtomicConcept,AtomicRole,Individual>
-
- net.sf.tweety.logics.dl.syntax.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 Summary
Constructors Constructor Description DlSignature()
Creates an empty signature.DlSignature(java.util.Collection<?> c)
Creates a signature with the given objects (individuals, concepts, roles or formulas).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.
-
Method Summary
Modifier and Type Method Description void
add(java.lang.Object obj)
Adds single objects to this signature, iff the object is an appropriate concept, role or individual or a formula.DlSignature
clone()
boolean
containsConcept(java.lang.String s)
Checks whether the signature contains an atomic concept of the given name.boolean
containsIndividual(java.lang.String s)
Checks whether the signature contains an Individual of the given name.boolean
containsRole(java.lang.String s)
Checks whether the signature contains an atomic role of the given name.AtomicConcept
getConcept(java.lang.String s)
Get the concept with the given name.java.util.Set<AtomicConcept>
getConcepts()
Get the atomic concepts of the signature.FolSignature
getCorrespondingFolSignature()
Translates this DlSignature to a FolSignature, i.e.Individual
getIndividual(java.lang.String s)
Get the individual with the given name.java.util.Set<Individual>
getIndividuals()
Get the individuals of the signature.java.util.Set<Predicate>
getPredicates()
AtomicRole
getRole(java.lang.String s)
Get the role with the given name.java.util.Set<AtomicRole>
getRoles()
Get the role names of the signature.void
remove(java.lang.Object obj)
Removes the given formula from this signature, if it is present (optional operation).java.lang.String
toString()
Returns signature as string in the order individuals - concept names - role names.-
Methods inherited from class net.sf.tweety.commons.TripleSetSignature
add, addAll, addSignature, clear, equals, hashCode, isEmpty, isOverlappingSignature, isSubSignature, removeAll
-
-
-
-
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 signatureroles
- atomic roles of the signatureindividuals
- 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
-
toString
public java.lang.String toString()
Returns signature as string in the order individuals - concept names - role names.- Specified by:
toString
in interfaceSignature
- Overrides:
toString
in classTripleSetSignature<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(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
-
clone
public DlSignature clone()
- Specified by:
clone
in interfaceSignature
- Specified by:
clone
in classTripleSetSignature<AtomicConcept,AtomicRole,Individual>
-
-