-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Own classes for both Literal
and Iri
#1301
Conversation
Next step: Also return proper IRIs from the SPARQL parser.
Next step: Fold the blank nodes into the ID.
# Conflicts: # src/engine/IndexScan.cpp # src/index/VocabularyGenerator.h # src/parser/sparqlParser/SparqlQleverVisitor.cpp # test/QueryPlannerTest.cpp # test/SparqlExpressionTest.cpp # test/SparqlExpressionTestHelpers.h
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1301 +/- ##
==========================================
- Coverage 88.24% 88.10% -0.15%
==========================================
Files 310 313 +3
Lines 28432 28503 +71
Branches 3148 3155 +7
==========================================
+ Hits 25091 25112 +21
- Misses 2188 2235 +47
- Partials 1153 1156 +3 ☔ View full report in Codecov by Sentry. |
# Conflicts: # CMakeLists.txt
TODO<joka921> There is still quite some cleaning up todo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass in 1-1 with Johannes over everything except the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1-1 with Johannes regardin the last two commits and all the tests, looks great, just some minor changes left
LiteralOrIri
type as part of the TripleComponent
class.Literal
and Iri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost done, we still need to get rid of the g++13 warning (dangling ...)
Literal
and Iri
Literal
and Iri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ready to be merged now, thanks a lot for the effort!
|
Since #1301, triples were the subject is an explicit blank node (for example `_:x <is-a> <blankNode>.`) could no longer be parsed. This commit fixes this bug and adds a unit test for this case.
#1301 introduced a bug where basic graph patterns like `wdt:Q183 ?p ?o` (fixed subject or object with a language tag, variable predicate) throw an exception. This is now fixed again.
So far, literals and IRIs were stored as a
std::string
(in a normalized way, that is, without escaping) and the distinction between literals and IRIs was made via the first character ("
or<
). The code to deal with datatypes (the stuff after^^
) and language tags (e.g.,@en
) was also ad-hoc using low-level string operations. Now there are proper classesLiteral
andIri
, which internally still store their data as normalized strings starting with"
or<
(just like before), but they are now two different types and each with a proper interface. This continues work started with #1186.The new classes are used in the
TripleComponent
class, which is used by the Turtle and SPARQL parsers. As a consequence, a lot of code is affected by this change. The new classes are not yet used byLocalVocab
andExportQueryExecutionTrees
.