From fa5dc731f4bd5e9e6b127495b77ccb8043ee8c53 Mon Sep 17 00:00:00 2001 From: Guillaume Sarthou Date: Thu, 7 Nov 2024 12:45:23 +0100 Subject: [PATCH] [Ontology] dedicated objects file --- files/attribute.owl | 261 +------------------- files/objects.owl | 282 ++++++++++++++++++++++ files/test_individuals.owl | 18 +- src/tests/CI/api_relations_index_test.cpp | 6 +- src/tests/CI/api_relations_test.cpp | 6 +- src/tests/CI/feature_deep_copy_test.cpp | 4 +- src/tests/CI/feature_loading_test.cpp | 28 +-- 7 files changed, 313 insertions(+), 292 deletions(-) create mode 100644 files/objects.owl diff --git a/files/attribute.owl b/files/attribute.owl index 0f6da65f..0093682b 100644 --- a/files/attribute.owl +++ b/files/attribute.owl @@ -39,14 +39,6 @@ - - - - - - - - @@ -56,17 +48,6 @@ - - - - - - affairs are every little non alive objects - affaire - - - - @@ -105,102 +86,6 @@ - - - - - - - - - - - - - - blue book - - - - - - - - - - blue lamp - - - - - - - - - livre - - - - - - - - - boite - - - - - - - - - - - - - - - - - - - - - - - - - cube - - - - - - - - - tasse - - - - - - - - - - - - - - - - - - - - @@ -212,16 +97,6 @@ - - - - - - ventilateur - - - - @@ -232,16 +107,6 @@ - - - - - - meuble - - - - @@ -263,16 +128,6 @@ - - - - - - green cup - - - - @@ -293,16 +148,6 @@ - - - - - - lampe - - - - @@ -352,17 +197,6 @@ - - - - - - an object is an inanimated entity - objet - - - - @@ -401,84 +235,16 @@ - - - - - - red bed - - - - - - - - - - red fan - - - - - + capteur - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cassette - - - - - - - - - - - a technical object can also be an affair or a furniture - objet technique - technical object - affair -furniture - - - - @@ -489,15 +255,6 @@ furniture - - - - - poubelle - - - - @@ -547,14 +304,6 @@ furniture /////////////////////////////////////////////////////////////////////////////////////// --> - - - - - - - - @@ -563,14 +312,6 @@ furniture - - - - - - - - diff --git a/files/objects.owl b/files/objects.owl new file mode 100644 index 00000000..918f93c3 --- /dev/null +++ b/files/objects.owl @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + affairs are every little non alive objects + affaire + + + + + + + + + + + + + + + + + + blue book + + + + + + + + + + blue lamp + + + + + + + + + livre + + + + + + + + + boite + + + + + + + + + + + + + + + + + cube + + + + + + + + + tasse + + + + + + + + + + + + + + + + + + + + + + + + + + ventilateur + + + + + + + + + + meuble + + + + + + + + + + green cup + + + + + + + + + + lampe + + + + + + + + + + an object is an inanimated entity + objet + + + + + + + + + + red Bed + + + + + + + + + + red fan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cassette + + + + + + + + + + a technical object can also be an Affair or a furniture + objet technique + technical object + + + + + + + + + poubelle + + + + + + + + + + + + + + + + + + + diff --git a/files/test_individuals.owl b/files/test_individuals.owl index bd9ae544..de2d8f6d 100644 --- a/files/test_individuals.owl +++ b/files/test_individuals.owl @@ -3,8 +3,8 @@ xml:base="test_individuals" xmlns:indivs="https://github.com/sarthou/ontologenius/blob/master/files/test_individuals#" xmlns:agents="https://github.com/sarthou/ontologenius/blob/master/files/agents#" - xmlns:attribute="https://github.com/sarthou/ontologenius/blob/master/files/attribute#" xmlns:color="https://github.com/sarthou/ontologenius/blob/master/files/color#" + xmlns:objects="https://github.com/sarthou/ontologenius/blob/master/files/objects#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:xml="http://www.w3.org/XML/1998/namespace" @@ -12,10 +12,10 @@ xmlns:positionProperty="ontologenius/positionProperty#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> - + @@ -57,7 +57,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -76,7 +76,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -110,7 +110,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -128,7 +128,7 @@ - + cube rouge diff --git a/src/tests/CI/api_relations_index_test.cpp b/src/tests/CI/api_relations_index_test.cpp index 858bcc8b..991343b6 100644 --- a/src/tests/CI/api_relations_index_test.cpp +++ b/src/tests/CI/api_relations_index_test.cpp @@ -32,7 +32,7 @@ TEST(api_relations_index, class_getRelationFrom) (std::find(res.begin(), res.end(), onto_ptr->conversion.objectPropertiesId2Index("hasParent")) != res.end())); EXPECT_TRUE(res_bool); - test_word = onto_ptr->conversion.classesId2Index("cube"); + test_word = onto_ptr->conversion.classesId2Index("Cube"); res = onto_ptr->classes.getRelationFrom(test_word); EXPECT_TRUE(res.empty()); } @@ -168,7 +168,7 @@ TEST(api_relations_index, class_getRelationWith) (std::find(res.begin(), res.end(), onto_ptr->conversion.classesId2Index("Woman")) != res.end())); EXPECT_TRUE(res_bool); - test_word = onto_ptr->conversion.classesId2Index("cube"); + test_word = onto_ptr->conversion.classesId2Index("Cube"); res = onto_ptr->classes.getRelationWith(test_word); EXPECT_TRUE(res.empty()); } @@ -303,7 +303,7 @@ TEST(api_relations_index, class_getOn) (std::find(res.begin(), res.end(), onto_ptr->conversion.classesId2Index("Man")) != res.end())); EXPECT_TRUE(res_bool); - test_word = onto_ptr->conversion.classesId2Index("cube"); + test_word = onto_ptr->conversion.classesId2Index("Cube"); test_word2 = onto_ptr->conversion.objectPropertiesId2Index("isOn"); res = onto_ptr->classes.getOn(test_word, test_word2); EXPECT_TRUE(res.empty()); diff --git a/src/tests/CI/api_relations_test.cpp b/src/tests/CI/api_relations_test.cpp index 7bcb8e24..a07a75d7 100644 --- a/src/tests/CI/api_relations_test.cpp +++ b/src/tests/CI/api_relations_test.cpp @@ -30,7 +30,7 @@ TEST(api_relations, class_getRelationFrom) (std::find(res.begin(), res.end(), "hasParent") != res.end())); EXPECT_TRUE(res_bool); - res = onto_ptr->classes.getRelationFrom("cube"); + res = onto_ptr->classes.getRelationFrom("Cube"); EXPECT_TRUE(res.empty()); } @@ -149,7 +149,7 @@ TEST(api_relations, class_getRelationWith) (std::find(res.begin(), res.end(), "Woman") != res.end())); EXPECT_TRUE(res_bool); - res = onto_ptr->classes.getRelationWith("cube"); + res = onto_ptr->classes.getRelationWith("Cube"); EXPECT_TRUE(res.empty()); } @@ -259,7 +259,7 @@ TEST(api_relations, class_getOn) (std::find(res.begin(), res.end(), "Man") != res.end())); EXPECT_TRUE(res_bool); - res = onto_ptr->classes.getOn("cube", "isOn"); + res = onto_ptr->classes.getOn("Cube", "isOn"); EXPECT_TRUE(res.empty()); } diff --git a/src/tests/CI/feature_deep_copy_test.cpp b/src/tests/CI/feature_deep_copy_test.cpp index 4976bc21..586e87fd 100644 --- a/src/tests/CI/feature_deep_copy_test.cpp +++ b/src/tests/CI/feature_deep_copy_test.cpp @@ -35,9 +35,9 @@ TEST(feature_deep_copy, copy) EXPECT_EQ(onto1.individual_graph_.getUp(indiv).size(), 11); EXPECT_EQ(onto2.individual_graph_.getUp(indiv).size(), 11); - std::string type = "cube"; + std::string type = "Cube"; onto2.individual_graph_.removeInheritage(indiv, type); - type = "object"; + type = "Object"; onto2.individual_graph_.addInheritage(indiv, type); std::cout << "onto1 " << onto1.individual_graph_.getUp(indiv).size() << std::endl; diff --git a/src/tests/CI/feature_loading_test.cpp b/src/tests/CI/feature_loading_test.cpp index a96193fd..fc0fc6cd 100644 --- a/src/tests/CI/feature_loading_test.cpp +++ b/src/tests/CI/feature_loading_test.cpp @@ -16,7 +16,7 @@ TEST(feature_loading, reset) res = onto_ptr->classes.find("affair"); EXPECT_EQ(res.size(), 1); if(res.empty() == false) - EXPECT_EQ(res.front(), "affair"); + EXPECT_EQ(res.front(), "Affair"); res = onto_ptr->classes.find("bird"); EXPECT_EQ(res.size(), 1); @@ -29,7 +29,7 @@ TEST(feature_loading, reset) res = onto_ptr->classes.find("affair"); EXPECT_NE(res.size(), 1); if(res.empty() == false) - EXPECT_NE(res.front(), "affair"); + EXPECT_NE(res.front(), "Affair"); res = onto_ptr->classes.find("bird"); EXPECT_NE(res.size(), 1); @@ -46,7 +46,7 @@ TEST(feature_loading, reset) res = onto_ptr->classes.find("affair"); EXPECT_EQ(res.size(), 1); if(res.empty() == false) - EXPECT_EQ(res.front(), "affair"); + EXPECT_EQ(res.front(), "Affair"); res = onto_ptr->classes.find("bird"); EXPECT_NE(res.size(), 1); @@ -60,7 +60,7 @@ TEST(feature_loading, language) EXPECT_TRUE(onto_ptr->actions.clear()); std::string path = ros::package::getPath("ontologenius"); - path += "/files/attribute.owl"; + path += "/files/objects.owl"; EXPECT_TRUE(onto_ptr->actions.fadd(path)); EXPECT_TRUE(onto_ptr->actions.close()); @@ -71,27 +71,25 @@ TEST(feature_loading, language) res = onto_ptr->classes.find(test_word); EXPECT_EQ(res.size(), 1); if(res.empty() == false) - EXPECT_EQ(res.front(), "affair"); + EXPECT_EQ(res.front(), "Affair"); - EXPECT_TRUE(onto_ptr->classes.getName(test_word) == "affair"); - EXPECT_FALSE(onto_ptr->classes.getName(test_word) == "affaire"); + EXPECT_TRUE(onto_ptr->classes.getName("Affair") == "affair"); + EXPECT_FALSE(onto_ptr->classes.getName("Affair") == "affaire"); EXPECT_TRUE(onto_ptr->actions.setLang("fr")); - res = onto_ptr->classes.find(test_word); + res = onto_ptr->classes.find("Affair"); EXPECT_EQ(res.size(), 1); if(res.empty() == false) - EXPECT_EQ(res.front(), "affair"); + EXPECT_EQ(res.front(), "Affair"); - test_word = "affaire"; - res = onto_ptr->classes.find(test_word); + res = onto_ptr->classes.find("affaire"); EXPECT_EQ(res.size(), 1); if(res.empty() == false) - EXPECT_EQ(res.front(), "affair"); + EXPECT_EQ(res.front(), "Affair"); - test_word = "affair"; - EXPECT_TRUE(onto_ptr->classes.getName(test_word) == "affaire"); - EXPECT_FALSE(onto_ptr->classes.getName(test_word) == "affair"); + EXPECT_TRUE(onto_ptr->classes.getName("Affair") == "affaire"); + EXPECT_FALSE(onto_ptr->classes.getName("Affair") == "Affair"); } int main(int argc, char** argv)