Class DlParser
This class implements a parser for the description logic ALC (attributive
 concept language with complements). The input syntax is based on the input
 syntax of the
 Racer
 reasoner.
 
Note: Racer is built for the description logic SRIQ(D) (= the DL that corresponds to the OWL2 language), which is more expressive than ALC. SRIQ(D)-exclusive elements like inverse roles, role hierarchies and at-least restrictions are not supported by this parser. Furthermore, the syntax of universal and existential restrictions is different for reasons of simplification (see BNF).
 
The input syntax for an ALC knowledge base is given by the following BNF (starting symbol is KB):
KB ::== SIGNATURE FORMULAS
SIGNATURE ::== "signature(" (CONCEPT_DECLAR)? (ROLE_DECLAR)? (INDIVIDUAL_DECLAR)? ")"
CONCEPT_DECLAR ::== ("\n")* "atomic-concepts(" (CONCEPTNAME)* ")"
ROLE_DECLAR ::== ("\n")* "roles(" (ROLENAME)* ")"
INDIVIDUAL_DECLAR ::== ("\n")* "individuals(" (CONSTANTNAME)* ")"
AXIOMS ::== ("\n" AXIOM)*
AXIOM ::== "instance " " " CONSTANTNAME " " CONCEPT | "related " CONSTANTNAME " " CONSTANTNAME " " ROLENAME |
"implies " " " CONCEPT " " CONCEPT | "equivalent" CONCEPT " " CONCEPT
CONCEPT ::== "(" CONCEPT ")" | CONCEPTNAME | "not " CONCEPT | "*top*" | "*bottom*" | "top" | "bottom" |
"and " CONCEPT " " CONCEPT | "or " CONCEPT " " CONCEPT |
"forall " ROLENAME " " CONCEPT | "exists " ROLENAME " " CONCEPT
 
where CONCEPTNAME, ROLENAME, CONSTANTNAME are sequences of
symbols from {a,...,z,A,...,Z,0,...,9} with a letter at the beginning
excluding {"top","bottom"}.
Note: Racer is built for the description logic SRIQ(D) (= the DL that corresponds to the OWL2 language), which is more expressive than ALC. SRIQ(D)-exclusive elements like inverse roles, role hierarchies and at-least restrictions are not supported by this parser. Furthermore, the syntax of universal and existential restrictions is different for reasons of simplification (see BNF).
The input syntax for an ALC knowledge base is given by the following BNF (starting symbol is KB):
KB ::== SIGNATURE FORMULAS
SIGNATURE ::== "signature(" (CONCEPT_DECLAR)? (ROLE_DECLAR)? (INDIVIDUAL_DECLAR)? ")"
CONCEPT_DECLAR ::== ("\n")* "atomic-concepts(" (CONCEPTNAME)* ")"
ROLE_DECLAR ::== ("\n")* "roles(" (ROLENAME)* ")"
INDIVIDUAL_DECLAR ::== ("\n")* "individuals(" (CONSTANTNAME)* ")"
AXIOMS ::== ("\n" AXIOM)*
AXIOM ::== "instance " " " CONSTANTNAME " " CONCEPT | "related " CONSTANTNAME " " CONSTANTNAME " " ROLENAME |
"implies " " " CONCEPT " " CONCEPT | "equivalent" CONCEPT " " CONCEPT
CONCEPT ::== "(" CONCEPT ")" | CONCEPTNAME | "not " CONCEPT | "*top*" | "*bottom*" | "top" | "bottom" |
"and " CONCEPT " " CONCEPT | "or " CONCEPT " " CONCEPT |
"forall " ROLENAME " " CONCEPT | "exists " ROLENAME " " CONCEPT
where CONCEPTNAME, ROLENAME, CONSTANTNAME are sequences of
symbols from {a,...,z,A,...,Z,0,...,9} with a letter at the beginning
excluding {"top","bottom"}.
- Author:
- Anna Gessler, Matthias Thimm
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturn the signature of this parser.parseBeliefBase(Reader reader) Parses the given reader into a belief base of the given type.parseFormula(Reader reader) Parses the given reader into a formula of the given type.voidsetSignature(DlSignature signature) Sets the signature for this parser.voidThis method reads one character from the given reader and appropriately tokenizes it.Methods inherited from class org.tweetyproject.commons.ParserisNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormula, parseFormulaFromFile, parseListOfBeliefBases, parseListOfBeliefBases, parseListOfBeliefBasesFromFile, parseListOfBeliefBasesFromFile
- 
Constructor Details- 
DlParserpublic DlParser()
 
- 
- 
Method Details- 
parseBeliefBaseDescription copied from class:ParserParses the given reader into a belief base of the given type.- Specified by:
- parseBeliefBasein class- Parser<DlBeliefSet,- DlAxiom> 
- Parameters:
- reader- a reader
- Returns:
- a belief base
- Throws:
- IOException- if some IO issue occurred.
- ParserException- some parsing exceptions may be added here.
 
- 
parseFormulaDescription copied from class:ParserParses the given reader into a formula of the given type.- Specified by:
- parseFormulain class- Parser<DlBeliefSet,- DlAxiom> 
- Parameters:
- reader- a reader
- Returns:
- a formula
- Throws:
- IOException- if some IO issue occurred.
- ParserException- some parsing exceptions may be added here.
 
- 
tokenize
- 
setSignatureSets the signature for this parser.- Parameters:
- signature- a DL signature.
 
- 
getSignatureReturn the signature of this parser.- Returns:
- the signature of this parser.
 
 
-