src/Generic/icews/ICEWSOutputWriter.cpp
/** Add the cell values that are used to store a given participant
	(source or target) for WMS.  Include the leading comma.  */
Add the cell values that are used to store a given participant
(source or target) for WMS.  Include the leading comma.
Add the cell values that are used to store a given participant ( source or target ) for WMS . Include the leading comma .
void ICEWSOutputWriter::addWMSParticipantToQuery(ActorMention_ptr actor, std::ostringstream &query) {
	query << ",";
	ActorId actorID = ActorId();
	AgentId agentID = AgentId();
	if (ProperNounActorMention_ptr pm = boost::dynamic_pointer_cast<ProperNounActorMention>(actor)) {
		actorID = pm->getActorId();
	} else if (CompositeActorMention_ptr cm = boost::dynamic_pointer_cast<CompositeActorMention>(actor)) {
		actorID = cm->getPairedActorId();
		agentID = cm->getPairedAgentId();
	} 
	std::string actorName = "NULL";
	if (!actorID.isNull()) {
		query << actorID << ", ";
		query << DatabaseConnection::quote(_actorInfo->getName(actorID)) << ", ";
		std::vector<ActorId> countries = _actorInfo->getAssociatedCountryActorIds(actorID);
		if (countries.size() > 0) {
			ActorId countryID = countries.at(0);
			query << countryID << ", ";
			query << DatabaseConnection::quote(_actorInfo->getName(countryID)) << ", ";
		} else query << "NULL, NULL, ";
	} else query << "NULL, NULL, NULL, NULL, ";
	if (!agentID.isNull()) {
		query << agentID << ", ";
		query << DatabaseConnection::quote(_actorInfo->getName(agentID));
	} else query << "NULL, NULL ";
}
void ICEWSOutputWriter :: addWMSParticipantToQuery ( ActorMention_ptr actor , std :: ostringstream & query ) { query << " " ; ActorId actorID = ActorId ( ) ; AgentId agentID = AgentId ( ) ; if ( ProperNounActorMention_ptr pm = boost :: dynamic_pointer_cast < ProperNounActorMention > ( actor ) ) { actorID = pm -> getActorId ( ) ; } else if ( CompositeActorMention_ptr cm = boost :: dynamic_pointer_cast < CompositeActorMention > ( actor ) ) { actorID = cm -> getPairedActorId ( ) ; agentID = cm -> getPairedAgentId ( ) ; } std :: string actorName = " " ; if ( ! actorID . isNull ( ) ) { query << actorID << " " ; query << DatabaseConnection :: quote ( _actorInfo -> getName ( actorID ) ) << " " ; std :: vector < ActorId > countries = _actorInfo -> getAssociatedCountryActorIds ( actorID ) ; if ( countries . size ( ) > 0 ) { ActorId countryID = countries . at ( 0 ) ; query << countryID << " " ; query << DatabaseConnection :: quote ( _actorInfo -> getName ( countryID ) ) << " " ; } else query << " " ; } else query << " " ; if ( ! agentID . isNull ( ) ) { query << agentID << " " ; query << DatabaseConnection :: quote ( _actorInfo -> getName ( agentID ) ) ; } else query << " " ; }
Add the cell values that are used to store a given participant
(source or target) for WMS.
Add the cell values that are used to store a given participant ( source or target ) for WMS .