COPASI API  4.16.103
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CRDFGraph Class Reference

#include <CRDFGraph.h>

Collaboration diagram for CRDFGraph:
Collaboration graph
[legend]

Public Types

typedef std::set< CRDFTriplet >
::const_iterator 
const_iterator
 
typedef std::set< CRDFTriplet >
::iterator 
iterator
 
typedef std::multimap
< CRDFNode *, CRDFTriplet
Node2Triplet
 
typedef std::pair
< Node2Triplet::const_iterator,
Node2Triplet::const_iterator > 
Node2TripletConstRange
 
typedef std::pair
< Node2Triplet::iterator,
Node2Triplet::iterator > 
Node2TripletRange
 
typedef std::multimap
< CRDFPredicate, CRDFTriplet
Predicate2Triplet
 
typedef std::pair
< Predicate2Triplet::const_iterator,
Predicate2Triplet::const_iterator > 
Predicate2TripletConstRange
 
typedef std::pair
< Predicate2Triplet::iterator,
Predicate2Triplet::iterator > 
Predicate2TripletRange
 

Public Member Functions

bool addNameSpace (const std::string &prefix, const std::string &uri)
 
CRDFTriplet addTriplet (const CRDFSubject &subject, const CRDFPredicate &predicate, const CRDFObject &object)
 
void clean ()
 
 CRDFGraph ()
 
CRDFNodecreateAboutNode (const std::string &key)
 
void destroyUnreferencedNode (CRDFNode *pNode)
 
std::string generatedNodeId (const std::string &existingId="")
 
const CRDFNodegetAboutNode () const
 
const std::map< std::string,
CRDFNode * > & 
getBlankNodeMap () const
 
std::set< CRDFTripletgetIncomingTriplets (const CRDFNode *pObject) const
 
const std::map< std::string,
CRDFNode * > & 
getLocalResourceNodeMap () const
 
const std::map< std::string,
std::string > & 
getNameSpaceMap () const
 
std::set< const CRDFNode * > getParentSubjects (const CRDFNode *pObject) const
 
CRDFPredicate::Path getPredicatePath (const CRDFNode *pNode)
 
const std::vector< CRDFNode * > & getRemoteResourceNodes () const
 
const std::set< CRDFTriplet > & getTriplets () const
 
std::set< CRDFTripletgetTriplets (const CRDFPredicate &predicate, const bool &expandBag=true) const
 
std::set< CRDFTripletgetTriplets (const CRDFNode *pSubject) const
 
std::set< CRDFTripletgetTriplets (const CRDFNode *pSubject, const CRDFPredicate &predicate) const
 
bool guessGraphRoot (const std::string &about=" ")
 
CRDFTriplet moveTriplet (CRDFNode *pNewSubject, const CRDFTriplet &triplet)
 
void removeTriplet (CRDFNode *pSubject, const CRDFPredicate &predicate, CRDFNode *pObject)
 
void updateNamespaces ()
 
 ~CRDFGraph ()
 

Private Member Functions

bool addTriplet (const CRDFTriplet &triplet)
 
bool removeEmptyNodes ()
 
void removeTriplet (const CRDFTriplet &triplet)
 

Private Attributes

std::map< std::string, CRDFNode * > mBlankNodeId2Node
 
std::set< unsigned int > mGeneratedIds
 
std::map< std::string,
std::string > 
mIdMap
 
std::vector< CRDFNode * > mLiteralNodes
 
std::map< std::string, CRDFNode * > mLocalResource2Node
 
Node2Triplet mObject2Triplet
 
CRDFNodempAbout
 
Predicate2Triplet mPredicate2Triplet
 
std::map< std::string,
std::string > 
mPrefix2Namespace
 
std::vector< CRDFNode * > mRemoteResourceNodes
 
Node2Triplet mSubject2Triplet
 
std::set< CRDFTripletmTriplets
 

Friends

bool CRDFNode::addTripletToGraph (const CRDFTriplet &triplet) const
 
void CRDFNode::removeTripletFromGraph (const CRDFTriplet &triplet) const
 

Detailed Description

Definition at line 36 of file CRDFGraph.h.

Member Typedef Documentation

Definition at line 40 of file CRDFGraph.h.

Definition at line 39 of file CRDFGraph.h.

typedef std::multimap< CRDFNode *, CRDFTriplet > CRDFGraph::Node2Triplet

Definition at line 42 of file CRDFGraph.h.

typedef std::pair< Node2Triplet::const_iterator, Node2Triplet::const_iterator> CRDFGraph::Node2TripletConstRange

Definition at line 44 of file CRDFGraph.h.

typedef std::pair< Node2Triplet::iterator, Node2Triplet::iterator> CRDFGraph::Node2TripletRange

Definition at line 43 of file CRDFGraph.h.

Definition at line 46 of file CRDFGraph.h.

typedef std::pair< Predicate2Triplet::const_iterator, Predicate2Triplet::const_iterator> CRDFGraph::Predicate2TripletConstRange

Definition at line 48 of file CRDFGraph.h.

typedef std::pair< Predicate2Triplet::iterator, Predicate2Triplet::iterator> CRDFGraph::Predicate2TripletRange

Definition at line 47 of file CRDFGraph.h.

Constructor & Destructor Documentation

CRDFGraph::CRDFGraph ( )

Default Constructor

Definition at line 33 of file CRDFGraph.cpp.

33  :
34  mpAbout(NULL),
39  mLiteralNodes(),
40  mTriplets(),
44  mGeneratedIds(),
45  mIdMap()
46 {}
Node2Triplet mSubject2Triplet
Definition: CRDFGraph.h:293
CRDFNode * mpAbout
Definition: CRDFGraph.h:258
std::vector< CRDFNode * > mLiteralNodes
Definition: CRDFGraph.h:283
std::map< std::string, CRDFNode * > mBlankNodeId2Node
Definition: CRDFGraph.h:268
std::map< std::string, std::string > mPrefix2Namespace
Definition: CRDFGraph.h:263
Node2Triplet mObject2Triplet
Definition: CRDFGraph.h:298
std::set< unsigned int > mGeneratedIds
Definition: CRDFGraph.h:308
std::map< std::string, CRDFNode * > mLocalResource2Node
Definition: CRDFGraph.h:273
Predicate2Triplet mPredicate2Triplet
Definition: CRDFGraph.h:303
std::set< CRDFTriplet > mTriplets
Definition: CRDFGraph.h:288
std::map< std::string, std::string > mIdMap
Definition: CRDFGraph.h:313
std::vector< CRDFNode * > mRemoteResourceNodes
Definition: CRDFGraph.h:278
CRDFGraph::~CRDFGraph ( )

