Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,17 @@ target_link_libraries(rdf4cpp
highway::highway
)

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# fix __mulodi4 not being available on arm
# https://bugs.llvm.org/show_bug.cgi?id=16404
# link with both gcc and clangs runtime lib
target_link_libraries(rdf4cpp
PUBLIC
"-rtlib=compiler-rt"
"-lgcc_s"
)
endif()

set_target_properties(rdf4cpp PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,26 @@ cd build_dir
sudo make install
```

### Limits for Datatypes
By default, unlimited precision datatypes are limited in accordance with https://www.w3.org/TR/xmlschema11-2/#partial-implementation .

For `http://www.w3.org/2001/XMLSchema#integer`
(and the related: `http://www.w3.org/2001/XMLSchema#nonNegativeInteger`
`http://www.w3.org/2001/XMLSchema#positiveInteger` `http://www.w3.org/2001/XMLSchema#nonPositiveInteger`
`http://www.w3.org/2001/XMLSchema#negativeInteger`) this limit is a signed 128-bit integer
with the usual range of `[-2^127,2^127-1]`

And `http://www.w3.org/2001/XMLSchema#decimal` is composed of the following parts: `i/10^k`,
where `i` is a signed 128-bit integer (`[-2^127,2^127-1]`) and `k` is an unsigned 64-bit integer (`[0,2^64]`).

For `http://www.w3.org/2001/XMLSchema#dateTime` (and all derived types) there are 2 limits:
- represented as a time point with nanosecond precision with a 128-bit signed integer
- the year part alone in a 64-bit signed integer
Both limits are enough to cover both the current best theories of the big bang and the projected heat death of the universe.

For `http://www.w3.org/2001/XMLSchema#duration` (and all derived types), both parts have a separate signed 64-bit integer
and with it its associated limits. The seconds part of the duration supports nanosecond precision.

### Additional CMake config options:

- `-DBUILD_EXAMPLES=ON/OFF [default: OFF]`: Build the examples.
Expand Down
13 changes: 11 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import re

from conan.tools.cmake import cmake_layout, CMake
from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps

from conan import ConanFile

Expand All @@ -19,15 +19,16 @@ class Recipe(ConanFile):
"shared": [True, False],
"fPIC": [True, False],
"with_test_deps": [True, False],
"unlimited_datatypes": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"with_test_deps": False,
"unlimited_datatypes": False,
}
exports = "LICENSE",
exports_sources = "src/*", "private/*", "CMakeLists.txt", "cmake/*"
generators = ("CMakeDeps", "CMakeToolchain")

def requirements(self):
self.requires("boost/1.86.0", transitive_headers=True, libs=False)
Expand Down Expand Up @@ -58,6 +59,14 @@ def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def generate(self):
tc = CMakeToolchain(self)
if self.options.unlimited_datatypes:
tc.preprocessor_definitions["RDF4CPP_USE_UNLIMITED_DATATYPES"] = "1"
tc.generate()
cmake = CMakeDeps(self)
cmake.generate()

def layout(self):
cmake_layout(self)

Expand Down
1 change: 0 additions & 1 deletion docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,3 @@ ________________________________
* :code:`-DBUILD_EXAMPLES=ON/OFF [default: OFF]`: Build the examples.
* :code:`-DBUILD_TESTING=ON/OFF [default: OFF]`: Build the tests.
* :code:`-DBUILD_SHARED_LIBS=ON/OFF [default: OFF]`: Build a shared library instead of a static one.
* :code:`-DUSE_CONAN=ON/OFF [default: ON]`: If available, use Conan to retrieve dependencies.
25 changes: 25 additions & 0 deletions docs/source/users_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,31 @@ You can find all supported Datatypes here:
* :ref:`namespace_rdf4cpp__datatypes__rdf`: RDF datatypes (LangString).
* :ref:`namespace_rdf4cpp__datatypes__owl`: OWL datatypes.


Limits for Datatypes
++++++++++++++++++++
By default, unlimited precision datatypes are limited in accordance with https://www.w3.org/TR/xmlschema11-2/#partial-implementation .

For :code:`http://www.w3.org/2001/XMLSchema#integer`
(and the related: :code:`http://www.w3.org/2001/XMLSchema#nonNegativeInteger`
:code:`http://www.w3.org/2001/XMLSchema#positiveInteger` :code:`http://www.w3.org/2001/XMLSchema#nonPositiveInteger`
:code:`http://www.w3.org/2001/XMLSchema#negativeInteger`) this limit is a signed 128-bit integer
with the usual range of :code:`[-2^127,2^127-1]`

And :code:`http://www.w3.org/2001/XMLSchema#decimal` is composed of the following parts: :code:`i/10^k`,
where :code:`i` is a signed 128-bit integer (:code:`[-2^127,2^127-1]`) and :code:`k` is an unsigned 64-bit integer (:code:`[0,2^64]`).
ss
For :code:`http://www.w3.org/2001/XMLSchema#dateTime` (and all derived types) there are 2 limits:

* represented as a time point with nanosecond precision with a 128-bit signed integer
* the year part alone in a 64-bit signed integer

Both limits are enough to cover both the current best theories of the big bang and the projected heat death of the universe.

For :code:`http://www.w3.org/2001/XMLSchema#duration` (and all derived types), both parts have a separate signed 64-bit integer
and with it its associated limits. The seconds part of the duration supports nanosecond precision.


Parsing Files
-------------

Expand Down
Loading
Loading