Summary: | sopranocmd export don't works with SPAQL | ||
---|---|---|---|
Product: | [Unmaintained] nepomuk | Reporter: | Ignacio Serantes <kde> |
Component: | general | Assignee: | Sebastian Trueg <sebastian> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Ignacio Serantes
2009-08-19 13:46:34 UTC
SVN commit 1013270 by trueg: Only graph queries can be serialized. Fail with an error if the query is not a graph query. BUG: 204402 M +11 -4 sopranocmd.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1013270 commit 7cebda729c022156a28dbe9d712039307ad9b548 branch 2.4 Author: Sebastian Trueg <sebastian@trueg.de> Date: Wed Aug 19 12:30:09 2009 +0000 Only graph queries can be serialized. Fail with an error if the query is not a graph query. BUG: 204402 svn path=/trunk/kdesupport/soprano/; revision=1013270 diff --git a/tools/sopranocmd.cpp b/tools/sopranocmd.cpp index 49ec31c..0e77414 100644 --- a/tools/sopranocmd.cpp +++ b/tools/sopranocmd.cpp @@ -837,10 +837,17 @@ int main( int argc, char *argv[] ) success = exportFile( model->listStatements(), fileName, serialization ); } else { - success = exportFile( model->executeQuery( tuneQuery( query, queryLang ), - Soprano::Query::queryLanguageFromString( queryLang ), queryLang ).iterateStatements(), - fileName, - serialization ); + QueryResultIterator it = model->executeQuery( tuneQuery( query, queryLang ), + Soprano::Query::queryLanguageFromString( queryLang ), queryLang ); + if ( it.isGraph() ) { + success = exportFile( it.iterateStatements(), + fileName, + serialization ); + } + else { + errStream << "Can only export graph queries"; + return 1; + } } delete model; |