| 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 "CPropertyHierarchyResult.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Query { |
| 29 |
|
| 30 |
|
| 31 |
CPropertyHierarchyResult::CPropertyHierarchyResult(bool dataProperties) { |
| 32 |
mDataProperties = dataProperties; |
| 33 |
} |
| 34 |
|
| 35 |
CPropertyHierarchyResult::CPropertyHierarchyResult(const QString &bottomHierarchyProperty, const QString &topHierarchyProperty, bool dataProperties) : CStringHierarchyResult<CPropertyHierarchyResult,CPropertySubPropertiesRelationResult,CPropertySynsetResult>(bottomHierarchyProperty,topHierarchyProperty) { |
| 36 |
mDataProperties = dataProperties; |
| 37 |
} |
| 38 |
|
| 39 |
CPropertyHierarchyResult::CPropertyHierarchyResult(const QStringList &bottomHierarchyProperties, const QStringList &topHierarchyProperties, bool dataProperties) : CStringHierarchyResult<CPropertyHierarchyResult,CPropertySubPropertiesRelationResult,CPropertySynsetResult>(bottomHierarchyProperties,topHierarchyProperties) { |
| 40 |
mDataProperties = dataProperties; |
| 41 |
} |
| 42 |
|
| 43 |
CPropertyHierarchyResult::CPropertyHierarchyResult(CPropertySynsetResult *takeBottomPropertySynset, CPropertySynsetResult *takeTopPropertySynset, bool dataProperties) : CStringHierarchyResult<CPropertyHierarchyResult,CPropertySubPropertiesRelationResult,CPropertySynsetResult>(takeBottomPropertySynset,takeTopPropertySynset) { |
| 44 |
mDataProperties = dataProperties; |
| 45 |
} |
| 46 |
|
| 47 |
CPropertyHierarchyResult::CPropertyHierarchyResult(CPropertySynsetResult *takeBottomPropertySynset, bool dataProperties) : CStringHierarchyResult<CPropertyHierarchyResult,CPropertySubPropertiesRelationResult,CPropertySynsetResult>(takeBottomPropertySynset) { |
| 48 |
mDataProperties = dataProperties; |
| 49 |
} |
| 50 |
|
| 51 |
|
| 52 |
CPropertySynsetResult *CPropertyHierarchyResult::getBottomPropertySynset() { |
| 53 |
return getBottomStringSynset(); |
| 54 |
} |
| 55 |
|
| 56 |
CPropertySynsetResult *CPropertyHierarchyResult::getTopPropertySynset() { |
| 57 |
return getTopStringSynset(); |
| 58 |
} |
| 59 |
|
| 60 |
CPropertySynsetResult *CPropertyHierarchyResult::getPropertySynset(const QString &propertyName, bool create) { |
| 61 |
CPropertySynsetResult* propertySynset = getStringSynset(propertyName, create); |
| 62 |
if (propertySynset) { |
| 63 |
propertySynset->setDataProperties(mDataProperties); |
| 64 |
} |
| 65 |
return propertySynset; |
| 66 |
} |
| 67 |
|
| 68 |
CPropertySynsetResult *CPropertyHierarchyResult::getPropertySynset(const QStringList &propertyNames, bool create) { |
| 69 |
CPropertySynsetResult* propertySynset = getStringSynset(propertyNames,create); |
| 70 |
if (propertySynset) { |
| 71 |
propertySynset->setDataProperties(mDataProperties); |
| 72 |
} |
| 73 |
return propertySynset; |
| 74 |
} |
| 75 |
|
| 76 |
|
| 77 |
CPropertySynsetResult *CPropertyHierarchyResult::setTopPropertySynset(CPropertySynsetResult *propertySynset) { |
| 78 |
propertySynset->setDataProperties(mDataProperties); |
| 79 |
return setTopStringSynset(propertySynset); |
| 80 |
} |
| 81 |
|
| 82 |
|
| 83 |
CPropertySynsetResult *CPropertyHierarchyResult::addPropertySynset(CPropertySynsetResult *takePropertySynset) { |
| 84 |
takePropertySynset->setDataProperties(mDataProperties); |
| 85 |
return addStringSynset(takePropertySynset); |
| 86 |
} |
| 87 |
|
| 88 |
|
| 89 |
CPropertySubPropertiesRelationResult *CPropertyHierarchyResult::addSubPropertyRelation(CPropertySynsetResult *superPropertySynset, CPropertySynsetResult *anySubPropertySynset) { |
| 90 |
return addSubStringRelation(superPropertySynset,anySubPropertySynset); |
| 91 |
} |
| 92 |
|
| 93 |
CPropertySubPropertiesRelationResult *CPropertyHierarchyResult::getSubPropertyRelation(CPropertySynsetResult *superPropertySynset, bool create) { |
| 94 |
return getSubStringRelation(superPropertySynset,create); |
| 95 |
} |
| 96 |
|
| 97 |
bool CPropertyHierarchyResult::hasDataProperties() { |
| 98 |
return mDataProperties; |
| 99 |
} |
| 100 |
|
| 101 |
bool CPropertyHierarchyResult::hasObjectProperties() { |
| 102 |
return !mDataProperties; |
| 103 |
} |
| 104 |
|
| 105 |
CPropertyHierarchyResult* CPropertyHierarchyResult::setDataProperties(bool dataProperties) { |
| 106 |
mDataProperties = dataProperties; |
| 107 |
return this; |
| 108 |
} |
| 109 |
|
| 110 |
}; // end namespace Query |
| 111 |
|
| 112 |
}; // end namespace Reasoner |
| 113 |
|
| 114 |
}; // end namespace Konclude |