diff --git a/Modules/CMakeLists.txt b/Modules/CMakeLists.txt index 8656ec9f6b..4e26bba15a 100644 --- a/Modules/CMakeLists.txt +++ b/Modules/CMakeLists.txt @@ -1,80 +1,81 @@ # Modules must be listed according to their dependencies set(module_dirs + RDF LegacyIO DataTypesExt AlgorithmsExt MapperExt DICOMReader DICOMTesting Qt4Qt5TestModule SceneSerializationBase PlanarFigure ImageDenoising ImageExtraction ImageStatistics LegacyAdaptors SceneSerialization GraphAlgorithms ContourModel SurfaceInterpolation Segmentation PlanarFigureSegmentation OpenViewCore QmlItems Overlays QtWidgets QtWidgetsExt SegmentationUI DiffusionImaging GPGPU IGTBase IGT CameraCalibration RigidRegistration RigidRegistrationUI DeformableRegistration DeformableRegistrationUI OpenCL OpenCVVideoSupport QtOverlays InputDevices ToFHardware ToFProcessing ToFUI US USUI DicomUI Simulation Remeshing Python Persistence IGTUI VtkShaders DicomRT IOExt ) if(MITK_ENABLE_PIC_READER) list(APPEND module_dirs IpPicSupportIO) endif() set(MITK_DEFAULT_SUBPROJECTS MITK-Modules) foreach(module_dir ${module_dirs}) add_subdirectory(${module_dir}) endforeach() if(MITK_PRIVATE_MODULES) file(GLOB all_subdirs RELATIVE ${MITK_PRIVATE_MODULES} ${MITK_PRIVATE_MODULES}/*) foreach(subdir ${all_subdirs}) string(FIND ${subdir} "." _result) if(_result EQUAL -1) if(EXISTS ${MITK_PRIVATE_MODULES}/${subdir}/CMakeLists.txt) message(STATUS "Found private module ${subdir}") add_subdirectory(${MITK_PRIVATE_MODULES}/${subdir} private_modules/${subdir}) endif() endif() endforeach() endif(MITK_PRIVATE_MODULES) diff --git a/Modules/RDF/CMakeLists.txt b/Modules/RDF/CMakeLists.txt new file mode 100644 index 0000000000..56363dc4b6 --- /dev/null +++ b/Modules/RDF/CMakeLists.txt @@ -0,0 +1,6 @@ +mitk_create_module(PACKAGE_DEPENDS Redland + WARNINGS_AS_ERRORS + ) + +add_subdirectory(Testing) + diff --git a/Modules/RDF/Documentation/Doxygen/Modules.dox b/Modules/RDF/Documentation/Doxygen/Modules.dox new file mode 100644 index 0000000000..bffddac499 --- /dev/null +++ b/Modules/RDF/Documentation/Doxygen/Modules.dox @@ -0,0 +1,8 @@ +/** + \defgroup MitkRDFModule MitkRDF + \ingroup MITKModules + + \brief MITK RDF Library + + This module provides classes to work with RDF concepts and data formats. +*/ diff --git a/Modules/RDF/Testing/CMakeLists.txt b/Modules/RDF/Testing/CMakeLists.txt new file mode 100644 index 0000000000..42638c56cd --- /dev/null +++ b/Modules/RDF/Testing/CMakeLists.txt @@ -0,0 +1 @@ +mitk_create_module_tests() diff --git a/Modules/RDF/Testing/files.cmake b/Modules/RDF/Testing/files.cmake new file mode 100644 index 0000000000..686370ac21 --- /dev/null +++ b/Modules/RDF/Testing/files.cmake @@ -0,0 +1,7 @@ +# tests with no extra command line parameter +set(MODULE_TESTS + mitkRdfNodeTest.cpp +) + +set(RESOURCE_FILES +) diff --git a/Modules/RDF/Testing/mitkRdfNodeTest.cpp b/Modules/RDF/Testing/mitkRdfNodeTest.cpp new file mode 100644 index 0000000000..c34ebd8a30 --- /dev/null +++ b/Modules/RDF/Testing/mitkRdfNodeTest.cpp @@ -0,0 +1,52 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkTestingMacros.h" +#include +#include + +#include "mitkRdfNode.h" + +class mitkRdfNodeTestSuite : public mitk::TestFixture +{ + // List of Tests + CPPUNIT_TEST_SUITE(mitkRdfNodeTestSuite); + + MITK_TEST(TestDummy); + + CPPUNIT_TEST_SUITE_END(); + +public: + + void setUp() + { + } + + void tearDown() + { + } + + // Test functions + + void TestDummy() + { + mitk::RdfNode node; + CPPUNIT_ASSERT(node.dummy() == true); + } + +}; + +MITK_TEST_SUITE_REGISTRATION(mitkRdfNode) diff --git a/Modules/RDF/files.cmake b/Modules/RDF/files.cmake new file mode 100644 index 0000000000..4fd8b64962 --- /dev/null +++ b/Modules/RDF/files.cmake @@ -0,0 +1,3 @@ +set(CPP_FILES + mitkRdfNode.cpp +) diff --git a/Modules/RDF/mitkRdfNode.cpp b/Modules/RDF/mitkRdfNode.cpp new file mode 100644 index 0000000000..73563bcbe9 --- /dev/null +++ b/Modules/RDF/mitkRdfNode.cpp @@ -0,0 +1,68 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkRdfNode.h" + +#include +#include +#include +#include + +#include + +namespace mitk { + +bool RdfNode::dummy() +{ + librdf_world* world; + librdf_storage *storage; + librdf_model* model; + librdf_statement* statement; + raptor_world *raptor_world_ptr; + raptor_iostream* iostr; + + world=librdf_new_world(); + librdf_world_open(world); + raptor_world_ptr = librdf_world_get_raptor(world); + + model=librdf_new_model(world, storage=librdf_new_storage(world, "hashes", NULL, "hash-type='memory'"), NULL); + + librdf_model_add_statement(model, + statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://www.dajobe.org/"), + librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/creator"), + librdf_new_node_from_literal(world, (const unsigned char*)"Dave Beckett", NULL, 0) + ) + ); + + librdf_free_statement(statement); + + iostr = raptor_new_iostream_to_file_handle(raptor_world_ptr, stdout); + librdf_model_write(model, iostr); + raptor_free_iostream(iostr); + + librdf_free_model(model); + librdf_free_storage(storage); + + librdf_free_world(world); + +#ifdef LIBRDF_MEMORY_DEBUG + librdf_memory_report(stderr); +#endif + + return true; +} + +} diff --git a/Modules/RDF/mitkRdfNode.h b/Modules/RDF/mitkRdfNode.h new file mode 100644 index 0000000000..83d8d99678 --- /dev/null +++ b/Modules/RDF/mitkRdfNode.h @@ -0,0 +1,39 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + + +#ifndef MITKRDFNODE_H +#define MITKRDFNODE_H + +#include + +namespace mitk { + +/** + * \ingroup MitkRDFModule + */ +class MitkRDF_EXPORT RdfNode +{ + +public: + + bool dummy(); + +}; + +} + +#endif