Skip to content
Snippets Groups Projects
Select Git revision
  • 4ded93d77b8878e54dc71c34070fdc7aa76b240f
  • mui5-annotation-on-video-stable default
  • get_setter_canvasSizeInformations
  • fix-error-div-into-p
  • annotation-on-video-v2
  • detached
  • annotation-on-video-r17
  • mui5
  • mui5-react-18
  • jacob-test
  • annotation-on-video protected
  • master
  • test-antoinev1
  • 20-fetch-thumbnail-on-annotation
  • add-research-field
  • Save
  • add-plugin
  • 14-wip-no-seek-to
  • 14-bug-on-video-time-control
  • 9_wip_videotests
  • _upgrade_material_ui
  • latest-tetras-16
  • v3.3.0
  • v3.2.0
  • v3.1.1
  • v3.1.0
  • v3.0.0
  • v3.0.0-rc.7
  • v3.0.0-rc.6
  • v3.0.0-rc.5
  • v3.0.0-rc.4
  • v3.0.0-rc.3
  • v3.0.0-rc.2
  • v3.0.0-rc.1
  • v3.0.0-beta.10
  • v3.0.0-beta.9
  • v3.0.0-beta.8
  • v3.0.0-beta.7
  • v3.0.0-beta.6
  • v3.0.0-beta.5
  • v3.0.0-beta.3
41 results

webpack.config.js

Blame
  • test_ontology_submodules.py 3.34 KiB
    #!/usr/bin/python3.10
    # -*-coding:Utf-8 -*
    
    #==============================================================================
    # test_ontology_modules: Ontology Modules Testing
    #------------------------------------------------------------------------------
    # Contains tests for verifying functionality of the ontology submodules.
    #==============================================================================
    
    import unittest
    from rdflib import URIRef
    
    # Importing necessary modules from the ontoScorer package for testing.
    from context import ontoScorer
    from ontoScorer.ontology_axioms import *
    from ontoScorer.ontology_nontaxonomic_relations import *
    from ontoScorer.ontology_taxonomic_relations import *
    
    #--------------------------------------------------------------------------
    # Ontology Taxonomic Relations Test
    #--------------------------------------------------------------------------
    class TestOntologyTaxonomicRelations(unittest.TestCase):
    
        def setUp(self):
            # Any necessary setup can be done here...
            pass
    
        def test_subclass_of_relation(self):
            relation = SubclassOfRelation(URIRef("http://example.com#Subclass"), URIRef("http://example.com#Superclass"), None)
            self.assertEqual(str(relation), "http://example.com#Subclass is a subclass of http://example.com#Superclass")
    
        # Additional test methods for other taxonomic relations can be added here...
        
        
    
    #--------------------------------------------------------------------------
    # Ontology Non-Taxonomic Relations Test
    #--------------------------------------------------------------------------
    class TestOntologyNonTaxonomicRelations(unittest.TestCase):
    
        def setUp(self):
            # Any necessary setup can be done here...
            pass
    
        def test_object_property_relation(self):
            relation = ObjectPropertyRelation(URIRef("http://example.com#Source"), URIRef("http://example.com#Target"), None)
            self.assertEqual(str(relation), "http://example.com#Source has object property http://example.com#Target")
    
        # Additional test methods for other non-taxonomic relations can be added here...
        
        
    
    #--------------------------------------------------------------------------
    # Ontology Axioms Test
    #--------------------------------------------------------------------------
    class TestOntologyAxioms(unittest.TestCase):
    
        def setUp(self):
            # Any necessary setup can be done here...
            pass
    
        def test_restriction_axiom(self):
            axiom = RestrictionAxiom(URIRef("http://example.com#SomeClass"))
            self.assertEqual(str(axiom), "Restriction on: http://example.com#SomeClass")
    
        def test_some_values_from_restriction(self):
            restriction_node = BNode()
            on_property = URIRef("http://example.org/hasPart")
            some_values_from = URIRef("http://example.org/Hand")
            restriction = SomeValuesFromRestrictionAxiom(restriction_node, on_property, some_values_from)
            self.assertEqual(str(restriction), "Restriction on: {} via property: http://example.org/hasPart with some values from: http://example.org/Hand".format(restriction_node))
    
        # Additional test methods for other axiom types can be added here...
    
    
    
    
    #--------------------------------------------------------------------------
    # Main Unit Test Run
    #--------------------------------------------------------------------------
    if __name__ == "__main__":
        unittest.main()