36 }
else if (key ==
"s") {
37 tripleData.setSubject(bson_iter_utf8(&
tripleIter_,
nullptr));
38 }
else if (key ==
"p") {
39 tripleData.setPredicate(bson_iter_utf8(&
tripleIter_,
nullptr));
40 }
else if (key ==
"graph") {
41 tripleData.setGraph(bson_iter_utf8(&
tripleIter_,
nullptr));
42 }
else if (key ==
"agent") {
43 tripleData.setPerspective(bson_iter_utf8(&
tripleIter_,
nullptr));
44 }
else if (key ==
"uncertain") {
45 tripleData.setIsUncertain(bson_iter_bool(&
tripleIter_));
46 }
else if (key ==
"occasional") {
47 tripleData.setIsOccasional(bson_iter_bool(&
tripleIter_));
48 }
else if (key ==
"since") {
49 tripleData.setBegin(bson_iter_double(&
tripleIter_));
50 }
else if (key ==
"until") {
52 }
else if (key ==
"confidence") {
53 tripleData.setConfidence(bson_iter_double(&
tripleIter_));
54 tripleData.setIsUncertain(
true);
55 }
else if (key ==
"o") {
57 case BSON_TYPE_UTF8: {
63 tripleData.setObjectIRI(utf8);
66 tripleData.setStringValue(utf8);
69 tripleData.setObjectBlank(utf8);
74 case BSON_TYPE_DOUBLE:
75 tripleData.setDoubleValue(bson_iter_double(&
tripleIter_));
78 tripleData.setIntValue(bson_iter_bool(&
tripleIter_));
81 tripleData.setIntValue(bson_iter_int32(&
tripleIter_));
84 tripleData.setLongValue(bson_iter_int64(&
tripleIter_));
87 KB_WARN(
"skipping triple with unexpected type '{}' of \"o\" field.",
91 }
else if (key ==
"scope") {
92 bson_iter_t scopeIter, timeIter;
94 bson_iter_find(&scopeIter,
"time");
95 bson_iter_recurse(&scopeIter, &timeIter);
97 while (bson_iter_next(&timeIter)) {
98 std::string_view scopeKey = bson_iter_key(&timeIter);
99 if (scopeKey ==
"since") {
101 if (v && v.value() != 0) tripleData.setBegin(v.value());
102 }
else if (scopeKey ==
"until") {
104 if (v && v.value() != 0) tripleData.setEnd(v.value());
bool next(const bson_t **doc, bool ignore_empty=false)
std::optional< double > bson_iterOptionalDouble(const bson_iter_t *iter)
RDFNodeType rdfNodeTypeGuess(std::string_view str)