Commit 3b3fe192 authored by Vishesh Handa's avatar Vishesh Handa

Storage: Perform a runtime check for virtuoso 6.1.6

We only work with virtuoso 6.1.6.

This requires a newer version of Soprano to be released

BUG: 313834
parent e0fe32fb
......@@ -22,7 +22,7 @@ include(KDE4Defaults)
find_package(SharedDesktopOntologies 0.10.51)
set_package_properties(SharedDesktopOntologies PROPERTIES DESCRIPTION "Shared Desktop Ontologies" URL "http://oscaf.sourceforge.net" TYPE REQUIRED PURPOSE "Ontologies necessary for the Nepomuk semantic desktop")
find_package(Soprano 2.9.0 COMPONENTS PLUGIN_RAPTORPARSER PLUGIN_REDLANDBACKEND PLUGIN_VIRTUOSOBACKEND)
find_package(Soprano 2.9.3 COMPONENTS PLUGIN_RAPTORPARSER PLUGIN_REDLANDBACKEND PLUGIN_VIRTUOSOBACKEND)
set_package_properties(Soprano PROPERTIES DESCRIPTION "Qt-based RDF storage and parsing solution" URL "http://soprano.sourceforge.net" TYPE REQUIRED PURPOSE "Required for everything (storage and general data management)")
# Poppler
......
......@@ -65,7 +65,8 @@ Nepomuk2::Repository::Repository( const QString& name )
m_dataManagementModel( 0 ),
m_dataManagementAdaptor( 0 ),
m_backend( 0 ),
m_ontologyLoader( 0 )
m_ontologyLoader( 0 ),
m_port( 0 )
{
m_dummyModel = new Soprano::Util::DummyModel();
......@@ -172,6 +173,14 @@ void Nepomuk2::Repository::open()
kDebug() << "opening repository '" << name() << "' at '" << m_basePath << "'";
// WARNING:
// This is used as a hack to get the port number and virtuoso version number. This slot
// should not by async, as the values it sets are subsequently used.
// The QObject cast is because m_backend is const
QObject* qobj = dynamic_cast<QObject*>(const_cast<Soprano::Backend*>(m_backend));
connect( qobj, SIGNAL(virtuosoInitParameters(int, QString)),
this, SLOT(slotVirtuosoInitParameters(int,QString)) );
// open storage
// =================================
Soprano::settingInSettings( settings, Soprano::BackendOptionStorageDir ).setValue( m_storagePath );
......@@ -184,6 +193,11 @@ void Nepomuk2::Repository::open()
return;
}
if( !m_virtuosoVersion.startsWith("6.1.6") ) {
kError() << "NepomukStorage only works with virtuoso 6.1.6";
return;
}
connect(m_model, SIGNAL(virtuosoStopped(bool)), this, SLOT(slotVirtuosoStopped(bool)));
kDebug() << "Successfully created new model for repository" << name();
......@@ -315,6 +329,13 @@ void Nepomuk2::Repository::updateInference(bool ontologiesChanged)
m_inferenceModel->updateOntologyGraphs(ontologiesChanged);
}
void Nepomuk2::Repository::slotVirtuosoInitParameters(int port, const QString& version)
{
m_port = port;
m_virtuosoVersion = version;
}
void Nepomuk2::Repository::slotVirtuosoStopped(bool normalExit)
{
if(!normalExit) {
......
......@@ -91,6 +91,7 @@ namespace Nepomuk2 {
void closed( Repository* );
private Q_SLOTS:
void slotVirtuosoInitParameters(int port, const QString& version);
void slotVirtuosoStopped( bool normalExit );
void slotOpened( Repository*, bool success );
void slotOntologiesLoaded( bool somethingChanged );
......@@ -125,6 +126,9 @@ namespace Nepomuk2 {
OntologyLoader* m_ontologyLoader;
void updateInference(bool ontologiesChanged);
int m_port;
QString m_virtuosoVersion;
};
typedef QMap<QString, Repository*> RepositoryMap;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment