test_class.file: core/src/test/java/edu/tuberlin/dima/textmining/jedi/core/freebase/FreebaseHelperTest.java
test_class.identifier: FreebaseHelperTest
test_case.body: @Test
  	public void testReplacedTopic() throws Exception {
  		FreebaseHelper  freebaseHelper = new FreebaseHelper();
  
  		final FreebaseHelper.Entity nameForID = freebaseHelper.getNameForID("/m/07mt8q3");
  
  		System.out.println(nameForID);
  
  	}
test_case.class_method_signature: FreebaseHelperTest.testReplacedTopic()
test_case.full_signature: @Test public void testReplacedTopic()
test_case.identifier: testReplacedTopic
test_case.invocations: getNameForID println
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReplacedTopic()
focal_class.declarator: FREEBASE_TOPIC_ENDPOINT = "https://www.googleapis.com/freebase/v1/topic{id}?filter=/common/topic/description&filter=/type/object/guid&filter=/type/object/type&filter=/type/object/name&filter=/common/topic/alias&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA"
focal_class.modifier: private static final
focal_class.original_string: private static final String FREEBASE_TOPIC_ENDPOINT = "https://www.googleapis.com/freebase/v1/topic{id}?filter=/common/topic/description&filter=/type/object/guid&filter=/type/object/type&filter=/type/object/name&filter=/common/topic/alias&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA";
focal_class.type: String
focal_class.var_name: FREEBASE_TOPIC_ENDPOINT
focal_class.declarator: FREEBASE_SEARCH_API = "https://www.googleapis.com/freebase/v1/search?limit=1&scoring=entity&query={id}&prefixed=true&output=(%2Fcommon%2Ftopic%2Fdescription+type+name+%2Fcommon%2Ftopic%2Falias)&lang=en&indent=true&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA"
focal_class.modifier: private static final
focal_class.original_string: private static final String FREEBASE_SEARCH_API = "https://www.googleapis.com/freebase/v1/search?limit=1&scoring=entity&query={id}&prefixed=true&output=(%2Fcommon%2Ftopic%2Fdescription+type+name+%2Fcommon%2Ftopic%2Falias)&lang=en&indent=true&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA";
focal_class.type: String
focal_class.var_name: FREEBASE_SEARCH_API
focal_class.declarator: FREEBASE_MQL_ENDPOINT = "https://www.googleapis.com/freebase/v1/mqlread/?lang=%2Flang%2Fen&query=%5B%7B%20%22id%22%3A%20%22{id}%22%2C%20%22%2Fdataworld%2Fgardening_hint%2Freplaced_by%22%3A%20%5B%7B%22mid%22%3A%20null%20%7D%5D%20%7D%5D%0A%0A%0A&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA"
focal_class.modifier: private static final
focal_class.original_string: private static final String FREEBASE_MQL_ENDPOINT = "https://www.googleapis.com/freebase/v1/mqlread/?lang=%2Flang%2Fen&query=%5B%7B%20%22id%22%3A%20%22{id}%22%2C%20%22%2Fdataworld%2Fgardening_hint%2Freplaced_by%22%3A%20%5B%7B%22mid%22%3A%20null%20%7D%5D%20%7D%5D%0A%0A%0A&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA";
focal_class.type: String
focal_class.var_name: FREEBASE_MQL_ENDPOINT
focal_class.declarator: FREEBASE_MQL_ENDPOINT_SUBRELATION_RELATION = "https://www.googleapis.com/freebase/v1/mqlread/?lang=%2Flang%2Fen&query=%5B%7B%20%22mid%22%3A%20%22{id1}%22%2C%20%22{REL1}%22%3A%20%5B%7B%22{REL2}%22%3A%20%7B%22mid%22%3A%20%22{id2}%22%7D%7D%5D%7D%5D%0A%0A&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA"
focal_class.modifier: private static final
focal_class.original_string: private static final String FREEBASE_MQL_ENDPOINT_SUBRELATION_RELATION = "https://www.googleapis.com/freebase/v1/mqlread/?lang=%2Flang%2Fen&query=%5B%7B%20%22mid%22%3A%20%22{id1}%22%2C%20%22{REL1}%22%3A%20%5B%7B%22{REL2}%22%3A%20%7B%22mid%22%3A%20%22{id2}%22%7D%7D%5D%7D%5D%0A%0A&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA";
focal_class.type: String
focal_class.var_name: FREEBASE_MQL_ENDPOINT_SUBRELATION_RELATION
focal_class.declarator: FREEBASE_MQL_ENDPOINT_RELATION = "https://www.googleapis.com/freebase/v1/mqlread/?lang=%2Flang%2Fen&query=%5B%7B%20%22mid%22%3A%20%22{id1}%22%2C%20%22{REL1}%22%3A%20%5B%7B%22mid%22%3A%20%22{id2}%22%7D%5D%7D%5D%0A%0A&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA"
focal_class.modifier: private static final
focal_class.original_string: private static final String FREEBASE_MQL_ENDPOINT_RELATION = "https://www.googleapis.com/freebase/v1/mqlread/?lang=%2Flang%2Fen&query=%5B%7B%20%22mid%22%3A%20%22{id1}%22%2C%20%22{REL1}%22%3A%20%5B%7B%22mid%22%3A%20%22{id2}%22%7D%5D%7D%5D%0A%0A&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA";
focal_class.type: String
focal_class.var_name: FREEBASE_MQL_ENDPOINT_RELATION
focal_class.declarator: FREEBASE_INVERSE_RELATION = "https://www.googleapis.com/freebase/v1/topic{id}?filter=/type/property/reverse_property&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA"
focal_class.modifier: private static final
focal_class.original_string: private static final String FREEBASE_INVERSE_RELATION = "https://www.googleapis.com/freebase/v1/topic{id}?filter=/type/property/reverse_property&key=AIzaSyCyloa8DMxhKvBVdqdk_Drf900rAeeA7QA";
focal_class.type: String
focal_class.var_name: FREEBASE_INVERSE_RELATION
focal_class.declarator: MAPPER = new ObjectMapper()
focal_class.modifier: private static final
focal_class.original_string: private static final ObjectMapper MAPPER = new ObjectMapper();
focal_class.type: ObjectMapper
focal_class.var_name: MAPPER
focal_class.declarator: jfactory = new JsonFactory()
focal_class.modifier: private static final
focal_class.original_string: private static final JsonFactory jfactory = new JsonFactory();
focal_class.type: JsonFactory
focal_class.var_name: jfactory
focal_class.declarator: LOG = LoggerFactory.getLogger(FreebaseHelper.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(FreebaseHelper.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.file: core/src/main/java/edu/tuberlin/dima/textmining/jedi/core/freebase/FreebaseHelper.java
focal_class.identifier: FreebaseHelper
focal_class.class_method_signature: FreebaseHelper.getURL(String metaURL)
focal_class.full_signature: private JsonNode getURL(String metaURL)
focal_class.identifier: getURL
focal_class.modifiers: private
focal_class.parameters: (String metaURL)
focal_class.return: JsonNode
focal_class.signature: JsonNode getURL(String metaURL)
focal_class.class_method_signature: FreebaseHelper.transformOldToNewId(String old)
focal_class.full_signature: public static String transformOldToNewId(String old)
focal_class.identifier: transformOldToNewId
focal_class.modifiers: public static
focal_class.parameters: (String old)
focal_class.return: String
focal_class.signature: String transformOldToNewId(String old)
focal_class.class_method_signature: FreebaseHelper.transformNewToOldId(String newId)
focal_class.full_signature: public static String transformNewToOldId(String newId)
focal_class.identifier: transformNewToOldId
focal_class.modifiers: public static
focal_class.parameters: (String newId)
focal_class.return: String
focal_class.signature: String transformNewToOldId(String newId)
focal_class.class_method_signature: FreebaseHelper.getNameForID(String id)
focal_class.full_signature: public Entity getNameForID(String id)
focal_class.identifier: getNameForID
focal_class.modifiers: public
focal_class.parameters: (String id)
focal_class.return: Entity
focal_class.signature: Entity getNameForID(String id)
focal_class.class_method_signature: FreebaseHelper.getNameForIDs(String id)
focal_class.full_signature: public Entity getNameForIDs(String id)
focal_class.identifier: getNameForIDs
focal_class.modifiers: public
focal_class.parameters: (String id)
focal_class.return: Entity
focal_class.signature: Entity getNameForIDs(String id)
focal_class.class_method_signature: FreebaseHelper.checkIfCompoundRelationHolds(String id1, String id2, String[] relation)
focal_class.full_signature: public boolean checkIfCompoundRelationHolds(String id1, String id2, String[] relation)
focal_class.identifier: checkIfCompoundRelationHolds
focal_class.modifiers: public
focal_class.parameters: (String id1, String id2, String[] relation)
focal_class.return: boolean
focal_class.signature: boolean checkIfCompoundRelationHolds(String id1, String id2, String[] relation)
focal_class.class_method_signature: FreebaseHelper.getInverseRelation(String relation)
focal_class.full_signature: private String getInverseRelation(String relation)
focal_class.identifier: getInverseRelation
focal_class.modifiers: private
focal_class.parameters: (String relation)
focal_class.return: String
focal_class.signature: String getInverseRelation(String relation)
focal_class.class_method_signature: FreebaseHelper.getFreebaseTopicForID(String freebaseID)
focal_class.full_signature: private JsonNode getFreebaseTopicForID(String freebaseID)
focal_class.identifier: getFreebaseTopicForID
focal_class.modifiers: private
focal_class.parameters: (String freebaseID)
focal_class.return: JsonNode
focal_class.signature: JsonNode getFreebaseTopicForID(String freebaseID)
focal_class.class_method_signature: FreebaseHelper.getTypesForRelationFromFreebase(String r)
focal_class.full_signature: public FreebaseRelation getTypesForRelationFromFreebase(String r)
focal_class.identifier: getTypesForRelationFromFreebase
focal_class.modifiers: public
focal_class.parameters: (String r)
focal_class.return: FreebaseRelation
focal_class.signature: FreebaseRelation getTypesForRelationFromFreebase(String r)
focal_class.class_method_signature: FreebaseHelper.readAllInverseRelations()
focal_class.full_signature: public void readAllInverseRelations()
focal_class.identifier: readAllInverseRelations
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void readAllInverseRelations()
focal_class.class_method_signature: FreebaseHelper.main(String[] args)
focal_class.full_signature: public static void main(String[] args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String[] args)
focal_class.return: void
focal_class.signature: void main(String[] args)
focal_method.body: public Entity getNameForID(String id) throws IOException {
  		String trimmedID = id.replaceAll("\\.", "/");
  		if (!trimmedID.startsWith("/")) {
  			trimmedID = "/" + trimmedID;
  		}
  		String metaURL = FREEBASE_SEARCH_API.replace("{id}", trimmedID);
  
  		JsonNode jsonNode = getURL(metaURL);
  
  		LOG.trace(metaURL);
  
  		if (jsonNode.get("result").size() < 1) {
  			LOG.error("No results for mid {}", id);
  			return null;
  		}
  
  		JsonNode result = jsonNode.get("result").get(0);
  
  		String name = result.has("name") ? result.get("name").asText() : "";
  
  		Entity person = new Entity(id, name);
  
  		final JsonNode output = result.get("output");
  
  		if (output.has("type")) {
  			final JsonNode types = output.get("type").get("/type/object/type");
  			person.types = Lists.newArrayList(Iterables.transform(types, new Function<JsonNode, String>() {
  				@Nullable
  				@Override
  				public String apply(@Nullable JsonNode type) {
  					return type.get("id").asText();
  				}
  			}));
  		}
  
  		if (output.has("/common/topic/alias")) {
  			final JsonNode alias = output.get("/common/topic/alias").get("/common/topic/alias");
  			if (alias != null) {
  				person.alias = Lists.newArrayList(Iterables.transform(alias, new Function<JsonNode, String>() {
  					@Nullable
  					@Override
  					public String apply(@Nullable JsonNode alias) {
  						return alias.asText();
  					}
  				}));
  			}
  		}
  
  
  		return person;
  	}
focal_method.class_method_signature: FreebaseHelper.getNameForID(String id)
focal_method.full_signature: public Entity getNameForID(String id)
focal_method.identifier: getNameForID
focal_method.invocations: replaceAll startsWith replace getURL trace size get error get get has asText get get has get get newArrayList transform asText get has get get newArrayList transform asText
focal_method.modifiers: public
focal_method.parameters: (String id)
focal_method.return: Entity
focal_method.signature: Entity getNameForID(String id)