/*
* Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
*
* This file is part of the reasoning system Konclude.
* For details and support, see .
*
* Konclude is free software: you can redistribute it and/or modify
* it under the terms of version 3 of the GNU Lesser General Public
* License (LGPLv3) as published by the Free Software Foundation.
*
* Konclude is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU (Lesser) General Public License for more details.
*
* You should have received a copy of the GNU (Lesser) General Public
* License along with Konclude. If not, see .
*
*/
#ifndef KONCLUDE_REASONER_ONTOLOGY_CROLE_H
#define KONCLUDE_REASONER_ONTOLOGY_CROLE_H
// Libraries includes
// Namespace includes
#include "OntologySettings.h"
#include "CConcept.h"
#include "CTerminology.h"
#include "CName.h"
#include "CTagItem.h"
#include "CNamedItem.h"
#include "CRoleChain.h"
#include "CRoleData.h"
// Other includes
#include "Utilities/CSortedNegLinker.hpp"
#include "Utilities/CMemoryManager.hpp"
#include "Utilities/CLinker.hpp"
#include "Utilities/Container/CLinker.h"
// Logger includes
#include "Logger/CLogger.h"
namespace Konclude {
using namespace Utilities;
using namespace Utilities::Container;
namespace Reasoner {
namespace Ontology {
/*!
*
* \class CRole
* \author Andreas Steigmiller
* \version 0.1
* \brief TODO
*
*/
class CRole : public CTagItem, public CNamedItem {
// public methods
public:
//! Constructor
CRole();
CRole *initRole();
CRole *initRoleCopy(CRole *role, CMemoryAllocationManager* memMan);
CRole *setRoleTag(qint64 roleTag);
qint64 getRoleTag() const;
CRole *setTerminology(CTerminology *ontology);
CTerminology *getTerminology();
qint64 getTerminologyTag() const;
bool hasPropertyName();
CRole *setPropertyNameLinker(CLinker *propertyNameLinker);
CRole *addPropertyNameLinker(CLinker *propertyNameLinker);
CLinker *getPropertyNameLinker();
CRole* getInverseRole();
CRole* setInverseRole(CRole* inverseRole);
bool isDataRole();
bool isObjectRole();
CRole* setDataRole(bool dataRole);
CRole* setObjectRole(bool objectRole);
// domain and range methods
CSortedNegLinker *getRelativeRangeConceptList(bool roleInversed);
CSortedNegLinker *getDomainRangeConceptList(bool roleInversed);
CSortedNegLinker *getRangeConceptList();
CRole *setRangeConceptList(CSortedNegLinker *rangeConceptList);
CRole *addRangeConceptLinker(CSortedNegLinker *rangeConceptLinker);
bool hasRangeConceptTag(qint64 rangeConceptTag);
bool hasRangeConcept(CConcept* concept);
CSortedNegLinker *getDomainConceptList();
CRole *setDomainConceptList(CSortedNegLinker *domainConceptList);
CRole *addDomainConceptLinker(CSortedNegLinker *domainConceptLinker);
bool hasDomainConceptTag(qint64 domainConceptTag);
bool hasDomainConcept(CConcept* concept);
bool hasDomainOrRangeConceptTag(qint64 conceptTag);
// methods for super, inverse, equivalent roles
CRole *setSuperRoleList(CSortedNegLinker *superRoleList);
CRole *addSuperRoleLinker(CSortedNegLinker *superRoleLinker);
CSortedNegLinker *getSuperRoleList();
bool hasSuperRoleTag(qint64 tag, bool negated);
bool hasSuperRoleTag(qint64 tag);
bool hasSuperRole(CRole* role);
CRole *setIndirectSuperRoleLinker(CSortedNegLinker *superRoleList);
CRole *addIndirectSuperRoleLinker(CSortedNegLinker *superRoleLinker);
CSortedNegLinker *getIndirectSuperRoleList();
bool hasIndirectSuperRoleTag(qint64 tag, bool negated);
bool hasIndirectSuperRoleTag(qint64 tag);
bool hasIndirectSuperRole(CRole* role);
bool hasInverseRoles();
CRole *addInverseRoleLinker(CSortedNegLinker *inverseRole);
CSortedNegLinker *getInverseRoleList();
bool hasInverseRole(CRole* role);
bool hasEquivalentRoles();
CRole *addEquivalentRoleLinker(CSortedNegLinker *equivalentRole);
CSortedNegLinker *getEquivalentRoleList();
bool hasEquivalentRole(CRole* role);
CRole *setInverseEquivalentRoleList(CSortedNegLinker *invEqRoleList);
CSortedNegLinker *getInverseEquivalentRoleList();
bool hasDisjointRoles();
CRole *setDisjointRoleList(CSortedNegLinker *disRoleList);
CRole *addDisjointRoleLinker(CSortedNegLinker *disjointRole);
CSortedNegLinker *getDisjointRoleList();
bool hasDisjointRole(CRole* role);
// methods for other role properties
CRole *setTransitive(bool transetive);
bool isTransitive();
bool getTransitive();
CRole *setFunctional(bool functional);
bool isFunctional();
bool getFunctional();
CRole *setInverseFunctional(bool invFunctional);
bool isInverseFunctional();
bool getInverseFunctional();
CRole *setAsymmetric(bool asymmetric);
bool isAsymmetric();
bool getAsymmetric();
CRole *setSymmetric(bool symmetric);
bool isSymmetric();
bool getSymmetric();
CRole *setReflexive(bool reflexive);
bool isReflexive();
bool getReflexive();
CRole *setIrreflexive(bool irreflexive);
bool isIrreflexive();
bool getIrreflexive();
CRole* setRoleComplexity(bool complexRole);
bool isComplexRole();
bool isSimpleRole();
bool getRoleComplexity();
bool hasRoleChainSubSharing();
CRole *addRoleChainSubSharingLinker(CXLinker* roleChainLinker);
CXLinker* getRoleChainSubSharingLinker();
bool hasRoleChainSubSharingLinker(CRoleChain* roleChain);
bool hasRoleChainSuperSharing();
CRole *addRoleChainSuperSharingLinker(CXLinker* roleChainLinker);
CXLinker* getRoleChainSuperSharingLinker();
bool hasRoleChainSuperSharingLinker(CRoleChain* roleChain);
bool hasRoleData();
CRoleData* getRoleData();
CRole* setRoleData(CRoleData* roleData);
// deprecated
CRole *init(qint64 roleTag);
CRole *init(CRole *role);
bool operator<=(const CRole &role);
bool operator==(const CRole &role);
// protected methods
protected:
// private methods
private:
// private variables
private:
CRoleData* mRoleData;
CTerminology *tax;
bool mTransetive;
bool mFunctional;
bool mInvFunctional;
bool mAsymmetric;
bool mSymmetric;
bool mReflexive;
bool mIrreflexive;
bool mComplexity;
bool mDataRole;
CRole* mInverseRole;
CSortedNegLinker *rangeLinker;
CSortedNegLinker *domainLinker;
CSortedNegLinker* mInverseEquivalentRoles;
CSortedNegLinker* mDisjointRoles;
CSortedNegLinker *superRoles;
CSortedNegLinker *indirectSuperRoles;
CXLinker* mRoleChainSuperSharingLinker;
CXLinker* mRoleChainSubSharingLinker;
};
}; // end namespace Ontology
}; // end namespace Reasoner
}; // end namespace Konclude
#endif // KONCLUDE_REASONER_ONTOLOGY_CROLE_H