Esempio n. 1
0
    def setUp(self):
        self.dialog = Dialog()
        self.dialog.start()

        self.oro = ResourcePool().ontology_server

        try:
            self.oro.reload()
            self.oro.add([
                'shelf1 rdf:type Shelf', 'table1 rdf:type Table',
                'table2 rdf:type Table', 'table2 hasColor blue',
                'Banana rdfs:subClassOf Plant', 'y_banana rdf:type Banana',
                'y_banana hasColor yellow', 'y_banana isOn shelf1',
                'green_banana rdf:type Banana', 'green_banana hasColor green',
                'green_banana isOn table2', 'ACCESSKIT rdf:type Gamebox',
                'ACCESSKIT hasColor white', 'ACCESSKIT hasSize big',
                'ACCESSKIT isOn table1', 'ORANGEBOX rdf:type Gamebox',
                'ORANGEBOX hasColor orange', 'ORANGEBOX hasSize big',
                'ORANGEBOX isOn ACCESSKIT', 'MYBOX rdf:type Gamebox',
                'MYBOX hasColor orange', 'MYBOX hasSize small',
                'MYBOX isOn ACCESSKIT', 'SPACENAVBOX rdf:type Gamebox',
                'SPACENAVBOX hasColor white', 'SPACENAVBOX hasSize big',
                'SPACENAVBOX isOn ACCESSKIT', 'y_bottle rdf:type Bottle',
                'y_bottle isLocated RIGHT', 'r_bottle rdf:type Bottle',
                'r_bottle isLocated FRONT', 'b_bottle rdf:type Bottle',
                'b_bottle isLocated BACK'
            ])
        except AttributeError:  #the ontology server is not started of doesn't know the method
            pass
    def setUp(self):
        self.dialog = Dialog()
        self.dialog.start()

        self.oro = ResourcePool().ontology_server

        try:

            self.oro.add(['ACHILLE rdf:type Human',
                          'ACHILLE rdfs:label Achille',
                          'JULIE rdf:type Human',
                          'JULIE rdfs:label Julie',
                          'table1 rdf:type Table',
                          'Trashbin rdfs:subClassOf Box',
                          'CardBoardBox rdfs:subClassOf Box',
                          'CardBoardBox rdfs:label "cardboard box"',
                          'TRASHBIN rdf:type Trashbin',
                          'CARDBOARD_BOX rdf:type CardBoardBox',
                          'CARDBOARD_BOX isOn table1',
                          'TAPE1 rdf:type VideoTape',
                          'TAPE1 rdfs:label "The Lords of the robots"',
                          'TAPE1 isOn table1',
                          'TAPE2 rdf:type VideoTape',
                          'TAPE2 rdfs:label "Jido-E"',
                          'TAPE2 isOn table1',

                          'VideoTape owl:equivalentClass Tape',
                          'TAPE1 owl:differentFrom TAPE2',
            ])
        except AttributeError:
            pass

        try:

            self.oro.addForAgent(ResourcePool().get_model_mapping('ACHILLE'),
                                 ['ACHILLE rdf:type Human',
                                  'ACHILLE rdfs:label Achille',
                                  'JULIE rdf:type Human',
                                  'JULIE rdfs:label Julie',
                                  'table1 rdf:type Table',
                                  'Trashbin rdfs:subClassOf Box',
                                  'CardBoardBox rdfs:subClassOf Box',
                                  'CardBoardBox rdfs:label "cardboard box"',
                                  'TRASHBIN rdf:type Trashbin',
                                  'CARDBOARD_BOX rdf:type CardBoardBox',
                                  'CARDBOARD_BOX isOn table1',
                                  'TAPE1 rdf:type VideoTape',
                                  'TAPE1 rdfs:label "The Lords of the robots"',
                                  'TAPE1 isOn table1',
                                  'TAPE2 rdf:type VideoTape',
                                  'TAPE2 rdfs:label "Jido-E"',
                                  'TAPE2 isOn table1',

                                  'VideoTape owl:equivalentClass Tape',

                                  'TAPE1 owl:differentFrom TAPE2',
                                 ])
        except AttributeError:
            pass
    def setUp(self):
        self.dialog = Dialog()
        self.dialog.start()

        self.oro = ResourcePool().ontology_server

        try:
            self.oro.add(['shelf1 rdf:type Shelf',
                          'table1 rdf:type Table',
                          'table2 rdf:type Table',
                          'table2 hasColor blue',
                          'Banana rdfs:subClassOf Plant',
                          'y_banana rdf:type Banana',
                          'y_banana hasColor yellow',
                          'y_banana isAt LEFT',
                          'y_banana isAt shelf1_front', 'shel1_front rdf:type Location',
                          'LEFT isLeftOf myself', 'LEFT rdf:type Location',
                          'shelf1_front isFrontOf shelf1',
                          'green_banana rdf:type Banana',
                          'green_banana hasColor green',
                          'green_banana isOn table2',
                          'green_banana isAt FRONT', 'FRONT rdf:type Location',
                          'FRONT isFrontOf myself',
                          'myself focusesOn y_banana',
                          'myself rdfs:label "Jido"',
                          'myself sees id_tom',
                          'myself sees y_banana',
                          'myself sees shelf1',
                          'myself_name rdf:type Name',
                          'myself_name belongsTo myself',
                          'myself_name rdfs:label "Jido"',
                          'id_tom rdf:type Human',
                          'id_tom rdfs:label "Tom"',
                          'id_tom isNextTo myself',
                          'Banana rdfs:subClassOf Object',
            ])

        except AttributeError: #the ontology server is not started of doesn't know the method
            pass
