Esempio n. 1
0
 def setUp(self):
     self.automerge = self.get_automerge_enabled()
     factory = TopicMapSystemFactory.new_instance()
     if self.automerge is not None:
         factory.set_feature('http://tmapi.org/features/automerge',
                             self.automerge)
     self.tms = factory.new_topic_map_system()
     self.tms.save()
     self.default_locator = self.tms.create_locator(self.DEFAULT_ADDRESS)
     self.tm = self.tms.create_topic_map(self.default_locator)
 def setUp (self):
     self.automerge = self.get_automerge_enabled()
     factory = TopicMapSystemFactory.new_instance()
     if self.automerge is not None:
         factory.set_feature('http://tmapi.org/features/automerge',
                             self.automerge)
     self.tms = factory.new_topic_map_system()
     self.tms.save()
     self.default_locator = self.tms.create_locator(self.DEFAULT_ADDRESS)
     self.tm = self.tms.create_topic_map(self.default_locator)
class FeatureStringsTest (TestCase):

    FEATURE_BASE = 'http://tmapi.org/features/'
    TYPE_INSTANCE_ASSOCIATIONS = FEATURE_BASE + 'type-instance-associations'
    READ_ONLY = FEATURE_BASE + 'readOnly'
    AUTOMERGE = FEATURE_BASE + 'automerge'

    def setUp (self):
        self.factory = TopicMapSystemFactory()

    def make_topic_map_system (self):
        """Creates a new `TopicMapSystem` with the current
        configuration of the `factory`.

        :rtype: `TopicMapSystem`

        """
        try:
            return self.factory.new_topic_map_system()
        except TMAPIException, ex:
            raise TMAPIRuntimeException('Cannot create TopicMapSystem', ex)
Esempio n. 4
0
def create_topic_map (request):
    """Creates the topic map to be used by the EATS application, and
    populates it with the base ontological data. Returns a status
    message.

    :rtype: string

    """
    if request.method == 'GET':
        return redirect('administration-panel')
    factory = TopicMapSystemFactory.new_instance()
    tms = factory.new_topic_map_system()
    try:
        tms.create_topic_map(settings.EATS_TOPIC_MAP)
        status = 'created'
    except TopicMapExistsException:
        status = 'exists'
    except:
        status = 'failed'
    redirect_url = urljoin(reverse('administration-panel'), '?tm_create=' + 
                           status)
    return HttpResponseRedirect(redirect_url)
Esempio n. 5
0
 def create_topic_map (self):
     factory = TopicMapSystemFactory.new_instance()
     tms = factory.new_topic_map_system()
     tms.create_topic_map(settings.EATS_TOPIC_MAP)
     return EATSTopicMap.objects.get(iri=settings.EATS_TOPIC_MAP)
Esempio n. 6
0
 def setUp(self):
     factory = TopicMapSystemFactory.new_instance()
     self.tms = factory.new_topic_map_system()
     self.default_locator = self.tms.create_locator(self.DEFAULT_ADDRESS)
     self.tm = self.tms.create_topic_map(self.default_locator)
Esempio n. 7
0
 def create_topic_map(self):
     factory = TopicMapSystemFactory.new_instance()
     tms = factory.new_topic_map_system()
     tms.create_topic_map(settings.EATS_TOPIC_MAP)
     return EATSTopicMap.objects.get(iri=settings.EATS_TOPIC_MAP)
 def setUp (self):
     self.factory = TopicMapSystemFactory()
 def setUp (self):
     factory = TopicMapSystemFactory.new_instance()
     self.tms = factory.new_topic_map_system()
     self.default_locator = self.tms.create_locator(self.DEFAULT_ADDRESS)
     self.tm = self.tms.create_topic_map(self.default_locator)