src/PredFinder/elf/ElfRelationFactory.cpp
/**
 * Converts the specified ElfString to its equivalent relations,
 * following the convention that <name> becomes ic:hasName, <desc>
 * becomes rdfs:label, and <type> becomes rdf:type.
 *
 * Intended for use during R-ELF macro conversion.
 *
 * @param individual The string's containing individual.
 * @param string The string being converted, with provenance
 * @return The relation asserting the specified string.
 *
 * @author nward@bbn.com
 * @date 2010.10.26
 **/
Converts the specified ElfString to its equivalent relations,
following the convention that  becomes ic:hasName, 
becomes rdfs:label, and  becomes rdf:type.

Intended for use during R-ELF macro conversion.

@param individual The string's containing individual.
@param string The string being converted, with provenance
@return The relation asserting the specified string.


Converts the specified ElfString to its equivalent relations following the convention that becomes ic : hasName becomes rdfs : label and becomes rdf : type . Intended for use during R - ELF macro conversion . @param individual The string ' s containing individual . @param string The string being converted with provenance @return The relation asserting the specified string .
ElfRelation_ptr ElfRelationFactory::from_elf_string(const std::wstring& domain_prefix, const ElfIndividual_ptr individual, 
													const ElfString_ptr string) {
	std::wstring predicate = L"";
	std::wstring object_type = L"";
	switch (string->get_type()) {
	case ElfString::NAME:
		if (domain_prefix == L"ic")
			predicate = L"ic:hasName";
		else
			predicate = L"rdfs:label";
		object_type = L"xsd:string";
		break;
	case ElfString::DESC:
		predicate = L"rdfs:label";
		object_type = L"xsd:string";
		break;
	case ElfString::TYPE:
		predicate = L"rdf:type";
		break;
	}
	std::vector<ElfRelationArg_ptr> args;
	args.push_back(boost::make_shared<ElfRelationArg>(L"rdf:subject", individual));
	args.push_back(boost::make_shared<ElfRelationArg>(L"rdf:object", object_type, string->get_value()));
	ElfRelation_ptr relation = boost::make_shared<ElfRelation>(predicate, args, L"", EDTOffset(), EDTOffset(), Pattern::UNSPECIFIED_SCORE, Pattern::UNSPECIFIED_SCORE_GROUP);
	return relation;
}
ElfRelation_ptr ElfRelationFactory :: from_elf_string ( const std :: wstring & domain_prefix , const ElfIndividual_ptr individual , const ElfString_ptr string ) { std :: wstring predicate = L" " ; std :: wstring object_type = L" " ; switch ( string -> get_type ( ) ) { case ElfString :: NAME : if ( domain_prefix == L" " ) predicate = L" " ; else predicate = L" " ; object_type = L" " ; break ; case ElfString :: DESC : predicate = L" " ; object_type = L" " ; break ; case ElfString :: TYPE : predicate = L" " ; break ; } std :: vector < ElfRelationArg_ptr > args ; args . push_back ( boost :: make_shared < ElfRelationArg > ( L" " , individual ) ) ; args . push_back ( boost :: make_shared < ElfRelationArg > ( L" " , object_type , string -> get_value ( ) ) ) ; ElfRelation_ptr relation = boost :: make_shared < ElfRelation > ( predicate , args , L" " , EDTOffset ( ) , EDTOffset ( ) , Pattern :: UNSPECIFIED_SCORE , Pattern :: UNSPECIFIED_SCORE_GROUP ) ; return relation ; }
Converts the specified ElfString to its equivalent relations,
 following the convention that <name> becomes ic:hasName, <desc>
 becomes rdfs:label, and <type> becomes rdf:type.
Converts the specified ElfString to its equivalent relations following the convention that <name > becomes ic : hasName <desc > becomes rdfs : label and <type > becomes rdf : type .
// Determine a predicate name and types based on the string subtype
 // Create the subject argument from the individual and associate the provenance
 // Create the object argument from the string
 // Create the relation from the arguments
 //   No relation provenance, we associate that with the object arg
 // Done
