| 1 |
/* |
| 2 |
* Copyright (C) 2013-2015, 2019 by the Konclude Developer Team. |
| 3 |
* |
| 4 |
* This file is part of the reasoning system Konclude. |
| 5 |
* For details and support, see <http://konclude.com/>. |
| 6 |
* |
| 7 |
* Konclude is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of version 3 of the GNU Lesser General Public |
| 9 |
* License (LGPLv3) as published by the Free Software Foundation. |
| 10 |
* |
| 11 |
* Konclude is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU (Lesser) General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU (Lesser) General Public |
| 17 |
* License along with Konclude. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
* |
| 19 |
*/ |
| 20 |
|
| 21 |
#include "CCLIObjectPropertyClassificationComandLinePreparationTranslator.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Control { |
| 27 |
|
| 28 |
namespace Interface { |
| 29 |
|
| 30 |
namespace CommandLine { |
| 31 |
|
| 32 |
CCLIObjectPropertyClassificationComandLinePreparationTranslator::CCLIObjectPropertyClassificationComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCLIComandLinePreparationTranslator(loaderFactory) { |
| 33 |
mOperationTypeString = QString("ObjectPropertyClassification"); |
| 34 |
mMinNecessaryArguments = true; |
| 35 |
mFirstArgumentTranslation = false; |
| 36 |
mLoaderTypeString = QString("-CLIObjectPropertyClassificationBatchProcessingLoader"); |
| 37 |
|
| 38 |
mTranslationStringSet.insert(QString("classifyproperties").toUpper()); |
| 39 |
mTranslationStringSet.insert(QString("classifyobj").toUpper()); |
| 40 |
mTranslationStringSet.insert(QString("classifyobjproperties").toUpper()); |
| 41 |
mTranslationStringSet.insert(QString("classifyobjectproperties").toUpper()); |
| 42 |
mTranslationStringSet.insert(QString("classifyroles").toUpper()); |
| 43 |
mTranslationStringSet.insert(QString("classifyabstractroles").toUpper()); |
| 44 |
mTranslationStringSet.insert(QString("objclassification").toUpper()); |
| 45 |
mTranslationStringSet.insert(QString("propertyclassification").toUpper()); |
| 46 |
mTranslationStringSet.insert(QString("objpropertyclassification").toUpper()); |
| 47 |
mTranslationStringSet.insert(QString("objectpropertyclassification").toUpper()); |
| 48 |
mTranslationStringSet.insert(QString("roleclassification").toUpper()); |
| 49 |
mTranslationStringSet.insert(QString("abstractroleclassification").toUpper()); |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
CCLIObjectPropertyClassificationComandLinePreparationTranslator::~CCLIObjectPropertyClassificationComandLinePreparationTranslator() { |
| 54 |
} |
| 55 |
|
| 56 |
bool CCLIObjectPropertyClassificationComandLinePreparationTranslator::hasNeccessaryParameters() { |
| 57 |
bool minNecessaryArguments = true; |
| 58 |
if (!mFirstArgumentTranslation) { |
| 59 |
minNecessaryArguments = false; |
| 60 |
} |
| 61 |
if (!mRequestFileTranslated) { |
| 62 |
LOG(ERROR,getLogDomain(),logTr("%1 request file not specified.").arg(mOperationTypeString),this); |
| 63 |
minNecessaryArguments = false; |
| 64 |
} |
| 65 |
return minNecessaryArguments; |
| 66 |
} |
| 67 |
|
| 68 |
bool CCLIObjectPropertyClassificationComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) { |
| 69 |
|
| 70 |
bool argumentTranslated = false; |
| 71 |
|
| 72 |
|
| 73 |
QString modArgText = argumentText.trimmed(); |
| 74 |
if (!mSkipTranslation) { |
| 75 |
if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) { |
| 76 |
argumentTranslated = true; |
| 77 |
} else { |
| 78 |
if (modArgText.indexOf("-") == 0) { |
| 79 |
} else if (mTranslationStringSet.contains(modArgText.toUpper())) { |
| 80 |
argumentTranslated = true; |
| 81 |
mFirstArgumentTranslation = true; |
| 82 |
} |
| 83 |
} |
| 84 |
} |
| 85 |
return argumentTranslated; |
| 86 |
} |
| 87 |
|
| 88 |
bool CCLIObjectPropertyClassificationComandLinePreparationTranslator::canTranslate(const QString& string) { |
| 89 |
if (mTranslationStringSet.contains(string.toUpper())) { |
| 90 |
return true; |
| 91 |
} |
| 92 |
return false; |
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
}; // end namespace CommandLine |
| 97 |
|
| 98 |
}; // end namespace Interface |
| 99 |
|
| 100 |
}; // end namespace Control |
| 101 |
|
| 102 |
}; // end namespace Konclude |