Destructor

Definition at line 48 of file CRDFGraph.cpp.

References mBlankNodeId2Node, mLiteralNodes, mLocalResource2Node, mObject2Triplet, mPredicate2Triplet, mRemoteResourceNodes, mSubject2Triplet, mTriplets, and pdelete.

49 {
50  // We first clear the sets and maps
51  // This is necessary since they refer to the nodes which are destroyed later.
52  mTriplets.clear();
53  mSubject2Triplet.clear();
54  mObject2Triplet.clear();
55  mPredicate2Triplet.clear();
56 
57  // Note: mpAbout is not explicitly destroyed since it is contained in the map
58  // of resource nodes.
59  std::map< std::string, CRDFNode * >::iterator itMap;
60  std::map< std::string, CRDFNode * >::iterator endMap;
61 
62  for (itMap = mBlankNodeId2Node.begin(), endMap = mBlankNodeId2Node.end();
63  itMap != endMap; ++itMap)
64  pdelete(itMap->second);
65 
66  for (itMap = mLocalResource2Node.begin(), endMap = mLocalResource2Node.end();
67  itMap != endMap; ++itMap)
68  pdelete(itMap->second);
69 
70  std::vector< CRDFNode *>::iterator itVector;
71  std::vector< CRDFNode *>::iterator endVector;
72 
73  for (itVector = mRemoteResourceNodes.begin(), endVector = mRemoteResourceNodes.end();
74  itVector != endVector; ++itVector)
75  pdelete(*itVector);
76 
77  for (itVector = mLiteralNodes.begin(), endVector = mLiteralNodes.end();
78  itVector != endVector; ++itVector)
79  pdelete(*itVector);
80 }
Node2Triplet mSubject2Triplet
Definition: CRDFGraph.h:293
#define pdelete(p)
Definition: copasi.h:215
std::vector< CRDFNode * > mLiteralNodes
Definition: CRDFGraph.h:283
std::map< std::string, CRDFNode * > mBlankNodeId2Node
Definition: CRDFGraph.h:268
Node2Triplet mObject2Triplet
Definition: CRDFGraph.h:298
std::map< std::string, CRDFNode * > mLocalResource2Node
Definition: CRDFGraph.h:273
Predicate2Triplet mPredicate2Triplet
Definition: CRDFGraph.h:303
std::set< CRDFTriplet > mTriplets
Definition: CRDFGraph.h:288
std::vector< CRDFNode * > mRemoteResourceNodes
Definition: CRDFGraph.h:278

Member Function Documentation

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

Parameters
conststd::string & prefix
conststd::string & namespace
Returns
bool success;

Definition at line 128 of file CRDFGraph.cpp.

References CCopasiMessage::ERROR, MCAnnotation, and mPrefix2Namespace.

Referenced by updateNamespaces().

129 {
130  std::pair< std::map< std::string, std::string >::iterator, bool > inserted =
131  mPrefix2Namespace.insert(std::pair< std::string, std::string >(prefix, uri));
132 
133  if (inserted.second || (inserted.first->second == uri))
134  return true;
135 
137  prefix.c_str(), inserted.first->second.c_str(), uri.c_str());
138  return false;
139 }
std::map< std::string, std::string > mPrefix2Namespace
Definition: CRDFGraph.h:263
#define MCAnnotation
CRDFTriplet CRDFGraph::addTriplet ( const CRDFSubject subject,
const CRDFPredicate predicate,
const CRDFObject object 
)

Add a triplet to the graph

Parameters
constCRDFSubject & subject
constCRDFPredicate & predicate
constCRDFObject & object
Returns
CRDFTriplet triplet

Definition at line 141 of file CRDFGraph.cpp.

References CRDFSubject::BLANK_NODE, CRDFSubject::getBlankNodeID(), CRDFSubject::getResource(), CRDFSubject::getType(), CRDFSubject::isLocal(), CRDFNode::isSubjectNode(), mBlankNodeId2Node, mLocalResource2Node, mRemoteResourceNodes, CRDFSubject::RESOURCE, and CRDFNode::setSubject().

Referenced by CRDFNode::addEdge(), CRDFNode::addTripletToGraph(), CRDFGraphConverter::convert(), CMIRIAMInfo::createBiologicalDescription(), CMIRIAMInfo::createCreator(), CRDFNode::createMissingAncestors(), CMIRIAMInfo::createModification(), CMIRIAMInfo::createReference(), CMIRIAMInfo::setCreatedDT(), and CRDFNode::setFieldValue().

144 {
145  // Find or create the subject node
146  std::map< std::string, CRDFNode * >::iterator found;
147  CRDFNode * pSubjectNode = NULL;
148 
149  switch (subject.getType())
150  {
152 
153  if (subject.isLocal())
154  {
155  found = mLocalResource2Node.find(subject.getResource());
156 
157  if (found != mLocalResource2Node.end())
158  {
159  pSubjectNode = found->second;
160 
161  if (!pSubjectNode->isSubjectNode())
162  pSubjectNode->setSubject(subject);
163  }
164  else
165  {
166  pSubjectNode = new CRDFNode(*this);
167  pSubjectNode->setSubject(subject);
168  mLocalResource2Node[subject.getResource()] = pSubjectNode;
169  }
170  }
171  else
172  {
173  pSubjectNode = new CRDFNode(*this);
174  pSubjectNode->setSubject(subject);
175  mRemoteResourceNodes.push_back(pSubjectNode);
176  }
177 
178  break;
179 
181  found = mBlankNodeId2Node.find(subject.getBlankNodeID());
182 
183  if (found != mBlankNodeId2Node.end())
184  pSubjectNode = found->second;
185  else
186  {
187  pSubjectNode = new CRDFNode(*this);
188  pSubjectNode->setSubject(subject);
189  mBlankNodeId2Node[subject.getBlankNodeID()] = pSubjectNode;
190  }
191 
192  break;
193  }
194 
195  // Find or create the object node
196  CRDFNode * pObjectNode = NULL;
197 
198  switch (object.getType())
199  {
201 
202  if (object.isLocal())
203  {
204  found = mLocalResource2Node.find(object.getResource());
205 
206  if (found != mLocalResource2Node.end())
207  {
208  pObjectNode = found->second;
209 
210  if (!pObjectNode->isObjectNode())
211  pObjectNode->setObject(object);
212  }
213  else
214  {
215  pObjectNode = new CRDFNode(*this);
216  pObjectNode->setObject(object);
217  mLocalResource2Node[object.getResource()] = pObjectNode;
218  }
219  }
220  else
221  {
222  pObjectNode = new CRDFNode(*this);
223  pObjectNode->setObject(object);
224  mRemoteResourceNodes.push_back(pObjectNode);
225  }
226 
227  break;
228 
230  found = mBlankNodeId2Node.find(object.getBlankNodeID());
231 
232  if (found != mBlankNodeId2Node.end())
233  pObjectNode = found->second;
234  else
235  {
236  pObjectNode = new CRDFNode(*this);
237  pObjectNode->setObject(object);
238  mBlankNodeId2Node[object.getBlankNodeID()] = pObjectNode;
239  }
240 
241  break;
242 
243  case CRDFObject::LITERAL:
244  pObjectNode = new CRDFNode(*this);
245  pObjectNode->setObject(object);
246  mLiteralNodes.push_back(pObjectNode);
247  break;
248  }
249 
250  if (predicate == CRDFPredicate::rdf_predicate &&
251  pObjectNode->getObject().getType() == CRDFObject::RESOURCE &&
254 
255  return pSubjectNode->addEdge(predicate, pObjectNode);
256 }
const std::string & getResource() const
Definition: CRDFSubject.cpp:82
const eObjectType & getType() const
Definition: CRDFObject.cpp:85
std::vector< CRDFNode * > mLiteralNodes
Definition: CRDFGraph.h:283
void setSubject(const CRDFSubject &subject)
Definition: CRDFNode.cpp:52
const std::string & getBlankNodeID() const
Definition: CRDFSubject.cpp:91
static ePredicateType getPredicateFromURI(const std::string &URI)
std::map< std::string, CRDFNode * > mBlankNodeId2Node
Definition: CRDFGraph.h:268
CRDFObject & getObject()
Definition: CRDFNode.cpp:94
bool isSubjectNode() const
Definition: CRDFNode.cpp:414
std::map< std::string, CRDFNode * > mLocalResource2Node
Definition: CRDFGraph.h:273
void setResource(const std::string &resource, const bool &isLocal)
Definition: CRDFObject.cpp:88
bool isObjectNode() const
Definition: CRDFNode.cpp:417
const std::string & getURI() const
const bool & isLocal() const
Definition: CRDFSubject.cpp:85
std::vector< CRDFNode * > mRemoteResourceNodes
Definition: CRDFGraph.h:278
void setObject(const CRDFObject &object)
Definition: CRDFNode.cpp:77
CRDFTriplet addEdge(const CRDFPredicate &predicate, CRDFNode *pObject)
Definition: CRDFNode.cpp:321
const std::string & getResource() const
Definition: CRDFObject.cpp:94
const eSubjectType & getType() const
Definition: CRDFSubject.cpp:73
bool CRDFGraph::addTriplet ( const CRDFTriplet triplet)
private

Add a triplet to the graph. This method should only be used by CRDFNode

Parameters
constCRDFTriplet & triplet
Returns
bool success

Definition at line 258 of file CRDFGraph.cpp.

References mObject2Triplet, mPredicate2Triplet, mSubject2Triplet, mTriplets, CRDFTriplet::pObject, CRDFTriplet::Predicate, and CRDFTriplet::pSubject.

259 {
260  if (!triplet)
261  return false;
262 
263  std::pair< std::set< CRDFTriplet >::iterator, bool> Insert = mTriplets.insert(triplet);
264 
265  if (Insert.second)
266  {
267  mSubject2Triplet.insert(std::pair< CRDFNode * const, CRDFTriplet >(triplet.pSubject, triplet));
268  mObject2Triplet.insert(std::pair< CRDFNode * const, CRDFTriplet >(triplet.pObject, triplet));
269  mPredicate2Triplet.insert(std::pair< const CRDFPredicate , CRDFTriplet >(triplet.Predicate, triplet));
270 
271  // DebugFile << "Inserted: " << triplet;
272  }
273 
274  return true;
275 }
Node2Triplet mSubject2Triplet
Definition: CRDFGraph.h:293
CRDFNode * pSubject
Definition: CRDFTriplet.h:38
Node2Triplet mObject2Triplet
Definition: CRDFGraph.h:298
Predicate2Triplet mPredicate2Triplet
Definition: CRDFGraph.h:303
std::set< CRDFTriplet > mTriplets
Definition: CRDFGraph.h:288
CRDFPredicate Predicate
Definition: CRDFTriplet.h:40
CRDFNode * pObject
Definition: CRDFTriplet.h:42
void CRDFGraph::clean ( )

Removes empty blank nodes . This should be called before CRDFWriter::xmlFromGraph

Definition at line 511 of file CRDFGraph.cpp.

References removeEmptyNodes().

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

512 {
513  while (removeEmptyNodes()) {};
514 }
bool removeEmptyNodes()
Definition: CRDFGraph.cpp:516
CRDFNode * CRDFGraph::createAboutNode ( const std::string &  key)

If no about node exists a node is created with the attribute: rdf:about="#key

Parameters
conststd::string & key
Returns
CRDFNode * pAbout

Definition at line 416 of file CRDFGraph.cpp.

References guessGraphRoot(), mLocalResource2Node, mpAbout, CRDFSubject::RESOURCE, CRDFSubject::setResource(), CRDFNode::setSubject(), and CRDFSubject::setType().

Referenced by CQRDFTreeView::enterProtected(), and CMIRIAMInfo::load().

417 {
418  std::string About = "#" + key;
419 
420  if (!guessGraphRoot(About))
421  {
422  CRDFSubject subject;
423  mpAbout = new CRDFNode(*this);
424 
426  subject.setResource(About, true);
427  mpAbout->setSubject(subject);
428  mLocalResource2Node[About] = mpAbout;
429  }
430 
431  return mpAbout;
432 }
CRDFNode * mpAbout
Definition: CRDFGraph.h:258
void setSubject(const CRDFSubject &subject)
Definition: CRDFNode.cpp:52
bool guessGraphRoot(const std::string &about=" ")
Definition: CRDFGraph.cpp:97
void setResource(const std::string &resource, const bool &isLocal)
Definition: CRDFSubject.cpp:76
std::map< std::string, CRDFNode * > mLocalResource2Node
Definition: CRDFGraph.h:273
void setType(const eSubjectType &type)
Definition: CRDFSubject.cpp:70
void CRDFGraph::destroyUnreferencedNode ( CRDFNode pNode)

Destroy a CRDFNode

Parameters
CRDFNode* pNode

Definition at line 610 of file CRDFGraph.cpp.

References CRDFObject::BLANK_NODE, CRDFObject::getBlankNodeID(), CRDFNode::getObject(), CRDFObject::getResource(), CRDFObject::getType(), CRDFObject::isLocal(), CRDFObject::LITERAL, mBlankNodeId2Node, mLiteralNodes, mLocalResource2Node, mObject2Triplet, mRemoteResourceNodes, mSubject2Triplet, and CRDFObject::RESOURCE.

Referenced by removeEmptyNodes(), and removeTriplet().

611 {
612  // We only can remove nodes which are no longer objects.
613  if (mObject2Triplet.count(pNode) > 0)
614  return;
615 
616  // Remove all triplets where the node is subject
617  std::pair< Node2Triplet::iterator, Node2Triplet::iterator> Range = mSubject2Triplet.equal_range(pNode);
618  std::set< CRDFTriplet > RemoveTriplets;
619 
620  for (; Range.first != Range.second; ++Range.first)
621  RemoveTriplets.insert(Range.first->second);
622 
623  std::set< CRDFTriplet >::const_iterator itTriplet = RemoveTriplets.begin();
624  std::set< CRDFTriplet >::const_iterator endTriplet = RemoveTriplets.end();
625 
626  for (; itTriplet != endTriplet; ++itTriplet)
627  itTriplet->pSubject->removeEdge(itTriplet->Predicate, itTriplet->pObject);
628 
629  // Remove the object from the appropriate container.
630  switch (pNode->getObject().getType())
631  {
633 
634  if (pNode->getObject().isLocal())
635  mLocalResource2Node.erase(pNode->getObject().getResource());
636  else
637  {
638  // Check whether the pointer still exists mRemoteResourceNodes
639  std::vector< CRDFNode * >::iterator it = mRemoteResourceNodes.begin();
640  std::vector< CRDFNode * >::iterator end = mRemoteResourceNodes.end();
641 
642  for (; it != end; ++it)
643  if (pNode == *it)
644  {
645  mRemoteResourceNodes.erase(it);
646  break;
647  }
648  }
649 
650  break;
651 
653  mBlankNodeId2Node.erase(pNode->getObject().getBlankNodeID());
654  break;
655 
656  case CRDFObject::LITERAL:
657  {
658  // Check whether the pointer still exists in mLiteralNodes
659  std::vector< CRDFNode * >::iterator it = mLiteralNodes.begin();
660  std::vector< CRDFNode * >::iterator end = mLiteralNodes.end();
661 
662  for (; it != end; ++it)
663  if (pNode == *it)
664  {
665  mLiteralNodes.erase(it);
666  break;
667  }
668  }
669  break;
670  }
671 
672  // Finally delete the object
673  delete pNode;
674 }
Node2Triplet mSubject2Triplet
Definition: CRDFGraph.h:293
const eObjectType & getType() const
Definition: CRDFObject.cpp:85
const bool & isLocal() const
Definition: CRDFObject.cpp:97
const std::string & getBlankNodeID() const
Definition: CRDFObject.cpp:103
std::vector< CRDFNode * > mLiteralNodes
Definition: CRDFGraph.h:283
std::map< std::string, CRDFNode * > mBlankNodeId2Node
Definition: CRDFGraph.h:268
Node2Triplet mObject2Triplet
Definition: CRDFGraph.h:298
CRDFObject & getObject()
Definition: CRDFNode.cpp:94
std::map< std::string, CRDFNode * > mLocalResource2Node
Definition: CRDFGraph.h:273
std::vector< CRDFNode * > mRemoteResourceNodes
Definition: CRDFGraph.h:278
const std::string & getResource() const
Definition: CRDFObject.cpp:94
std::string CRDFGraph::generatedNodeId ( const std::string &  existingId = "")

Generate a unique blank node id.

Parameters
conststd::string & existingId (default: "")
Returns
std::string blankNodeId

Definition at line 380 of file CRDFGraph.cpp.

References mBlankNodeId2Node, mGeneratedIds, and mIdMap.

Referenced by CRDFGraphConverter::convert(), CMIRIAMInfo::createCreator(), CRDFNode::createMissingAncestors(), CMIRIAMInfo::createModification(), CMIRIAMInfo::createReference(), CMIRIAMInfo::setCreatedDT(), and CRDFNode::setFieldValue().

381 {
382  // If we have an existing Id we check whether we have already mapped it.
383  if (existingId != "")
384  {
385  std::map< std::string, std::string >::const_iterator found = mIdMap.find(existingId);
386 
387  if (found != mIdMap.end())
388  return found->second;
389  }
390 
391  unsigned int Id = 0;
392 
393  if (mGeneratedIds.rbegin() != mGeneratedIds.rend())
394  Id = *mGeneratedIds.rbegin();
395 
396  std::stringstream IdStream;
397  IdStream << "CopasiId" << ++Id;
398 
399  while (mBlankNodeId2Node.count(IdStream.str()) != 0)
400  {
401  mGeneratedIds.insert(Id);
402 
403  IdStream.str("");
404  IdStream << "CopasiId" << ++Id;
405  }
406 
407  mGeneratedIds.insert(Id);
408 
409  // Remember the mapping for an existing Id
410  if (existingId != "")
411  mIdMap[existingId] = IdStream.str();
412 
413  return IdStream.str();
414 }
std::map< std::string, CRDFNode * > mBlankNodeId2Node
Definition: CRDFGraph.h:268
std::set< unsigned int > mGeneratedIds
Definition: CRDFGraph.h:308
std::map< std::string, std::string > mIdMap
Definition: CRDFGraph.h:313
const CRDFNode * CRDFGraph::getAboutNode ( ) const

Retrieve the about/top node of the graph.

Returns
const CRDFNode * pAboutNode

Definition at line 82 of file CRDFGraph.cpp.

References mpAbout.

Referenced by CMIRIAMInfo::createBiologicalDescription(), CMIRIAMInfo::createCreator(), CMIRIAMInfo::createModification(), and CMIRIAMInfo::createReference().

83 {return mpAbout;}
CRDFNode * mpAbout
Definition: CRDFGraph.h:258
const std::map< std::string, CRDFNode * > & CRDFGraph::getBlankNodeMap ( ) const

Retrieve the map of IDs to blank nodes

Returns
const std::map< std::string, CRDFNode * > & blankNodeMap

Definition at line 88 of file CRDFGraph.cpp.

References mBlankNodeId2Node.

89 {return mBlankNodeId2Node;}
std::map< std::string, CRDFNode * > mBlankNodeId2Node
Definition: CRDFGraph.h:268
std::set< CRDFTriplet > CRDFGraph::getIncomingTriplets ( const CRDFNode pObject) const

Retrieve all triples pointing to the object

Parameters
constCRDFNode * pObject
Returns
std::set< CRDFTriplet > triplets

Definition at line 487 of file CRDFGraph.cpp.

References mObject2Triplet.

Referenced by removeEmptyNodes().

488 {
489  std::set< CRDFTriplet > Triplets;
490 
491  Node2TripletConstRange Range = mObject2Triplet.equal_range(const_cast< CRDFNode * >(pObject));
492 
493  for (; Range.first != Range.second; ++Range.first)
494  Triplets.insert(Range.first->second);
495 
496  return Triplets;
497 }
Node2Triplet mObject2Triplet
Definition: CRDFGraph.h:298
std::pair< Node2Triplet::const_iterator, Node2Triplet::const_iterator > Node2TripletConstRange
Definition: CRDFGraph.h:44
const std::map< std::string, CRDFNode * > & CRDFGraph::getLocalResourceNodeMap ( ) const

Retrieve the map of URIs to local resource nodes

Returns
const std::map< std::string, CRDFNode * > & localResourceNodeMap

Definition at line 91 of file CRDFGraph.cpp.

References mLocalResource2Node.

92 {return mLocalResource2Node;}
std::map< std::string, CRDFNode * > mLocalResource2Node
Definition: CRDFGraph.h:273
const std::map< std::string, std::string > & CRDFGraph::getNameSpaceMap ( ) const

Retrieve the map of prefixes to namespaces

Returns
const std::map< std::string, std::string > & nameSpaceMap

Definition at line 85 of file CRDFGraph.cpp.

References mPrefix2Namespace.

Referenced by CRDFWriter::initNamespaces().

86 {return mPrefix2Namespace;}
std::map< std::string, std::string > mPrefix2Namespace
Definition: CRDFGraph.h:263
std::set< const CRDFNode * > CRDFGraph::getParentSubjects ( const CRDFNode pObject) const

Retrieve all parent subjects of the object

Parameters
constCRDFNode * pObject
Returns
std::set< const CRDFNode * > nodes

Definition at line 499 of file CRDFGraph.cpp.

References mObject2Triplet.

Referenced by CRDFNode::hasAncestor().

500 {
501  std::set< const CRDFNode * > Nodes;
502 
503  Node2TripletConstRange Range = mObject2Triplet.equal_range(const_cast< CRDFNode * >(pObject));
504 
505  for (; Range.first != Range.second; ++Range.first)
506  Nodes.insert(Range.first->second.pSubject);
507 
508  return Nodes;
509 }
Node2Triplet mObject2Triplet
Definition: CRDFGraph.h:298
std::pair< Node2Triplet::const_iterator, Node2Triplet::const_iterator > Node2TripletConstRange
Definition: CRDFGraph.h:44
CRDFPredicate::Path CRDFGraph::getPredicatePath ( const CRDFNode pNode)

Retrieve the predicate path to the ginve node.

Parameters
constCRDFNode * pNode
Returns
CRDFPredicate::Path

Definition at line 349 of file CRDFGraph.cpp.

References CRDFPredicate::about, mObject2Triplet, mpAbout, and CRDFPredicate::rdf_li.

Referenced by CRDFNode::getDescendantsWithPredicate(), CRDFNode::getPath(), and CRDFNode::isReadOnly().

350 {
351  CRDFPredicate::Path Path;
352  CRDFNode * pCurrent = const_cast< CRDFNode * >(pNode);
353  Node2TripletRange Range = mObject2Triplet.equal_range(pCurrent);
354  std::set< const CRDFNode * > Visited;
355 
356  while ((Range.first != Range.second) &&
357  pCurrent != mpAbout)
358  {
359  // We ignore rdf_li predicates
360  if (Range.first->second.Predicate != CRDFPredicate::rdf_li)
361  Path.insert(Path.begin(), Range.first->second.Predicate.getType());
362 
363  pCurrent = Range.first->second.pSubject;
364 
365  std::pair< std::set< const CRDFNode * >::iterator, bool > Inserted =
366  Visited.insert(pCurrent);
367 
368  if (!Inserted.second)
369  break;
370 
371  Range = mObject2Triplet.equal_range(pCurrent);
372  }
373 
374  if (pCurrent == mpAbout)
375  Path.insert(Path.begin(), CRDFPredicate::about);
376 
377  return Path;
378 }
CRDFNode * mpAbout
Definition: CRDFGraph.h:258
Node2Triplet mObject2Triplet
Definition: CRDFGraph.h:298
std::pair< Node2Triplet::iterator, Node2Triplet::iterator > Node2TripletRange
Definition: CRDFGraph.h:43
std::vector< ePredicateType > Path
Definition: CRDFPredicate.h:91
const std::vector< CRDFNode * > & CRDFGraph::getRemoteResourceNodes ( ) const

Retrieve the vector of remote resource nodes

Returns
const std::vector< CRDFNode * > & remoteResourceNodes

Definition at line 94 of file CRDFGraph.cpp.

References mRemoteResourceNodes.

95 {return mRemoteResourceNodes;}
std::vector< CRDFNode * > mRemoteResourceNodes
Definition: CRDFGraph.h:278
const std::set< CRDFTriplet > & CRDFGraph::getTriplets ( ) const

Retrieve all triplets.

Returns
const std::set< CRDFTriplet > & triplets

Definition at line 434 of file CRDFGraph.cpp.

References mTriplets.

Referenced by CRDFNode::addEdge(), CRDFGraphConverter::convert(), CQRDFTreeView::enterProtected(), CRDFNode::getDescendantsWithPredicate(), getTriplets(), CRDFNode::isBagNode(), CRDFNode::removeEdge(), and CRDFWriter::write().

435 {return mTriplets;}
std::set< CRDFTriplet > mTriplets
Definition: CRDFGraph.h:288
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.

Parameters
constCRDFPredicate & predicate
constbool & expandBag (default: true)
Returns
std::set< CRDFTriplet > triplets

Definition at line 437 of file CRDFGraph.cpp.

References getTriplets(), mPredicate2Triplet, and CRDFPredicate::rdf_li.

439 {
440  std::set< CRDFTriplet > Triplets;
441 
442  Predicate2TripletConstRange Range = mPredicate2Triplet.equal_range(predicate);
443 
444  for (; Range.first != Range.second; ++Range.first)
445  if (expandBag &&
446  Range.first->second.pObject->isBagNode())
447  {
448  std::set< CRDFTriplet > LiTriplets = getTriplets(Range.first->second.pObject, CRDFPredicate::rdf_li);
449  std::set< CRDFTriplet >::const_iterator it = LiTriplets.begin();
450  std::set< CRDFTriplet >::const_iterator end = LiTriplets.end();
451 
452  for (; it != end; ++it)
453  Triplets.insert(CRDFTriplet(Range.first->second.pSubject, predicate, it->pObject));
454  }
455  else
456  Triplets.insert(Range.first->second);
457 
458  return Triplets;
459 }
const std::set< CRDFTriplet > & getTriplets() const
Definition: CRDFGraph.cpp:434
Predicate2Triplet mPredicate2Triplet
Definition: CRDFGraph.h:303
std::pair< Predicate2Triplet::const_iterator, Predicate2Triplet::const_iterator > Predicate2TripletConstRange
Definition: CRDFGraph.h:48
std::set< CRDFTriplet > CRDFGraph::getTriplets ( const CRDFNode pSubject) const

Retrieve all triplets with the specified subject

Parameters
constCRDFNode * pSubject
Returns
std::set< CRDFTriplet > triplets

Definition at line 461 of file CRDFGraph.cpp.

References mSubject2Triplet.

462 {
463  std::set< CRDFTriplet > Triplets;
464 
465  Node2TripletConstRange Range = mSubject2Triplet.equal_range(const_cast< CRDFNode * >(pSubject));
466 
467  for (; Range.first != Range.second; ++Range.first)
468  Triplets.insert(Range.first->second);
469 
470  return Triplets;
471 }
Node2Triplet mSubject2Triplet
Definition: CRDFGraph.h:293
std::pair< Node2Triplet::const_iterator, Node2Triplet::const_iterator > Node2TripletConstRange
Definition: CRDFGraph.h:44
std::set< CRDFTriplet > CRDFGraph::getTriplets ( const CRDFNode pSubject,
const CRDFPredicate predicate 
) const

Retrieve all triplets with the specified subject and predicate

Parameters
constCRDFNode * pSubject
constCRDFPredicate & predicate
Returns
std::set< CRDFTriplet > triplets

Definition at line 473 of file CRDFGraph.cpp.

References mPredicate2Triplet.

475 {
476  std::set< CRDFTriplet > Triplets;
477 
478  Predicate2TripletConstRange Range = mPredicate2Triplet.equal_range(predicate);
479 
480  for (; Range.first != Range.second; ++Range.first)
481  if (Range.first->second.pSubject == pSubject)
482  Triplets.insert(Range.first->second);
483 
484  return Triplets;
485 }
Predicate2Triplet mPredicate2Triplet
Definition: CRDFGraph.h:303
std::pair< Predicate2Triplet::const_iterator, Predicate2Triplet::const_iterator > Predicate2TripletConstRange
Definition: CRDFGraph.h:48
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

Parameters
conststd::string & about (default: <space>)
Returns
bool success

Definition at line 97 of file CRDFGraph.cpp.

References CRDFSubject::getResource(), CRDFNode::getSubject(), CRDFSubject::getType(), CRDFSubject::isLocal(), CRDFNode::isSubjectNode(), mLocalResource2Node, mpAbout, and CRDFSubject::RESOURCE.

Referenced by createAboutNode(), and CRDFParser::parse().

98 {
99  mpAbout = NULL;
100  CRDFNode * pNode;
101 
102  std::map< std::string, CRDFNode * >::iterator itMap = mLocalResource2Node.begin();
103  std::map< std::string, CRDFNode * >::iterator endMap = mLocalResource2Node.end();
104 
105  for (; itMap != endMap; ++itMap)
106  {
107  pNode = itMap->second;
108 
109  if (pNode->isSubjectNode() &&
110  pNode->getSubject().isLocal() &&
111  pNode->getSubject().getType() == CRDFSubject::RESOURCE &&
112  (about == " " ||
113  pNode->getSubject().getResource() == about))
114  {
115  if (mpAbout != NULL)
116  {
117  mpAbout = NULL;
118  break;
119  }
120 
121  mpAbout = pNode;
122  }
123  }
124 
125  return mpAbout != NULL;
126 }
const std::string & getResource() const
Definition: CRDFSubject.cpp:82
CRDFNode * mpAbout
Definition: CRDFGraph.h:258
const CRDFSubject & getSubject() const
Definition: CRDFNode.cpp:69
bool isSubjectNode() const
Definition: CRDFNode.cpp:414
std::map< std::string, CRDFNode * > mLocalResource2Node
Definition: CRDFGraph.h:273
const bool & isLocal() const
Definition: CRDFSubject.cpp:85
const eSubjectType & getType() const
Definition: CRDFSubject.cpp:73
CRDFTriplet CRDFGraph::moveTriplet ( CRDFNode pNewSubject,
const CRDFTriplet triplet 
)

Move a edge from one node to another

Parameters
CRDFNode* pNewSubject
CRDFNode* const CRDFTriplet & triplet
Returns
CRDFGraph::CRDFTriplet triplet

Definition at line 334 of file CRDFGraph.cpp.

References CRDFNode::addEdge(), CRDFTriplet::pObject, CRDFTriplet::Predicate, CRDFTriplet::pSubject, and CRDFNode::removeEdge().

Referenced by CRDFGraphConverter::convert().

335 {
336  CRDFTriplet Triplet = triplet;
337 
338  if (pNewSubject == NULL || !Triplet)
339  return Triplet;
340 
341  // We first create the new triplet before we remove the old to avoid
342  // destruction of the object/
343  Triplet = pNewSubject->addEdge(triplet.Predicate, triplet.pObject);
344  triplet.pSubject->removeEdge(triplet.Predicate, triplet.pObject);
345 
346  return Triplet;
347 }
CRDFNode * pSubject
Definition: CRDFTriplet.h:38
CRDFPredicate Predicate
Definition: CRDFTriplet.h:40
void removeEdge(const CRDFPredicate &predicate, CRDFNode *pObject)
Definition: CRDFNode.cpp:361
CRDFNode * pObject
Definition: CRDFTriplet.h:42
CRDFTriplet addEdge(const CRDFPredicate &predicate, CRDFNode *pObject)
Definition: CRDFNode.cpp:321
bool CRDFGraph::removeEmptyNodes ( )
private

Removes all empty blank nodes. It returns true if a node was removed

Returns
bool haveRemoved

Definition at line 516 of file CRDFGraph.cpp.

References destroyUnreferencedNode(), getIncomingTriplets(), CRDFNode::isBagNode(), mBlankNodeId2Node, and mSubject2Triplet.

Referenced by clean().

517 {
518  CRDFNode * pNode;
519 
520  std::map< std::string, CRDFNode * >::iterator it = mBlankNodeId2Node.begin();
521  std::map< std::string, CRDFNode * >::iterator end = mBlankNodeId2Node.end();
522 
523  std::set< CRDFNode * > ToBeRemoved;
524 
525  for (; it != end; ++it)
526  {
527  pNode = it->second;
528  size_t Edges =
529  mSubject2Triplet.count(pNode);
530 
531  if (Edges == 0 ||
532  (pNode->isBagNode() && Edges == 1))
533  ToBeRemoved.insert(pNode);
534  }
535 
536  std::set< CRDFNode * >::iterator itRemove = ToBeRemoved.begin();
537  std::set< CRDFNode * >::iterator endRemove = ToBeRemoved.end();
538 
539  for (; itRemove != endRemove; ++itRemove)
540  {
541  std::set< CRDFTriplet > Triplets = getIncomingTriplets(*itRemove);
542  std::set< CRDFTriplet >::const_iterator itTriplet = Triplets.begin();
543  std::set< CRDFTriplet >::const_iterator endTriplet = Triplets.end();
544 
545  if (itTriplet == endTriplet)
546  destroyUnreferencedNode(*itRemove);
547 
548  for (; itTriplet != endTriplet; ++itTriplet)
549  {
550  itTriplet->pSubject->removeEdge(itTriplet->Predicate,
551  itTriplet->pObject);
552  }
553  }
554 
555  return ToBeRemoved.size() > 0;
556 }
Node2Triplet mSubject2Triplet
Definition: CRDFGraph.h:293
bool isBagNode() const
Definition: CRDFNode.cpp:423
std::map< std::string, CRDFNode * > mBlankNodeId2Node
Definition: CRDFGraph.h:268
std::set< CRDFTriplet > getIncomingTriplets(const CRDFNode *pObject) const
Definition: CRDFGraph.cpp:487
void destroyUnreferencedNode(CRDFNode *pNode)
Definition: CRDFGraph.cpp:610
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.

Parameters
CRDFNode* pSubject
constCRDFPredicate & predicate
CRDFNode* pObject

Definition at line 277 of file CRDFGraph.cpp.

References CRDFNode::removeEdge().

Referenced by CRDFGraphConverter::convert(), CMIRIAMInfo::removeBiologicalDescription(), CMIRIAMInfo::removeCreator(), CMIRIAMInfo::removeModification(), CMIRIAMInfo::removeReference(), and CRDFNode::removeTripletFromGraph().

280 {pSubject->removeEdge(predicate, pObject);}
void removeEdge(const CRDFPredicate &predicate, CRDFNode *pObject)
Definition: CRDFNode.cpp:361
void CRDFGraph::removeTriplet ( const CRDFTriplet triplet)
private

Remove triplet from the graph. This method should only be used by CRDFNode Please note, this will also remove all unreferenced local resources created by removing the edge.

Parameters
constCRDFTriplet & triplet
Returns
bool success

Definition at line 282 of file CRDFGraph.cpp.

References destroyUnreferencedNode(), mObject2Triplet, mPredicate2Triplet, mSubject2Triplet, mTriplets, CRDFTriplet::pObject, CRDFTriplet::Predicate, and CRDFTriplet::pSubject.

283 {
284  if (!triplet)
285  return;
286 
287  // DebugFile << "Removed: " << triplet;
288 
289  // Remove the triplet
290  mTriplets.erase(triplet);
291 
292  // Remove its references
293  // Subject2Triplets
294  std::pair< Node2Triplet::iterator, Node2Triplet::iterator> Range = mSubject2Triplet.equal_range(triplet.pSubject);
295 
296  for (; Range.first != Range.second; ++Range.first)
297  if (Range.first->second == triplet)
298  {
299  mSubject2Triplet.erase(Range.first);
300 
301  // We must stop or make sure that the iterator Range is still valid. Since
302  // triplets are unique (we have at most one reference) we can stop.
303  break;
304  }
305 
306  Range = mObject2Triplet.equal_range(triplet.pObject);
307 
308  for (; Range.first != Range.second; ++Range.first)
309  if (Range.first->second == triplet)
310  {
311  mObject2Triplet.erase(Range.first);
312 
313  // We must stop or make sure that the iterator Range is still valid. Since
314  // triplets are unique (we have at most one reference) we can stop.
315  break;
316  }
317 
318  std::pair< Predicate2Triplet::iterator, Predicate2Triplet::iterator> RangeP = mPredicate2Triplet.equal_range(triplet.Predicate);
319 
320  for (; RangeP.first != RangeP.second; ++RangeP.first)
321  if (RangeP.first->second == triplet)
322  {
323  mPredicate2Triplet.erase(RangeP.first);
324 
325  // We must stop or make sure that the iterator RangeP is still valid. Since
326  // triplets are unique (we have at most one reference) we can stop.
327  break;
328  }
329 
331  return;
332 }
Node2Triplet mSubject2Triplet
Definition: CRDFGraph.h:293
CRDFNode * pSubject
Definition: CRDFTriplet.h:38
Node2Triplet mObject2Triplet
Definition: CRDFGraph.h:298
Predicate2Triplet mPredicate2Triplet
Definition: CRDFGraph.h:303
std::set< CRDFTriplet > mTriplets
Definition: CRDFGraph.h:288
CRDFPredicate Predicate
Definition: CRDFTriplet.h:40
void destroyUnreferencedNode(CRDFNode *pNode)
Definition: CRDFGraph.cpp:610
CRDFNode * pObject
Definition: CRDFTriplet.h:42
void CRDFGraph::updateNamespaces ( )

Removes all unused name spaces.

Definition at line 558 of file CRDFGraph.cpp.

References addNameSpace(), mPrefix2Namespace, and mTriplets.

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

559 {
560  // We make sure that all namespaces COPASI uses are known.
561  addNameSpace("CopasiMT", "http://www.copasi.org/RDF/MiriamTerms#");
562  addNameSpace("dcterms", "http://purl.org/dc/terms/");
563  addNameSpace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
564  addNameSpace("vCard", "http://www.w3.org/2001/vcard-rdf/3.0#");
565 
566  std::vector< bool > Used(mPrefix2Namespace.size(), false);
567  std::vector< bool >::iterator itUsed;
568 
569  // We loop over all triplets
570  const_iterator it = mTriplets.begin();
571  const_iterator end = mTriplets.end();
572 
573  std::map< std::string, std::string >::iterator itNamespace;
574  std::map< std::string, std::string >::iterator endNamespace = mPrefix2Namespace.end();
575 
576  for (; it != end; ++it)
577  {
578  for (itNamespace = mPrefix2Namespace.begin(), itUsed = Used.begin();
579  itNamespace != endNamespace;
580  ++itNamespace, ++itUsed)
581  if (!*itUsed)
582  {
583  const std::string & Predicate = it->Predicate.getURI();
584 
585  if (Predicate.compare(0, itNamespace->second.length(), itNamespace->second) == 0)
586  {
587  *itUsed = true;
588  break;
589  }
590  }
591  }
592 
593  itNamespace = mPrefix2Namespace.begin();
594  itUsed = Used.begin();
595  std::vector< std::string > ToBeRemoved;
596 
597  for (itNamespace = mPrefix2Namespace.begin(), itUsed = Used.begin();
598  itNamespace != endNamespace;
599  ++itNamespace, ++itUsed)
600  if (!*itUsed)
601  ToBeRemoved.push_back(itNamespace->first);
602 
603  std::vector< std::string >::iterator itRemove = ToBeRemoved.begin();
604  std::vector< std::string >::iterator endRemove = ToBeRemoved.end();
605 
606  for (; itRemove != endRemove; ++itRemove)
607  mPrefix2Namespace.erase(*itRemove);
608 }
std::map< std::string, std::string > mPrefix2Namespace
Definition: CRDFGraph.h:263
std::set< CRDFTriplet > mTriplets
Definition: CRDFGraph.h:288
bool addNameSpace(const std::string &prefix, const std::string &uri)
Definition: CRDFGraph.cpp:128
std::set< CRDFTriplet >::const_iterator const_iterator
Definition: CRDFGraph.h:40

Friends And Related Function Documentation

bool CRDFNode::addTripletToGraph ( const CRDFTriplet triplet) const
friend
void CRDFNode::removeTripletFromGraph ( const CRDFTriplet triplet) const
friend

Member Data Documentation

std::map< std::string, CRDFNode * > CRDFGraph::mBlankNodeId2Node
private

A map of blank node ids to nodes of the graph.

Definition at line 268 of file CRDFGraph.h.

Referenced by addTriplet(), destroyUnreferencedNode(), generatedNodeId(), getBlankNodeMap(), removeEmptyNodes(), and ~CRDFGraph().

std::set< unsigned int > CRDFGraph::mGeneratedIds
private

Memory for generated Ids

Definition at line 308 of file CRDFGraph.h.

Referenced by generatedNodeId().

std::map< std::string, std::string > CRDFGraph::mIdMap
private

Mapping from existing Ids to newly created ones.

Definition at line 313 of file CRDFGraph.h.

Referenced by generatedNodeId().

std::vector< CRDFNode * > CRDFGraph::mLiteralNodes
private

A vector of all literal nodes of the graph

Definition at line 283 of file CRDFGraph.h.

Referenced by destroyUnreferencedNode(), and ~CRDFGraph().

std::map< std::string, CRDFNode * > CRDFGraph::mLocalResource2Node
private

A map of resource URIs to local resource nodes of the graph, i

Definition at line 273 of file CRDFGraph.h.

Referenced by addTriplet(), createAboutNode(), destroyUnreferencedNode(), getLocalResourceNodeMap(), guessGraphRoot(), and ~CRDFGraph().

Node2Triplet CRDFGraph::mObject2Triplet
private
CRDFNode* CRDFGraph::mpAbout
private

The subject node this RDF graph is about

Definition at line 258 of file CRDFGraph.h.

Referenced by createAboutNode(), getAboutNode(), getPredicatePath(), and guessGraphRoot().

Predicate2Triplet CRDFGraph::mPredicate2Triplet
private

Definition at line 303 of file CRDFGraph.h.

Referenced by addTriplet(), getTriplets(), removeTriplet(), and ~CRDFGraph().

std::map< std::string, std::string > CRDFGraph::mPrefix2Namespace
private

A map of prefixes to namespaces

Definition at line 263 of file CRDFGraph.h.

Referenced by addNameSpace(), getNameSpaceMap(), and updateNamespaces().

std::vector< CRDFNode * > CRDFGraph::mRemoteResourceNodes
private

A vector of all remote resource nodes of the graph

Definition at line 278 of file CRDFGraph.h.

Referenced by addTriplet(), destroyUnreferencedNode(), getRemoteResourceNodes(), and ~CRDFGraph().

Node2Triplet CRDFGraph::mSubject2Triplet
private
std::set< CRDFTriplet > CRDFGraph::mTriplets
private

All the triplets of the graph

Definition at line 288 of file CRDFGraph.h.

Referenced by addTriplet(), getTriplets(), removeTriplet(), updateNamespaces(), and ~CRDFGraph().


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