Class DlSignature
java.lang.Object
org.tweetyproject.commons.TripleSetSignature<AtomicConcept,AtomicRole,Individual>
org.tweetyproject.logics.dl.syntax.DlSignature
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
ConstructorDescriptionCreates an empty signature.DlSignature
(Collection<?> c) Creates a signature with the given objects (individuals, concepts, roles or formulas).DlSignature
(Set<AtomicConcept> concepts, Set<AtomicRole> roles, Set<Individual> individuals) Creates a signature with the given concept names, role names and individuals. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds single objects to this signature, iff the object is an appropriate concept, role or individual or a formula.clone()
clones signatureboolean
Checks whether the signature contains an atomic concept of the given name.boolean
Checks whether the signature contains an individual of the given name.boolean
Checks whether the signature contains an atomic role of the given name.getConcept
(String s) Get the concept with the given name.Get the atomic concepts of the signature.Translates this DlSignature to a FolSignature, i.e.Get the individual with the given name.Get the individuals of the signature.Get the role with the given name.getRoles()
Get the role names of the signature.void
Removes the given formula from this signature, if it is present (optional operation).toString()
Returns the signature as a string in the order individuals - concept names - role names.Methods inherited from class org.tweetyproject.commons.TripleSetSignature
add, addAll, addSignature, clear, equals, hashCode, isEmpty, isOverlappingSignature, isSubSignature, removeAll
-
Constructor Details
-
DlSignature
public DlSignature()Creates an empty signature. -
DlSignature
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
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
Get the atomic concepts of the signature. A concept is an unary (arity 1) predicate.- Returns:
- the atomic concepts of the signature
-
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
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
- Returns:
- all predicates of this signature.
-
getIndividual
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
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
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
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
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
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
Returns the signature as a 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
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
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
Description copied from interface:Signature
Removes the given formula from this signature, if it is present (optional operation).- Parameters:
obj
- some object
-
clone
Description copied from interface:Signature
clones signature- Specified by:
clone
in interfaceSignature
- Specified by:
clone
in classTripleSetSignature<AtomicConcept,
AtomicRole, Individual> - Returns:
- clone
-