#include <RaptorContainer.h>
|  | 
|  | RaptorContainer (uint32_t size, std::string_view origin) | 
|  | 
|  | RaptorContainer (uint32_t size) | 
|  | 
|  | ~RaptorContainer () | 
|  | 
| Triple * | add (raptor_term *s, raptor_term *p, raptor_term *o, librdf_node *context=nullptr) | 
|  | 
| Triple * | add (raptor_statement *statement, librdf_node *context=nullptr) | 
|  | 
| void | reset () | 
|  | 
| void | rollbackLast () | 
|  | 
| void | shrink () | 
|  | 
| auto | size () const | 
|  | 
| ConstGenerator | cgenerator () const override | 
|  | 
| MutableGenerator | generator () override | 
|  | 
|  | RaptorContainer (uint32_t size, std::string_view origin) | 
|  | 
|  | RaptorContainer (uint32_t size) | 
|  | 
|  | ~RaptorContainer () | 
|  | 
| Triple * | add (raptor_term *s, raptor_term *p, raptor_term *o, librdf_node *context=nullptr) | 
|  | 
| Triple * | add (raptor_statement *statement, librdf_node *context=nullptr) | 
|  | 
| void | reset () | 
|  | 
| void | rollbackLast () | 
|  | 
| void | shrink () | 
|  | 
| auto | size () const | 
|  | 
| ConstGenerator | cgenerator () const override | 
|  | 
| MutableGenerator | generator () override | 
|  | 
| iterator | begin () | 
|  | 
| bool | isMutable () const override | 
|  | 
| iterator | begin () | 
|  | 
| bool | isMutable () const override | 
|  | 
| virtual | ~TripleContainer ()=default | 
|  | 
| iterator | begin () const | 
|  | 
| bool | empty () const | 
|  | 
| virtual | ~TripleContainer ()=default | 
|  | 
| iterator | begin () const | 
|  | 
| bool | empty () const | 
|  | 
A batch of triples loaded with raptor. 
Definition at line 18 of file RaptorContainer.h.
◆ RaptorContainer() [1/4]
      
        
          | RaptorContainer::RaptorContainer | ( | uint32_t | size, | 
        
          |  |  | std::string_view | origin | 
        
          |  | ) |  |  | 
      
 
- Parameters
- 
  
    | size | the maximum number of triples to be stored. |  | origin | the origin of the triples. |  
 
Definition at line 12 of file RaptorContainer.cpp.
std::optional< std::string_view > origin_
std::vector< mapped_statement > raptorData_
std::vector< TriplePtr > mappedData_
TripleTemplate< std::string_view > TripleView
 
 
 
◆ RaptorContainer() [2/4]
  
  | 
        
          | RaptorContainer::RaptorContainer | ( | uint32_t | size | ) |  |  | explicit | 
 
- Parameters
- 
  
    | size | the maximum number of triples to be stored. |  
 
Definition at line 23 of file RaptorContainer.cpp.
 
 
◆ ~RaptorContainer() [1/2]
      
        
          | RaptorContainer::~RaptorContainer | ( |  | ) |  | 
      
 
 
◆ RaptorContainer() [3/4]
      
        
          | knowrob::RaptorContainer::RaptorContainer | ( | uint32_t | size, | 
        
          |  |  | std::string_view | origin | 
        
          |  | ) |  |  | 
      
 
- Parameters
- 
  
    | size | the maximum number of triples to be stored. |  | origin | the origin of the triples. |  
 
 
 
◆ RaptorContainer() [4/4]
  
  | 
        
          | knowrob::RaptorContainer::RaptorContainer | ( | uint32_t | size | ) |  |  | explicit | 
 
- Parameters
- 
  
    | size | the maximum number of triples to be stored. |  
 
 
 
◆ ~RaptorContainer() [2/2]
      
        
          | knowrob::RaptorContainer::~RaptorContainer | ( |  | ) |  | 
      
 
 
◆ add() [1/4]
      
        
          | Triple * RaptorContainer::add | ( | raptor_statement * | statement, | 
        
          |  |  | librdf_node * | context = nullptr | 
        
          |  | ) |  |  | 
      
 
Add a triple to the batch. 
- Parameters
- 
  
    | statement | a raptor statement. |  | context | the context of the statement. |  
 
- Returns
- the added statement. 
Definition at line 113 of file RaptorContainer.cpp.
  114     return add(statement->subject, statement->predicate, statement->object, context);
 
Triple * add(raptor_term *s, raptor_term *p, raptor_term *o, librdf_node *context=nullptr)
 
 
 
◆ add() [2/4]
      
        
          | Triple* knowrob::RaptorContainer::add | ( | raptor_statement * | statement, | 
        
          |  |  | librdf_node * | context = nullptr | 
        
          |  | ) |  |  | 
      
 
Add a triple to the batch. 
- Parameters
- 
  
    | statement | a raptor statement. |  | context | the context of the statement. |  
 
