COPASI API  4.40.278
CRDFParser Class Reference

#include <CRDFParser.h>

Inheritance diagram for CRDFParser:
[legend]

Public Member Functions

 CRDFParser ()
 
CRDFGraphparse (std::istream &stream)
 
 ~CRDFParser ()
 

Static Public Member Functions

static void ErrorHandler (void *, raptor_locator *pLocator, const char *message)
 
static void FatalErrorHandler (void *, raptor_locator *pLocator, const char *message)
 
static unsigned char * GenerateIdHandler (void *pGraph, raptor_genid_type type, unsigned char *userNodeId)
 
static CRDFGraphgraphFromXml (const std::string &xml)
 
static void NameSpaceHandler (void *pGraph, raptor_namespace *pNameSpace)
 
static void TripleHandler (void *pGraph, const raptor_statement *pTriple)
 
static void WarningHandler (void *, raptor_locator *pLocator, const char *message)
 

Private Attributes

raptor_parser * mpParser
 

Additional Inherited Members

- Private Member Functions inherited from CRaptorInit
 CRaptorInit ()
 
 ~CRaptorInit ()
 
- Static Private Member Functions inherited from CRaptorInit
static bool isLocalURI (raptor_uri *pURI)
 

Constructor & Destructor Documentation

◆ CRDFParser()

CRDFParser::CRDFParser ( )

Default Constructor

References ErrorHandler(), FatalErrorHandler(), mpParser, and WarningHandler().

◆ ~CRDFParser()

CRDFParser::~CRDFParser ( )

Destructor

References mpParser.

Member Function Documentation

◆ ErrorHandler()

void CRDFParser::ErrorHandler ( void *  ,
raptor_locator *  pLocator,
const char *  message 
)
static

A static handler to interface with the C parser library. This is called whenever the parser encounters an error;

Parameters
void* userdata (ignored)
raptor_locator* pLocator
constchar * message

References CCopasiMessage::ERROR, and MCAnnotation.

Referenced by CRDFParser().

◆ FatalErrorHandler()

void CRDFParser::FatalErrorHandler ( void *  ,
raptor_locator *  pLocator,
const char *  message 
)
static

A static handler to interface with the C parser library. This is called whenever the parser encounters a fatal error;

Parameters
void* userdata (ignored)
raptor_locator* pLocator
constchar * message

References CCopasiMessage::ERROR, and MCAnnotation.

Referenced by CRDFParser().

◆ GenerateIdHandler()

unsigned char * CRDFParser::GenerateIdHandler ( void *  pGraph,
raptor_genid_type  type,
unsigned char *  userNodeId 
)
static

A static handler to interface with the C parser library. This is called whenever a node id needs to be generated.

Parameters
void* pGraph
raptor_genid_typetype
unsignedchar * userNodeId
Returns
unsigned char * generatedId

Referenced by parse().

◆ graphFromXml()

CRDFGraph * CRDFParser::graphFromXml ( const std::string &  xml)
static

Convert an RDF/XML syntax string to an RDF Graph. If the conversion fails a NULL pointer is returned. Otherwise a pointer to the resulting graph is returned. It is the responsibility of the caller to destroy the created graph.

Parameters
conststd::string & xml
Returns
CRDFGraph * graphFromXml

References parse().

Referenced by CMIRIAMInfo::load(), and CRDFGraphConverter::SBML2Copasi().

◆ NameSpaceHandler()

void CRDFParser::NameSpaceHandler ( void *  pGraph,
raptor_namespace *  pNameSpace 
)
static

A static handler to interface with the C parser library. This is called whenever a namespace is declared.

Parameters
void* pGraph
raptor_namespace* pNameSpace

Referenced by parse().

◆ parse()

CRDFGraph * CRDFParser::parse ( std::istream &  stream)

Parse the stream. If the parsing fails a NULL pointer is returned. Otherwise a pointer to the resulting graph is returned. It is the responsibility of the caller to destroy the created graph. &param std::istream & stream

Returns
CRDFGraph * pGraph

References BUFFER_SIZE, C_INT32, fatalError, GenerateIdHandler(), CRDFGraph::guessGraphRoot(), mpParser, NameSpaceHandler(), pdelete, pRaptorFreeUri, and TripleHandler().

Referenced by graphFromXml().

◆ TripleHandler()

void CRDFParser::TripleHandler ( void *  pGraph,
const raptor_statement *  pTriple 
)
static

A static handler to interface with the C parser library. This is called whenever an RDF triple is created. Its only purpose is to add the triple to the graph which must provide addTriplet(CRDFSubject, std::string, CRDFObject);

Parameters
void* pGraph
constraptor_statement * pTriple

References CRDFObject::BLANK_NODE, CRDFSubject::BLANK_NODE, fatalError, CRaptorInit::isLocalURI(), CRDFObject::LITERAL, CRDFLiteral::PLAIN, CRDFObject::RESOURCE, CRDFSubject::RESOURCE, CRDFObject::setBlankNodeId(), CRDFSubject::setBlankNodeId(), CRDFLiteral::setDataType(), CRDFLiteral::setLanguage(), CRDFLiteral::setLexicalData(), CRDFObject::setLiteral(), CRDFObject::setResource(), CRDFSubject::setResource(), CRDFLiteral::setType(), CRDFObject::setType(), CRDFSubject::setType(), and CRDFLiteral::TYPED.

Referenced by parse().

◆ WarningHandler()

void CRDFParser::WarningHandler ( void *  ,
raptor_locator *  pLocator,
const char *  message 
)
static

A static handler to interface with the C parser library. This is called whenever the parser encounters a warning;

Parameters
void* userdata (ignored)
raptor_locator* pLocator
constchar * message

References MCAnnotation, and CCopasiMessage::WARNING.

Referenced by CRDFParser().

Member Data Documentation

◆ mpParser

raptor_parser* CRDFParser::mpParser
private

Pointer to the underlying C parser from the Raptor library

Referenced by CRDFParser(), parse(), and ~CRDFParser().


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