Example #1
0
 def classes(self, resourceId):
     cherrypy.response.headers["Access-Control-Allow-Origin"] = "*"
     cherrypy.response.headers["Access-Control-Allow-Methods"] = "GET, POST, OPTIONS"
     cherrypy.response.headers[
         "Access-Control-Allow-Headers"
     ] = "Cache-Control, X-Proxy-Authorization, X-Requested-With"
     resourceId = resourceId.lower()
     classifier = Classifier(resourceId)
     return json.dumps(classifier.getClassesJsonDummy(resourceId))
Example #2
0
class TestClassifier(TestInterface):
    def __init__(self):
        self.classifier = Classifier()
        pass

    def classifyRandom20(self):
        import pprint
        pprinter = pprint.PrettyPrinter()
        resourceIds = self.getRandom20Resources()
        for resourceId in resourceIds:
            print resourceId
            try:
                pprinter.pprint(self.classifier.getClasses(resourceId))
            except BaseException as e:
                print str(e)
Example #3
0
 def _getEntities(self, resourceId):
     classifier = Classifier()
     return classifier.getClassesJson(resourceId)
Example #4
0
 def __init__(self):
     self.classifier = Classifier()
     pass