- Returns
- the added statement. 
 
 
◆ add() [3/4]
      
        
          | Triple * RaptorContainer::add | ( | raptor_term * | s, | 
        
          |  |  | raptor_term * | p, | 
        
          |  |  | raptor_term * | o, | 
        
          |  |  | librdf_node * | context = nullptr | 
        
          |  | ) |  |  | 
      
 
Add a triple to the batch. 
- Parameters
- 
  
    | s | a raptor term. |  | p | a raptor term. |  | o | a raptor term. |  | context | the context of the statement. |  
 
- Returns
- the added statement. 
Definition at line 56 of file RaptorContainer.cpp.
   59         KB_WARN(
"received malformed data from raptor, skipping statement.");
 
   64     auto c_s = raptor_term_copy(s);
 
   65     auto c_p = raptor_term_copy(p);
 
   66     auto c_o = raptor_term_copy(o);
 
   68     endpoint_triple.s = c_s;
 
   69     endpoint_triple.p = c_p;
 
   70     endpoint_triple.o = c_o;
 
   79         triple->setGraph((
const char *) librdf_node_get_literal_value(context));
 
   80     } 
else if (
origin_.has_value()) {
 
   82         triple->setGraph(
origin_.value().data());
 
   86     triple->setPredicate((
const char *) raptor_uri_as_string(c_p->value.uri));
 
   88     if (c_s->type == RAPTOR_TERM_TYPE_BLANK)
 
   89         triple->setSubjectBlank((
const char *) c_s->value.blank.string);
 
   91         triple->setSubject((
const char *) raptor_uri_as_string(c_s->value.uri));
 
   94     if (c_o->type == RAPTOR_TERM_TYPE_BLANK) {
 
   95         triple->setObjectBlank((
const char *) c_o->value.blank.string);
 
   96     } 
else if (c_o->type == RAPTOR_TERM_TYPE_LITERAL) {
 
   97         auto stringForm = (
const char *) c_o->value.literal.string;
 
  100         if (c_o->value.literal.datatype) {
 
  101             auto typeURI = (
const char *) raptor_uri_as_string(c_o->value.literal.datatype);
 
  104         triple->setXSDValue(stringForm, xsdType);
 
  106         triple->setObjectIRI((
const char *) raptor_uri_as_string(c_o->value.uri));
 
XSDType xsdTypeFromIRI(std::string_view iri)
XSDType
The XSDType enum Enumeration of the XSD types.
 
 
 
◆ add() [4/4]
      
        
          | Triple* knowrob::RaptorContainer::add | ( | raptor_term * | s, | 
        
          |  |  | raptor_term * | p, | 
        
          |  |  | raptor_term * | o, | 
        
          |  |  | librdf_node * | context = nullptr | 
        
          |  | ) |  |  | 
      
 
Add a triple to the batch. 
- Parameters
- 
  
    | s | a raptor term. |  | p | a raptor term. |  | o | a raptor term. |  | context | the context of the statement. |  
 
- Returns
- the added statement. 
 
 
◆ cgenerator() [1/2]
◆ cgenerator() [2/2]
◆ generator() [1/2]
◆ generator() [2/2]
◆ reset() [1/2]
      
        
          | void RaptorContainer::reset | ( |  | ) |  | 
      
 
 
◆ reset() [2/2]
      
        
          | void knowrob::RaptorContainer::reset | ( |  | ) |  | 
      
 
Reset the batch to be empty. 
 
 
◆ rollbackLast() [1/2]
      
        
          | void RaptorContainer::rollbackLast | ( |  | ) |  | 
      
 
 
◆ rollbackLast() [2/2]
      
        
          | void knowrob::RaptorContainer::rollbackLast | ( |  | ) |  | 
      
 
Rollback the last added statement. 
 
 
◆ shrink() [1/2]
      
        
          | void RaptorContainer::shrink | ( |  | ) |  | 
      
 
 
◆ shrink() [2/2]
      
        
          | void knowrob::RaptorContainer::shrink | ( |  | ) |  | 
      
 
Shrink the batch to the actual size. 
 
 
◆ size() [1/2]
  
  | 
        
          | auto knowrob::RaptorContainer::size | ( |  | ) | const |  | inline | 
 
 
◆ size() [2/2]
  
  | 
        
          | auto knowrob::RaptorContainer::size | ( |  | ) | const |  | inline | 
 
 
◆ actualSize_
  
  | 
        
          | std::size_t knowrob::RaptorContainer::actualSize_ |  | protected | 
 
 
◆ mappedData_
  
  | 
        
          | std::vector< TriplePtr > knowrob::RaptorContainer::mappedData_ |  | protected | 
 
 
◆ origin_
  
  | 
        
          | std::optional< std::string_view > knowrob::RaptorContainer::origin_ |  | protected | 
 
 
◆ raptorData_
The documentation for this class was generated from the following files: