Soprano
2.9.4
|
The RuleParser can be used to parse Soprano rule files. More...
#include <Soprano/Inference/RuleParser>
Public Member Functions | |
RuleParser () | |
~RuleParser () | |
bool | parseFile (const QString &path) |
Rule | parseRule (const QString &line) |
RuleSet | rules () const |
void | addPrefix (const QString &qname, const QUrl &uri) |
QHash< QString, QUrl > | prefixes () const |
void | clear () |
The RuleParser can be used to parse Soprano rule files.
Definition at line 46 of file inferenceruleparser.h.
Soprano::Inference::RuleParser::RuleParser | ( | ) |
Soprano::Inference::RuleParser::~RuleParser | ( | ) |
bool Soprano::Inference::RuleParser::parseFile | ( | const QString & | path) |
Parse rules from a file. The parsed rules can be accessed via rules().
true
on success, false
otherwise. Parse a single rule from a string.
line | A single line defining the rule |
line
is a valid rule line, an invalid rule otherwise. The parsed rule can also be accessed via rules().RuleSet Soprano::Inference::RuleParser::rules | ( | ) | const |
Retrieve the rules parsed in parseFile and parseRule
Add a prefix to use during rule parsing.
qname | The abbreviated name of the prefix |
uri | The namespace to use for the prefix |
Retrieve all prefixes set via addPrefix.
void Soprano::Inference::RuleParser::clear | ( | ) |
Clear all parsed rules and prefixes.