Soprano  2.7.56
Public Member Functions
Soprano::Inference::RuleParser Class Reference

The RuleParser can be used to parse Soprano rule files. More...

#include <Soprano/Inference/RuleParser>

List of all members.

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


Member Function Documentation

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

Returns:
true on success, false otherwise.

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

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

Retrieve all prefixes set via addPrefix.

Returns:
a QHash containing of the prefixe qnames and their URIs.
Since:
2.3

Clear all parsed rules and prefixes.

Since:
2.3

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