No description
Find a file
helmutm ae863e1008 Re-building loops package as a 'concept management framework' - basically running again
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@810 fd906abe-77d9-0310-91a1-e0d9ade77398
2005-12-03 10:30:04 +00:00
browser Re-building loops package as a 'concept management framework' - basically running again 2005-12-03 10:30:04 +00:00
__init__.py first steps towards assigning subtasks through the web 2005-05-21 11:33:10 +00:00
concept.py Re-building loops package as a 'concept management framework' - basically running again 2005-12-03 10:30:04 +00:00
configure.zcml Work in progress: re-building loops package as a 'concept management framework' 2005-12-03 09:54:11 +00:00
interfaces.py Work in progress: re-building loops package as a 'concept management framework' 2005-12-03 09:54:11 +00:00
README.txt Work in progress: re-building loops package as a 'concept management framework' 2005-12-03 09:54:11 +00:00
tests.py Work in progress: re-building loops package as a 'concept management framework' 2005-12-03 09:54:11 +00:00

loops - Linked Objects for Organizational Process Services
==========================================================

  ($Id$)

Concepts and Relations
~~~~~~~~~~~~~~~~~~~~~~

Let's start with creating a few example concepts:

    >>> from loops.concept import Concept
    >>> c1 = Concept()
    >>> c1.title
    u''

    >>> c2 = Concept(u'c2', u'Second Concept')
    >>> c2.title
    u'Second Concept'

Now we want to relate the second concept to the first one.

In order to do this we first have to provide a relations registry. For
testing we use a simple dummy implementation.

    >>> from cybertools.relation.interfaces import IRelationsRegistry
    >>> from cybertools.relation.registry import DummyRelationsRegistry
    >>> from zope.app.testing import ztapi
    >>> ztapi.provideUtility(IRelationsRegistry, DummyRelationsRegistry())

We also need a Relation class to be used for connecting concepts:

    >>> from cybertools.relation import DyadicRelation

Now we can assign the concept c2 to c1:
        
    >>> c1.assignConcept(c2, DyadicRelation)

We can now ask our concepts for their related concepts:

    >>> sc1 = c1.getSubConcepts()
    >>> len(sc1)
    1
    >>> c2 in sc1
    True
    >>> len(c1.getParentConcepts())
    0

    >>> pc2 = c2.getParentConcepts()
    >>> len(pc2)
    1
        
    >>> c1 in pc2
    True
    >>> len(c2.getSubConcepts())
    0