-
Notifications
You must be signed in to change notification settings - Fork 0
/
rdf_parser.h
38 lines (29 loc) · 1.36 KB
/
rdf_parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef RML_PARSER_H
#define RML_PARSER_H
#include <string>
#include <vector>
#include "definitions.h"
#include "serd/serd.h"
class RDFParser {
private:
std::vector<NTriple> rml_triples;
SerdEnv* env;
std::string extract_base_URI(const std::string& str);
int extractNumber(const std::string& str);
int getHighestBlankNodeID(const std::vector<NTriple>& triples);
SerdStatus handle_error(void* handle, const SerdError* error);
SerdStatus capture_prefix(const SerdNode* name, const SerdNode* uri);
static SerdStatus static_handle_error(void* handle, const SerdError* error);
static SerdStatus static_capture_prefix(void* handle, const SerdNode* name, const SerdNode* uri);
SerdStatus handle_triple(void* handle, unsigned int flags, const SerdNode* graph, const SerdNode* subject, const SerdNode* predicate, const SerdNode* object, const SerdNode* datatype, const SerdNode* lang);
static SerdStatus static_handle_triple(void* handle, unsigned int flags, const SerdNode* graph, const SerdNode* subject, const SerdNode* predicate, const SerdNode* object, const SerdNode* datatype, const SerdNode* lang);
SerdNode expand_node(const SerdNode* node);
void handle_rdf_parsing(const std::string& rdf_data);
public:
RDFParser();
~RDFParser();
std::vector<NTriple> parse(const std::string& rml_rule);
std::string extracted_base_uri;
int blank_node_id;
};
#endif