Ejemplo n.º 1
0
void SkosCollection::addConcept(SkosConcept *p_concept)
{
    if (findConcept(*p_concept) == m_memberConcepts.end())
    {
        m_memberConcepts.append(p_concept);
    }
    else
    {
        qDebug() << "SkosCollection::addConcept() - concept already added";
    }
}
Ejemplo n.º 2
0
void SkosCollection::removeConcept(const SkosConcept &p_concept)
{
    QList<SkosConcept*>::iterator l_conceptToRemove = findConcept(p_concept);
    if (l_conceptToRemove != m_memberConcepts.end())
    {
        m_memberConcepts.erase(l_conceptToRemove);
    }
    else
    {
        qDebug() << "SkosCollection::removeConcept() - no such concept";
    }
}
Ejemplo n.º 3
0
addConceptResult
DlSatTester :: checkAddedConcept ( const CWDArray& lab, BipolarPointer p, const DepSet& dep )
{
#ifdef ENABLE_CHECKING
	fpp_assert ( isCorrect(p) );	// sanity checking
	// constants are not allowed here
	fpp_assert ( p != bpTOP );
	fpp_assert ( p != bpBOTTOM );
#endif

	if ( findConcept ( lab, p ) )
		return acrExist;

	if ( findConceptClash ( lab, inverse(p), dep ) )
		return acrClash;

	// we are able to insert a concept
	return acrDone;
}
Ejemplo n.º 4
0
addConceptResult
DlSatTester :: tryAddConcept ( const CWDArray& lab, BipolarPointer bp, const DepSet& dep )
{
	// check whether C or ~C can occurs in a node label
	register const BipolarPointer inv_p = inverse(bp);
	bool canC = isUsed(bp);
	bool canNegC = isUsed(inv_p);

	// if either C or ~C is used already, it's not new in a label
	if ( canC )
	{
		if ( canNegC )	// both C and ~C can be in the label
			return checkAddedConcept ( lab, bp, dep );
		else			// C but not ~C can be in the label
			return findConcept ( lab, bp ) ? acrExist : acrDone;
	}
	else
	{
		if ( canNegC )	// ~C but not C can be in the label
			return findConceptClash ( lab, inv_p, dep ) ? acrClash : acrDone;
		else			// neither C nor ~C can be in the label
			return acrDone;
	}
}