An RDF Object is either a URI, a bnode, or a Literal value. More...
#include <pd_DocumentRDF.h>
Public Types | |
enum | { OBJECT_TYPE_URI = 1, OBJECT_TYPE_LITERAL, OBJECT_TYPE_BNODE } |
Public Member Functions | |
PD_Object (const std::string &v="") | |
PD_Object (const PD_URI &u) | |
PD_Object (const std::string &v, int objectType, const std::string &xsdtype="") | |
std::string | getXSDType () const |
bool | hasXSDType () const |
int | getObjectType () const |
bool | isLiteral () const |
bool | isURI () const |
bool | isBNode () const |
virtual bool | read (std::istream &ss) |
virtual bool | write (std::ostream &ss) const |
Protected Attributes | |
std::string | m_xsdType |
std::string | m_context |
int | m_objectType |
An RDF Object is either a URI, a bnode, or a Literal value.
While inheritance is not strictly correct for this relation, since the main features of a PD_URI are to get a string value, if the Object is a literal it can return it's literal value via toString().
The main additions for an Object are the type information of the literal and also the context if the Object forms part of a triple.
There are two types for an Object, use getObjectType() to see if it is a URI, LITERAL, BNODE etc. Use getXSDType() to get the XSD schema type for the literal. While using getXSDType() for a URI or BNODE will result in "", the object type is still needed to differentiate properly between URI and BNodes and makes this explicit.
PD_Object::PD_Object | ( | const std::string & | v = "" |
) |
PD_Object::PD_Object | ( | const PD_URI & | u | ) |
PD_Object::PD_Object | ( | const std::string & | v, | |
int | objectType, | |||
const std::string & | xsdtype = "" | |||
) |
int PD_Object::getObjectType | ( | void | ) | const |
References m_objectType.
Referenced by PD_RDFStatement::toString(), and RDFModel_SPARQLLimited::update().
std::string PD_Object::getXSDType | ( | ) | const |
References m_xsdType.
bool PD_Object::hasXSDType | ( | ) | const |
References m_xsdType.
bool PD_Object::isBNode | ( | ) | const |
References m_objectType.
bool PD_Object::isLiteral | ( | ) | const |
References m_objectType.
bool PD_Object::isURI | ( | ) | const |
References m_objectType.
bool PD_Object::read | ( | std::istream & | ss | ) | [virtual] |
Reimplemented from PD_URI.
References m_context, m_objectType, PD_URI::m_value, m_xsdType, and readLengthPrefixedString().
Referenced by splitPO().
bool PD_Object::write | ( | std::ostream & | ss | ) | const [virtual] |
Reimplemented from PD_URI.
References createLengthPrefixedString(), m_context, m_objectType, PD_URI::m_value, and m_xsdType.
Referenced by combinePO().
std::string PD_Object::m_context [protected] |
int PD_Object::m_objectType [protected] |
Referenced by getObjectType(), isBNode(), isLiteral(), isURI(), read(), and write().
std::string PD_Object::m_xsdType [protected] |
Referenced by getXSDType(), hasXSDType(), read(), and write().