Package com.semedy.reasoner.api.parser
Class RuleParser
java.lang.Object
com.semedy.reasoner.api.parser.RuleParser
Parser for rules.
- Author:
- angele
-
Constructor Summary
ConstructorsConstructorDescriptionRuleParser(SymbolTable symbolTable, ExternalDataTypeProvider dataTypeProvider, BuiltinProvider builtins) RuleParser(SymbolTable symbolTable, ExternalDataTypeProvider dataTypeProvider, BuiltinProvider builtins, InvertedIndices invertedIndex) -
Method Summary
Modifier and TypeMethodDescriptionparse rule from a stringparseRules(String input) parse several rules from input stringvoidparseRulesOrFacts(InputStream input, Collection<Rule> parsedRules, Collection<Literal> parsedFacts) parse rules and facts in input stream to the containers parsedRules and parsedFactsvoidparseRulesOrFacts(Reader input, Collection<Rule> parsedRules, Collection<Literal> parsedFacts) parse rules and facts from reader to the containers parsedRules and parsedFactsvoidparseRulesOrFacts(StringReader input, Collection<Rule> parsedRules, Collection<Literal> parsedFacts) parse rules and facts from string reader to the containers parsedRules and parsedFactsvoidparseRulesOrFacts(String input, Collection<Rule> parsedRules, Collection<Literal> parsedFacts) parse rules and facts from string to the containers parsedRules and parsedFacts
-
Constructor Details
-
RuleParser
public RuleParser(SymbolTable symbolTable, ExternalDataTypeProvider dataTypeProvider, BuiltinProvider builtins, InvertedIndices invertedIndex) -
RuleParser
public RuleParser(SymbolTable symbolTable, ExternalDataTypeProvider dataTypeProvider, BuiltinProvider builtins)
-
-
Method Details
-
parseRulesOrFacts
public void parseRulesOrFacts(InputStream input, Collection<Rule> parsedRules, Collection<Literal> parsedFacts) throws IOException, SemReasonerException parse rules and facts in input stream to the containers parsedRules and parsedFacts- Parameters:
input- , input streamparsedRules- , container to parse rules intoparsedFacts- , container to parse facts into- Throws:
IOExceptionSemReasonerException
-
parseRulesOrFacts
public void parseRulesOrFacts(StringReader input, Collection<Rule> parsedRules, Collection<Literal> parsedFacts) throws IOException, SemReasonerException parse rules and facts from string reader to the containers parsedRules and parsedFacts- Parameters:
input- , input string readerparsedRules- , container to parse rules intoparsedFacts- , container to parse facts into- Throws:
IOExceptionSemReasonerException
-
parseRulesOrFacts
public void parseRulesOrFacts(Reader input, Collection<Rule> parsedRules, Collection<Literal> parsedFacts) throws IOException, SemReasonerException parse rules and facts from reader to the containers parsedRules and parsedFacts- Parameters:
input- , input readerparsedRules- , container to parse rules intoparsedFacts- , container to parse facts into- Throws:
IOExceptionSemReasonerException
-
parseRulesOrFacts
public void parseRulesOrFacts(String input, Collection<Rule> parsedRules, Collection<Literal> parsedFacts) throws SemReasonerException, IOException parse rules and facts from string to the containers parsedRules and parsedFacts- Parameters:
input- , input stringparsedRules- , container to parse rules intoparsedFacts- , container to parse facts into- Throws:
IOExceptionSemReasonerException
-
parseRule
parse rule from a string- Parameters:
s- input string- Returns:
- rule, resulting rule
- Throws:
IOExceptionSemReasonerException
-
parseRules
parse several rules from input string- Parameters:
input- input string- Throws:
IOExceptionSemReasonerException
-