copasi API
0.1
|
#include <CRDFGraph.h>
Public Types | |
typedef std::set< CRDFTriplet > ::iterator | iterator |
typedef std::set< CRDFTriplet > ::const_iterator | const_iterator |
typedef std::multimap < CRDFNode *, CRDFTriplet > | Node2Triplet |
typedef std::pair < Node2Triplet::iterator, Node2Triplet::iterator > | Node2TripletRange |
typedef std::pair < Node2Triplet::const_iterator, Node2Triplet::const_iterator > | Node2TripletConstRange |
typedef std::multimap < CRDFPredicate, CRDFTriplet > | Predicate2Triplet |
typedef std::pair < Predicate2Triplet::iterator, Predicate2Triplet::iterator > | Predicate2TripletRange |
typedef std::pair < Predicate2Triplet::const_iterator, Predicate2Triplet::const_iterator > | Predicate2TripletConstRange |
Public Member Functions | |
CRDFGraph () | |
~CRDFGraph () | |
const CRDFNode * | getAboutNode () const |
const std::map< std::string, std::string > & | getNameSpaceMap () const |
const std::map< std::string, CRDFNode * > & | getBlankNodeMap () const |
const std::map< std::string, CRDFNode * > & | getLocalResourceNodeMap () const |
const std::vector< CRDFNode * > & | getRemoteResourceNodes () const |
bool | guessGraphRoot (const std::string &about=" ") |
bool | addNameSpace (const std::string &prefix, const std::string &uri) |
CRDFTriplet | addTriplet (const CRDFSubject &subject, const CRDFPredicate &predicate, const CRDFObject &object) |
void | removeTriplet (CRDFNode *pSubject, const CRDFPredicate &predicate, CRDFNode *pObject) |
void | destroyUnreferencedNode (CRDFNode *pNode) |
CRDFTriplet | moveTriplet (CRDFNode *pNewSubject, const CRDFTriplet &triplet) |
const std::set< CRDFTriplet > & | getTriplets () const |
std::set< CRDFTriplet > | getTriplets (const CRDFPredicate &predicate, const bool &expandBag=true) const |
std::set< CRDFTriplet > | getTriplets (const CRDFNode *pSubject) const |
std::set< CRDFTriplet > | getTriplets (const CRDFNode *pSubject, const CRDFPredicate &predicate) const |
std::set< CRDFTriplet > | getIncomingTriplets (const CRDFNode *pObject) const |
std::set< const CRDFNode * > | getParentSubjects (const CRDFNode *pObject) const |
CRDFPredicate::Path | getPredicatePath (const CRDFNode *pNode) |
std::string | generatedNodeId (const std::string &existingId="") |
CRDFNode * | createAboutNode (const std::string &key) |
void | clean () |
void | updateNamespaces () |
Friends | |
bool | CRDFNode::addTripletToGraph (const CRDFTriplet &triplet) const |
void | CRDFNode::removeTripletFromGraph (const CRDFTriplet &triplet) const |
typedef std::set< CRDFTriplet >::const_iterator CRDFGraph::const_iterator |
typedef std::set< CRDFTriplet >::iterator CRDFGraph::iterator |
typedef std::multimap< CRDFNode *, CRDFTriplet > CRDFGraph::Node2Triplet |
typedef std::pair< Node2Triplet::const_iterator, Node2Triplet::const_iterator> CRDFGraph::Node2TripletConstRange |
typedef std::pair< Node2Triplet::iterator, Node2Triplet::iterator> CRDFGraph::Node2TripletRange |
typedef std::multimap< CRDFPredicate, CRDFTriplet > CRDFGraph::Predicate2Triplet |
typedef std::pair< Predicate2Triplet::const_iterator, Predicate2Triplet::const_iterator> CRDFGraph::Predicate2TripletConstRange |
typedef std::pair< Predicate2Triplet::iterator, Predicate2Triplet::iterator> CRDFGraph::Predicate2TripletRange |
CRDFGraph::CRDFGraph | ( | ) |
Default Constructor
CRDFGraph::~CRDFGraph | ( | ) |
Destructor
bool CRDFGraph::addNameSpace | ( | const std::string & | prefix, |
const std::string & | uri | ||
) |
Add a name space including prefix to the graph. It returns false if the prefix was already used with another namespace
const | std::string & prefix |
const | std::string & namespace |
CRDFTriplet CRDFGraph::addTriplet | ( | const CRDFSubject & | subject, |
const CRDFPredicate & | predicate, | ||
const CRDFObject & | object | ||
) |
Add a triplet to the graph
const | CRDFSubject & subject |
const | CRDFPredicate & predicate |
const | CRDFObject & object |
void CRDFGraph::clean | ( | ) |
Removes empty blank nodes . This should be called before CRDFWriter::xmlFromGraph
CRDFNode * CRDFGraph::createAboutNode | ( | const std::string & | key | ) |
If no about node exists a node is created with the attribute: rdf:about="#key
const | std::string & key |
void CRDFGraph::destroyUnreferencedNode | ( | CRDFNode * | pNode | ) |
std::string CRDFGraph::generatedNodeId | ( | const std::string & | existingId = "" | ) |
Generate a unique blank node id.
const | std::string & existingId (default: "") |
const CRDFNode * CRDFGraph::getAboutNode | ( | ) | const |
Retrieve the about/top node of the graph.
const std::map< std::string, CRDFNode * > & CRDFGraph::getBlankNodeMap | ( | ) | const |
Retrieve the map of IDs to blank nodes
std::set< CRDFTriplet > CRDFGraph::getIncomingTriplets | ( | const CRDFNode * | pObject | ) | const |
Retrieve all triples pointing to the object
const | CRDFNode * pObject |
const std::map< std::string, CRDFNode * > & CRDFGraph::getLocalResourceNodeMap | ( | ) | const |
Retrieve the map of URIs to local resource nodes
const std::map< std::string, std::string > & CRDFGraph::getNameSpaceMap | ( | ) | const |
Retrieve the map of prefixes to namespaces
Retrieve all parent subjects of the object
const | CRDFNode * pObject |
CRDFPredicate::Path CRDFGraph::getPredicatePath | ( | const CRDFNode * | pNode | ) |
Retrieve the predicate path to the ginve node.
const | CRDFNode * pNode |
const std::vector< CRDFNode * > & CRDFGraph::getRemoteResourceNodes | ( | ) | const |
Retrieve the vector of remote resource nodes
const std::set< CRDFTriplet > & CRDFGraph::getTriplets | ( | ) | const |
Retrieve all triplets.
std::set< CRDFTriplet > CRDFGraph::getTriplets | ( | const CRDFPredicate & | predicate, |
const bool & | expandBag = true |
||
) | const |
Retrieve all triplets with the specified predicate, this will collapse predicate.rdf:li to predicate.
const | CRDFPredicate & predicate |
const | bool & expandBag (default: true) |
std::set< CRDFTriplet > CRDFGraph::getTriplets | ( | const CRDFNode * | pSubject | ) | const |
Retrieve all triplets with the specified subject
const | CRDFNode * pSubject |
std::set< CRDFTriplet > CRDFGraph::getTriplets | ( | const CRDFNode * | pSubject, |
const CRDFPredicate & | predicate | ||
) | const |
Retrieve all triplets with the specified subject and predicate
const | CRDFNode * pSubject |
const | CRDFPredicate & predicate |
bool CRDFGraph::guessGraphRoot | ( | const std::string & | about = " " | ) |
Guess the graph root element. If a unique root element is found true is returned other wise falls
const | std::string & about (default: <space>) |
CRDFTriplet CRDFGraph::moveTriplet | ( | CRDFNode * | pNewSubject, |
const CRDFTriplet & | triplet | ||
) |
Move a edge from one node to another
CRDFNode | * pNewSubject |
CRDFNode | * const CRDFTriplet & triplet |
void CRDFGraph::removeTriplet | ( | CRDFNode * | pSubject, |
const CRDFPredicate & | predicate, | ||
CRDFNode * | pObject | ||
) |
Remove triplet from the graph. Please note, this will also remove all unreferenced local resources created by removing the edge.
CRDFNode | * pSubject |
const | CRDFPredicate & predicate |
CRDFNode | * pObject |
void CRDFGraph::updateNamespaces | ( | ) |
Removes all unused name spaces.
bool CRDFNode::addTripletToGraph | ( | const CRDFTriplet & | triplet | ) | const [friend] |
void CRDFNode::removeTripletFromGraph | ( | const CRDFTriplet & | triplet | ) | const [friend] |