knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
TripleFormatter.h
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #ifndef KNOWROB_TRIPLE_FORMATTER_H
7 #define KNOWROB_TRIPLE_FORMATTER_H
8 
9 #include "string_view"
10 #include "map"
11 #include "vector"
12 #include "knowrob/semweb/TripleFormat.h"
13 #include "knowrob/semweb/Triple.h"
14 
15 namespace knowrob::semweb {
16  using ExportedTriples = std::map<std::string_view, std::vector<std::shared_ptr<Triple>>>;
17 
21  class TripleFormatter {
22  public:
29  static bool exportTo(
30  const ExportedTriples &triples,
31  const std::string &filename,
33 
39  static bool exportRDF_XML(
40  const ExportedTriples &triples,
41  const std::string &filename);
42 
48  static bool exportTurtle(
49  const ExportedTriples &triples,
50  const std::string &filename);
51  };
52 }
53 
54 #endif //KNOWROB_TRIPLE_FORMATTER_H
static bool exportRDF_XML(const ExportedTriples &triples, const std::string &filename)
static bool exportTo(const ExportedTriples &triples, const std::string &filename, TripleFormat format=TripleFormat::RDF_XML)
static bool exportTurtle(const ExportedTriples &triples, const std::string &filename)
TermRule & string()
Definition: terms.cpp:63
std::map< std::string_view, std::vector< std::shared_ptr< Triple > >> ExportedTriples