Public Types | Public Member Functions | Protected Attributes

PD_Object Class Reference

An RDF Object is either a URI, a bnode, or a Literal value. More...

#include <pd_DocumentRDF.h>

Inheritance diagram for PD_Object:
PD_URI PD_Literal

List of all members.

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

Detailed Description

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.


Member Enumeration Documentation

anonymous enum
Enumerator:
OBJECT_TYPE_URI 
OBJECT_TYPE_LITERAL 
OBJECT_TYPE_BNODE 

Constructor & Destructor Documentation

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 = "" 
)

Member Function Documentation

int PD_Object::getObjectType ( void   )  const
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().


Member Data Documentation

std::string PD_Object::m_context [protected]

Referenced by read(), and write().

std::string PD_Object::m_xsdType [protected]

Referenced by getXSDType(), hasXSDType(), read(), and write().


The documentation for this class was generated from the following files: