Soprano  2.9.2
Public Member Functions | List of all members
Soprano::Inference::RuleParser Class Reference

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, QUrlprefixes () const
void clear ()

Detailed Description

The RuleParser can be used to parse Soprano rule files.

See Also
RuleSet::standardRuleSet()
Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org

Definition at line 46 of file inferenceruleparser.h.

Constructor & Destructor Documentation

Soprano::Inference::RuleParser::RuleParser ( )
Soprano::Inference::RuleParser::~RuleParser ( )

Member Function Documentation

bool Soprano::Inference::RuleParser::parseFile ( const QString path)

Parse rules from a file. The parsed rules can be accessed via rules().

Returns
true on success, false otherwise.
Rule Soprano::Inference::RuleParser::parseRule ( const QString line)

Parse a single rule from a string.

Parameters
lineA single line defining the rule
Returns
The parsed rule in case line is a valid rule line, an invalid rule otherwise. The parsed rule can also be accessed via rules().
Since
2.3
RuleSet Soprano::Inference::RuleParser::rules ( ) const

Retrieve the rules parsed in parseFile and parseRule

void Soprano::Inference::RuleParser::addPrefix ( const QString qname,
const QUrl uri 
)

Add a prefix to use during rule parsing.

Parameters
qnameThe abbreviated name of the prefix
uriThe namespace to use for the prefix
Since
2.3
QHash<QString, QUrl> Soprano::Inference::RuleParser::prefixes ( ) const

Retrieve all prefixes set via addPrefix.

Returns
a QHash containing of the prefixe qnames and their URIs.
Since
2.3
void Soprano::Inference::RuleParser::clear ( )

Clear all parsed rules and prefixes.

Since
2.3

The documentation for this class was generated from the following file: