Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e6f48d1
basic xml parsing
mcb5637 Nov 6, 2025
2c92962
api, remove uneccesary graph
mcb5637 Nov 6, 2025
105e65d
fix sanitizer
mcb5637 Nov 7, 2025
24b3c03
cleanup
mcb5637 Nov 7, 2025
4c1b52e
entities
mcb5637 Nov 12, 2025
e518b99
more syntax+tests
mcb5637 Nov 12, 2025
e112429
base scoping
mcb5637 Nov 12, 2025
d040b2e
more tests
mcb5637 Nov 12, 2025
cfd7664
parsing state
mcb5637 Nov 13, 2025
db888f8
triples in properties
mcb5637 Nov 13, 2025
55d2cc9
more tests
mcb5637 Nov 13, 2025
ede429f
wip xml literal
mcb5637 Nov 14, 2025
ea0a1ae
cleanup
mcb5637 Nov 14, 2025
74a2538
collection
mcb5637 Nov 14, 2025
48e63c6
reifycation
mcb5637 Nov 19, 2025
97327ed
lang tag
mcb5637 Nov 19, 2025
b74a806
some cleanup
mcb5637 Nov 19, 2025
fb86ba8
list
mcb5637 Nov 20, 2025
1f7f0cc
more cleanup
mcb5637 Nov 20, 2025
c1eebb0
one parser to rule them all
mcb5637 Nov 21, 2025
0098e62
try fix gcc error
mcb5637 Nov 21, 2025
9251a7f
another gcc fix
mcb5637 Nov 21, 2025
48adc71
cleanup
mcb5637 Nov 26, 2025
df06c32
Merge branch 'develop' into feature/parse_xml
mcb5637 Nov 26, 2025
a2dbc6f
initial base
mcb5637 Nov 26, 2025
dfd809c
xmlliteral tests, cleanup
mcb5637 Nov 27, 2025
d64130a
fixes
mcb5637 Nov 28, 2025
5e8bac8
inplace poly
mcb5637 Nov 28, 2025
40c0f5a
doc
mcb5637 Nov 28, 2025
7f4261f
reorganize
mcb5637 Dec 3, 2025
c40d4dd
separate states
mcb5637 Dec 3, 2025
5ca0c2f
fix gcc14 bug again
mcb5637 Dec 3, 2025
efa4374
Merge branch 'develop' into feature/parse_xml
mcb5637 Dec 4, 2025
6cf39d5
remove iconv
mcb5637 Dec 4, 2025
f8f6454
states no longer get a Impl&
mcb5637 Dec 9, 2025
7417925
reorganize classes
mcb5637 Dec 11, 2025
5682b8c
prepare for tests
mcb5637 Dec 11, 2025
286815a
remove self-referentialness of struct and minor cleanup
liss-h Dec 17, 2025
88d9391
review
mcb5637 Jan 9, 2026
dd965a6
Merge remote-tracking branch 'origin/feature/parse_xml' into feature/…
mcb5637 Jan 9, 2026
e23492e
fix merge
mcb5637 Jan 9, 2026
71638ea
tests from rdf-tests repo
nkaralis Jan 21, 2026
95d11d6
added missing test dep
nkaralis Jan 21, 2026
4c26db9
tests
mcb5637 Jan 21, 2026
fc3e9ad
review
mcb5637 Jan 21, 2026
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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ find_package(highway REQUIRED)
find_package(dice-hash REQUIRED)
find_package(dice-sparse-map REQUIRED)
find_package(dice-template-library REQUIRED)
find_package(libxml2 REQUIRED)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/src/rdf4cpp/version.hpp)

Expand Down Expand Up @@ -149,6 +150,7 @@ add_library(rdf4cpp
src/rdf4cpp/IRIFactory.cpp
src/rdf4cpp/util/Anonymizer.cpp
private/rdf4cpp/parser/IStreamQuadIteratorSerdImpl.cpp
private/rdf4cpp/parser/XMLParser.cpp
private/rdf4cpp/regex/RegexImpl.cpp
private/rdf4cpp/regex/RegexReplacerImpl.cpp
${serd_source_files}
Expand Down Expand Up @@ -178,6 +180,7 @@ target_link_libraries(rdf4cpp
OpenSSL::Crypto
uni-algo::uni-algo
highway::highway
LibXml2::LibXml2
)

set_target_properties(rdf4cpp PROPERTIES
Expand Down
1 change: 1 addition & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def requirements(self):
self.requires("dice-hash/0.4.11", transitive_headers=True)
self.requires("dice-sparse-map/0.2.9", transitive_headers=True)
self.requires("dice-template-library/1.19.0", transitive_headers=True)
self.requires("libxml2/2.15.0")

if self.options.with_test_deps:
self.test_requires("doctest/2.4.11")
Expand Down
136 changes: 62 additions & 74 deletions private/rdf4cpp/parser/IStreamQuadIteratorSerdImpl.cpp

Large diffs are not rendered by default.

26 changes: 16 additions & 10 deletions private/rdf4cpp/parser/IStreamQuadIteratorSerdImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,25 @@

namespace rdf4cpp::parser {

struct IStreamQuadIterator::Impl {
struct IStreamQuadIterator::ImplSerd final : Impl {
using flags_type = IStreamQuadIterator::flags_type;
using state_type = IStreamQuadIterator::state_type;
using ok_type = IStreamQuadIterator::ok_type;
using error_type = IStreamQuadIterator::error_type;

private:
SerdReader *reader;
// workaround for gcc-14 bug, erroneously warns on unsing a lambda here
// see https://github.com/NVIDIA/stdexec/issues/1143
struct SerdReaderDtorLambda {
void operator()(SerdReader* r) const {
serd_reader_end_stream(r);
serd_reader_free(r);
}
};
std::unique_ptr<SerdReader, SerdReaderDtorLambda> reader;

std::unique_ptr<state_type> state_owned = nullptr;
Comment thread
mcb5637 marked this conversation as resolved.
Outdated
state_type *state;
bool state_is_owned;

std::deque<Quad> quad_buffer;
std::optional<ParsingError> last_error;
Expand All @@ -33,11 +41,9 @@ struct IStreamQuadIterator::Impl {

flags_type flags;

private:
static std::string_view node_into_string_view(SerdNode const *node) noexcept;
static ParsingError::Type parsing_error_type_from_serd(SerdStatus st) noexcept;

private:
nonstd::expected<Node, SerdStatus> get_bnode(std::string &&graph_str, SerdNode const *node) noexcept;
nonstd::expected<IRI, SerdStatus> get_iri(SerdNode const *node) noexcept;
nonstd::expected<IRI, SerdStatus> get_prefixed_iri(SerdNode const *node) noexcept;
Expand All @@ -63,13 +69,13 @@ struct IStreamQuadIterator::Impl {
}

public:
Impl(void *stream,
ImplSerd(void *stream,
ReadFunc read,
ErrorFunc,
flags_type flags,
state_type *state) noexcept;

~Impl() noexcept;
~ImplSerd() override;

/**
* Tries to extract the next element from the serd backend.
Expand All @@ -81,10 +87,10 @@ struct IStreamQuadIterator::Impl {
* expected Quad: if there was a next element and it could be parsed
* unexpected ParsingError: if there was a next element but it could not be parsed
*/
[[nodiscard]] std::optional<nonstd::expected<ok_type, error_type>> next();
[[nodiscard]] std::optional<nonstd::expected<ok_type, error_type>> next() override;

[[nodiscard]] uint64_t current_line() const noexcept;
[[nodiscard]] uint64_t current_column() const noexcept;
[[nodiscard]] uint64_t current_line() const noexcept override;
[[nodiscard]] uint64_t current_column() const noexcept override;
};

} // namespace rdf4cpp::parser
Expand Down
Loading
Loading