Esempio n. 4
0
    def setUp(self):
        self.dialog = Dialog()
        self.dialog.start()

        self.oro = ResourcePool().ontology_server

        try:

            self.oro.add([
                'ACHILLE rdf:type Human',
                'ACHILLE rdfs:label Achille',
                'JULIE rdf:type Human',
                'JULIE rdfs:label Julie',
                'TABLE rdf:type Table',
                'Trashbin rdfs:subClassOf Box',
                'CardBoardBox rdfs:subClassOf Box',
                'CardBoardBox rdfs:label "cardboard box"',
                'TRASHBIN rdf:type Trashbin',
                'CARDBOARD_BOX rdf:type CardBoardBox',
                'CARDBOARD_BOX isOn TABLE',
                'TAPE1 rdf:type VideoTape',
                'TAPE1 rdfs:label "The Lords of the robots"',
                'TAPE1 isOn TABLE',
                'TAPE2 rdf:type VideoTape',
                'TAPE2 rdfs:label "Jido-E"',
                'TAPE2 isOn TABLE',
                'VideoTape owl:equivalentClass Tape',
                'TAPE1 owl:differentFrom TAPE2',
            ])
            """           
            self.oro.addForAgent('ACHILLE',
                        ['BLUE_TRASHBIN rdf:type Trashbin',
                        'PINK_TRASHBIN rdf:type Trashbin',
                        'BLACK_TAPE rdf:type VideoTape', 'BLACK_TAPE isIn PINK_TRASHBIN',
                        'GREY_TAPE rdf:type VideoTape', 'GREY_TAPE isOn HRP2TABLE'])
            """
        except AttributeError:  #the ontology server is not started of doesn't know the method
            print(
                "Couldn't connect to the ontology server. Aborting the test.")
            raise

        try:
            self.oro.addForAgent('ACHILLE', [
                'ACHILLE rdf:type Human',
                'ACHILLE rdfs:label Achille',
                'JULIE rdf:type Human',
                'JULIE rdfs:label Julie',
                'TABLE rdf:type Table',
                'Trashbin rdfs:subClassOf Box',
                'CardBoardBox rdfs:subClassOf Box',
                'CardBoardBox rdfs:label "cardboard box"',
                'TRASHBIN rdf:type Trashbin',
                'CARDBOARD_BOX rdf:type CardBoardBox',
                'CARDBOARD_BOX isOn TABLE',
                'TAPE1 rdf:type VideoTape',
                'TAPE1 rdfs:label "The Lords of the robots"',
                'TAPE1 isOn TABLE',
                'TAPE2 rdf:type VideoTape',
                'TAPE2 rdfs:label "Jido-E"',
                'TAPE2 isOn TABLE',
                'VideoTape owl:equivalentClass Tape',
                'TAPE1 owl:differentFrom TAPE2',
            ])
        except AttributeError:  #the ontology server is not started of doesn't know the method
            print(
                "Couldn't connect to the ontology server. Aborting the test.")
            raise

        try:
            self.oro.addForAgent('JULIE', [
                'ACHILLE rdf:type Human',
                'ACHILLE rdfs:label Achille',
                'JULIE rdf:type Human',
                'JULIE rdfs:label Julie',
                'TABLE rdf:type Table',
                'Trashbin rdfs:subClassOf Box',
                'CardBoardBox rdfs:subClassOf Box',
                'CardBoardBox rdfs:label "cardboard box"',
                'TRASHBIN rdf:type Trashbin',
                'CARDBOARD_BOX rdf:type CardBoardBox',
                'CARDBOARD_BOX isOn TABLE',
                'TAPE1 rdf:type VideoTape',
                'TAPE1 rdfs:label "The Lords of the robots"',
                'TAPE1 isOn TABLE',
                'TAPE2 rdf:type VideoTape',
                'TAPE2 rdfs:label "Jido-E"',
                'TAPE2 isOn TABLE',
                'VideoTape owl:equivalentClass Tape',
                'TAPE1 owl:differentFrom TAPE2',
            ])
        except AttributeError:  #the ontology server is not started of doesn't know the method
            print(
                "Couldn't connect to the ontology server. Aborting the test.")
            raise