1 #ifndef HAVE_RDF_QUERY_H
2 #define HAVE_RDF_QUERY_H 1
23 typedef std::map<std::string,mico::rdf::model::Value*> BindingSet;
37 virtual void loadFrom(std::istream& is) = 0;
44 virtual void loadFrom(
const char* ptr,
size_t len) = 0;
53 static void startElement(
void *data,
const char *el,
const char **attr);
54 static void endElement(
void *data,
const char *el);
55 static void characterData(
void *data,
const char *chars,
int len);
75 void loadFrom(
const char* ptr,
size_t len);
79 inline operator bool()
const {
return value; };
95 std::vector<std::string> bindingNames;
96 std::vector<BindingSet> data;
98 static void startElement(
void *data,
const char *el,
const char **attr);
99 static void endElement(
void *data,
const char *el);
100 static void characterData(
void *data,
const char *chars,
int len);
124 void loadFrom(
const char* ptr,
size_t len);
128 inline std::vector<BindingSet>::iterator begin() {
return data.begin(); }
129 inline std::vector<BindingSet>::iterator end() {
return data.end(); }
130 inline size_t size()
const {
return data.size(); }
131 inline BindingSet& at(
size_t i) {
return data.at(i); }
132 inline const BindingSet& at(
size_t i)
const {
return data.at(i); }
134 inline BindingSet& operator[](
size_t i) {
return data[i]; };
135 inline const BindingSet& operator[](
size_t i)
const {
return data[i]; };
145 std::istream& operator>>(std::istream& is, TupleResult& r);
146 std::istream& operator>>(std::istream& is, BooleanResult& r);
152 std::ostream& operator<<(std::ostream& is, TupleResult& r);
153 std::ostream& operator<<(std::ostream& is, BooleanResult& r);
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in c...
Definition: http_client.cpp:23
friend std::ostream & operator<<(std::ostream &is, TupleResult &r)
Serialize query result data from the given argument into XML SPARQL protocol syntax.
Definition: rdf_query_tuple.cpp:33
Abstract base class for query results.
Definition: rdf_query.hpp:30
friend std::istream & operator>>(std::istream &is, TupleResult &r)
Load query result data represented in the XML SPARQL protocol syntax into the query result given as a...
Definition: rdf_query_tuple.cpp:316
The boolean result of a SPARQL ASK query.
Definition: rdf_query.hpp:51
void loadFrom(std::istream &is)
Load query result data represented in the XML SPARQL protocol syntax into the query result given as a...
Definition: rdf_query_bool.cpp:114
const std::vector< std::string > & getBindingNames() const
Return the binding names (variable names) contained in the result.
Definition: rdf_query.hpp:110
void loadFrom(std::istream &is)
Load query result data represented in the XML SPARQL protocol syntax into the query result given as a...
Definition: rdf_query_tuple.cpp:271
The result of a SPARQL SELECT query.
Definition: rdf_query.hpp:89
virtual void loadFrom(std::istream &is)=0
Load query result data represented in the XML SPARQL protocol syntax into the query result given as a...