src/PredFinder/elf/ElfRelationFactory.cpp
/**
 * Given a SlotConstraints_ptr, extract the role. If the role is nonempty and is not
 * already contained in roles_already_found, also extract the type and value 
 * (for some types, filling in the value with a fake but plausible entry). Build
 * it into an arg, and push it back onto the end of arg_vec.
 *
 * @param sc_ptr The SlotConstraints_ptr from which information is to be extracted.
 * @param roles_already_found A set of the roles already found.
 * @param arg_vec A vector of args, passed by reference, to which this method will append
 * a single arg if it has a different role from the ones already contained in the vector.
 *
 * @author afrankel@bbn.com
 * @date 2011.07.07
 **/
Given a SlotConstraints_ptr, extract the role. If the role is nonempty and is not
already contained in roles_already_found, also extract the type and value
(for some types, filling in the value with a fake but plausible entry). Build
it into an arg, and push it back onto the end of arg_vec.

@param sc_ptr The SlotConstraints_ptr from which information is to be extracted.
@param roles_already_found A set of the roles already found.
@param arg_vec A vector of args, passed by reference, to which this method will append
a single arg if it has a different role from the ones already contained in the vector.


Given a SlotConstraints_ptr extract the role . If the role is nonempty and is not already contained in roles_already_found also extract the type and value ( for some types filling in the value with a fake but plausible entry ) . Build it into an arg and push it back onto the end of arg_vec . @param sc_ptr The SlotConstraints_ptr from which information is to be extracted . @param roles_already_found A set of the roles already found . @param arg_vec A vector of args passed by reference to which this method will append a single arg if it has a different role from the ones already contained in the vector .
void ElfRelationFactory::add_arg_from_slot_constraints(const SlotConstraints_ptr sc_ptr, 
    std::set<std::wstring> & roles_already_found, std::vector< ElfRelationArg_ptr > & arg_vec) 
{
	std::wstring role = sc_ptr->getELFRole();
	if (role.empty()) {
		return;
	}
	if (roles_already_found.find(role) == roles_already_found.end()) {
		roles_already_found.insert(role);
        std::wstring type = sc_ptr->getELFOntologyType();
        std::wstring value;
        update_fake_value_from_type(type, value);
		ElfRelationArg_ptr arg = boost::make_shared<ElfRelationArg>(role, type, value);
		arg_vec.push_back(arg);
    }    
}
void ElfRelationFactory :: add_arg_from_slot_constraints ( const SlotConstraints_ptr sc_ptr , std :: set < std :: wstring > & roles_already_found , std :: vector < ElfRelationArg_ptr > & arg_vec ) { std :: wstring role = sc_ptr -> getELFRole ( ) ; if ( role . empty ( ) ) { return ; } if ( roles_already_found . find ( role ) == roles_already_found . end ( ) ) { roles_already_found . insert ( role ) ; std :: wstring type = sc_ptr -> getELFOntologyType ( ) ; std :: wstring value ; update_fake_value_from_type ( type , value ) ; ElfRelationArg_ptr arg = boost :: make_shared < ElfRelationArg > ( role , type , value ) ; arg_vec . push_back ( arg ) ; } }
Given a SlotConstraints_ptr, extract the role.
Given a SlotConstraints_ptr extract the role .