diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 66517d67..4636b499 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: sudo apt update -qq sudo apt install dpkg sudo apt install -y ros-$ROS_DISTRO-desktop qtbase5-dev qtdeclarative5-dev - sudo apt install -y libcppunit-dev + sudo apt install -y libcppunit-dev libcurl4-openssl-dev if [ $ROS_DISTRO != noetic ] then sudo apt-get install python-rosdep diff --git a/.gitignore b/.gitignore index ee3d879b..ef2ef609 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ /file_intern/* *.pyc +catalog-v* # VsCode files settings.json \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef9f1787..4162e62d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,20 +8,6 @@ - cd .. - catkin_make -DCMAKE_BUILD_TYPE=Release -.test_script_template : &test_script_definition_py2 - script: - - mkdir -p ~/ros_ws/src - - cd ~/ros_ws - - catkin_make -DCMAKE_BUILD_TYPE=Release - - cd src - - cp -r /builds/$GITLAB_USER_LOGIN/ontologenius . - - cd .. - - pip install requests --user - - source devel/setup.bash - - catkin_make -DCMAKE_BUILD_TYPE=Release - - source devel/setup.bash - - catkin_make run_tests_ontologenius_rostest -j1 -DCMAKE_BUILD_TYPE=Release && catkin_make test -j1 -DCMAKE_BUILD_TYPE=Release - .test_script_template : &test_script_definition_py3 script: - mkdir -p ~/ros_ws/src @@ -36,32 +22,15 @@ - source devel/setup.bash - catkin_make run_tests_ontologenius_rostest -j1 -DCMAKE_BUILD_TYPE=Release && catkin_make test -j1 -DCMAKE_BUILD_TYPE=Release -.melodic_before_template : &melodic_before_definition - before_script: - - source /opt/ros/melodic/setup.bash - - apt-get update -qq && apt-get install -y libcppunit-1.14-0 libcppunit-dev libtinyxml-dev python-rosdep python-pip - .noetic_before_template : &noetic_before_definition before_script: - source /opt/ros/noetic/setup.bash - - apt-get update -qq && apt-get install -y libcppunit-1.15-0 libcppunit-dev libtinyxml-dev git-all python3-rosdep python3-pip + - apt-get update -qq && apt-get install -y libcppunit-1.15-0 libcppunit-dev libtinyxml-dev git-all python3-rosdep python3-pip libcurl4-openssl-dev stages: - build - test -run-test-melodic: - stage: test - image: ros:melodic-perception-bionic - <<: *melodic_before_definition - <<: *test_script_definition_py2 - -run-build-melodic: - image: ros:melodic-perception-bionic - stage: build - <<: *melodic_before_definition - <<: *build_script_definition - run-test-noetic: stage: test image: ros:noetic-perception-focal diff --git a/CMakeLists.txt b/CMakeLists.txt index a9449086..86b35f50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,20 @@ if(WITH_CLANG_TIDY) endif() include(cmake/Sanitizers.cmake) +function(add_onto_base_library TARGET) + if(NOT TARGET) + message(FATAL_ERROR "Expected the target name as first argument") + endif() + if(NOT ARGN) + message(FATAL_ERROR "Expected source file list after target name") + endif() + add_library(${TARGET} ${ARGN}) + target_include_directories(${TARGET} PUBLIC include) + set_target_properties(${TARGET} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) + target_compile_options(${TARGET} PRIVATE -Wall -Wextra) + target_enable_sanitizers(${TARGET}) +endfunction(add_onto_base_library) + function(add_onto_library TARGET) if(NOT TARGET) message(FATAL_ERROR "Expected the target name as first argument") @@ -18,13 +32,27 @@ function(add_onto_library TARGET) endif() add_library(${TARGET} ${ARGN}) add_dependencies(${TARGET} ontologenius_gencpp ${catkin_EXPORTED_TARGETS}) - target_include_directories(${TARGET} PUBLIC include PRIVATE ${catkin_INCLUDE_DIRS}) - target_link_libraries(${TARGET} PRIVATE ${catkin_LIBRARIES}) + target_include_directories(${TARGET} PUBLIC include ${catkin_INCLUDE_DIRS}) + target_link_libraries(${TARGET} PUBLIC ${catkin_LIBRARIES}) # PRIVATE has been removed fot ontoloGUI set_target_properties(${TARGET} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) target_compile_options(${TARGET} PRIVATE -Wall -Wextra) target_enable_sanitizers(${TARGET}) endfunction(add_onto_library) +function(add_onto_base_executable TARGET) + if(NOT TARGET) + message(FATAL_ERROR "Expected the target name as first argument") + endif() + if(NOT ARGN) + message(FATAL_ERROR "Expected source file list after target name") + endif() + add_executable(${TARGET} ${ARGN}) + target_include_directories(${TARGET} PUBLIC include) + set_target_properties(${TARGET} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) + target_compile_options(${TARGET} PRIVATE -Wall -Wextra) + target_enable_sanitizers(${TARGET}) +endfunction(add_onto_base_executable) + function(add_onto_executable TARGET) if(NOT TARGET) message(FATAL_ERROR "Expected the target name as first argument") @@ -48,19 +76,21 @@ endfunction(add_onto_executable) find_package(catkin REQUIRED COMPONENTS roscpp rospy + roslib std_msgs genmsg message_generation - pluginlib ) ## System dependencies are found with CMake's conventions -find_package(Boost REQUIRED COMPONENTS system) find_package(cmake_modules REQUIRED) find_package(TinyXML REQUIRED) find_package(OpenCV REQUIRED) find_package(pluginlib REQUIRED) find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport) +find_package(PkgConfig REQUIRED) + +pkg_search_module(CURL REQUIRED libcurl IMPORTED_TARGET GLOBAL) # Install python scripts using distutils catkin_python_setup() @@ -82,7 +112,6 @@ catkin_python_setup() ## Generate services in the 'srv' folder add_service_files( FILES - REST.srv OntologeniusConversion.srv OntologeniusService.srv OntologeniusIndexService.srv @@ -124,7 +153,7 @@ catkin_package( ## CORE ############################## -add_onto_library(ontologenius_ontoGraphs_lib +add_onto_base_library(ontologenius_ontoGraphs_lib src/core/ontoGraphs/Branchs/ClassBranch.cpp src/core/ontoGraphs/Branchs/ObjectPropertyBranch.cpp src/core/ontoGraphs/Branchs/DataPropertyBranch.cpp @@ -158,10 +187,10 @@ target_include_directories(ontologenius_ontoGraphs_lib ) target_link_libraries(ontologenius_ontoGraphs_lib PUBLIC - ${TinyXML_LIBRARIES} + ${TinyXML_LIBRARIES} PkgConfig::CURL ) -add_onto_library(ontologenius_core_lib +add_onto_base_library(ontologenius_core_lib src/core/feeder/Feeder.cpp src/core/feeder/FeedStorage.cpp src/core/feeder/Versionor.cpp @@ -170,16 +199,19 @@ add_onto_library(ontologenius_core_lib src/core/reasoner/Reasoners.cpp src/core/reasoner/ConfigReader.cpp ) +target_include_directories(ontologenius_core_lib + PUBLIC ${pluginlib_INCLUDE_DIRS} +) target_link_libraries(ontologenius_core_lib PUBLIC - ontologenius_ontoGraphs_lib + ontologenius_ontoGraphs_lib ${pluginlib_LIBRARIES} ) ############################## ## DRAWER ############################## -add_onto_library(ontologenius_drawer_lib +add_onto_base_library(ontologenius_drawer_lib src/graphical/versioning/TreeReader.cpp src/graphical/versioning/TreeDrawer.cpp ) @@ -221,6 +253,7 @@ add_onto_library(ontologenius_lib src/API/ontologenius/OntologyManipulatorIndex.cpp src/API/ontologenius/OntologiesManipulator.cpp ) +target_include_directories(ontologenius_lib PUBLIC include/ontologenius/API) target_link_libraries(ontologenius_lib PUBLIC ontologenius_core_lib @@ -229,7 +262,7 @@ target_link_libraries(ontologenius_lib ############################## ## PLUGINS ############################## -add_onto_library(ontologenius_reasoner_plugin +add_onto_base_library(ontologenius_reasoner_plugin src/core/reasoner/plugins/ReasonerNone.cpp src/core/reasoner/plugins/ReasonerInverseOf.cpp src/core/reasoner/plugins/ReasonerSymetric.cpp @@ -238,7 +271,21 @@ add_onto_library(ontologenius_reasoner_plugin src/core/reasoner/plugins/ReasonerGeneralize.cpp src/core/reasoner/plugins/ReasonerRangeDomain.cpp ) +target_include_directories(ontologenius_reasoner_plugin + PUBLIC ${pluginlib_INCLUDE_DIRS} +) target_link_libraries(ontologenius_reasoner_plugin + PUBLIC + ontologenius_core_lib ${pluginlib_LIBRARIES} +) + +add_onto_base_library(ontologenius_operators + src/core/ontologyOperators/differenceFinder.cpp + src/core/ontologyOperators/Sparql.cpp + src/core/ontologyOperators/SparqlSolver.cpp + src/core/ontologyOperators/SparqlUtils.cpp +) +target_link_libraries(ontologenius_operators PUBLIC ontologenius_core_lib ) @@ -251,14 +298,10 @@ add_onto_library(ontologenius_interface src/interface/RosInterface.cpp src/interface/RosInterfaceStringHandlers.cpp src/interface/RosInterfaceIndexHandlers.cpp - src/core/ontologyOperators/differenceFinder.cpp - src/core/ontologyOperators/Sparql.cpp - src/core/ontologyOperators/SparqlSolver.cpp - src/core/ontologyOperators/SparqlUtils.cpp ) target_link_libraries(ontologenius_interface PUBLIC - ontologenius_core_lib + ontologenius_core_lib ontologenius_operators ) ############################## @@ -277,7 +320,7 @@ target_link_libraries(ontologenius PRIVATE ontologenius_interface) add_onto_executable(ontologenius_multi src/nodes/ontologenius_multi.cpp) target_link_libraries(ontologenius_multi PRIVATE ontologenius_interface) -add_onto_executable(ontologenius_draw src/graphical/versioning/main.cpp ) +add_onto_base_executable(ontologenius_draw src/graphical/versioning/main.cpp ) target_link_libraries(ontologenius_draw PRIVATE ontologenius_drawer_lib ontologenius_core_lib) ############################## @@ -362,16 +405,11 @@ set( QT_SOURCES ############################################################################## add_executable(ontoloGUI ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP}) -target_include_directories(ontoloGUI - PRIVATE - ${catkin_INCLUDE_DIRS} -) -add_dependencies(ontoloGUI ontologenius_gencpp) target_link_libraries(ontoloGUI - ${catkin_LIBRARIES} Qt5::Core Qt5::Widgets Qt5::PrintSupport + ontologenius_lib ) install(TARGETS ontoloGUI RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) @@ -394,10 +432,6 @@ install(DIRECTORY include/${PROJECT_NAME}/ PATTERN ".svn" EXCLUDE ) -install(PROGRAMS scripts/REST.py - DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION} -) - install(DIRECTORY launch/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch ) diff --git a/README.md b/README.md index 831dce93..015c441d 100644 --- a/README.md +++ b/README.md @@ -21,4 +21,4 @@ On this launcher file, you will find an argument indicating the path to the onto You can add your own ontology files in the argument if you want them to be loaded at the beginning of the program. [Release-Url]: https://sarthou.github.io/ontologenius/ -[Release-image]: http://img.shields.io/badge/release-v0.3.1-1eb0fc.svg +[Release-image]: http://img.shields.io/badge/release-v0.3.2-1eb0fc.svg diff --git a/docs/Download.html b/docs/Download.html index f58faac9..71e36138 100644 --- a/docs/Download.html +++ b/docs/Download.html @@ -1,7 +1,7 @@ - Download | Ontologenius 0.3.1 + Download | Ontologenius 0.3.2 @@ -90,8 +90,33 @@

Download

You have below the archives of the major versions of Ontologenius:

+

V0.3.2

+

8 / 12 / 2023

+ + +

V0.3.1

-

XX / XX / 2023

+

12 / 09 / 2023