@@ -213,7 +213,7 @@ public ConceptInsights() {
213213 * @return {@link Annotations}
214214 */
215215 public Annotations annotateText (final Graph graph , final String text ) {
216- final String graphId = IDHelper .getGraphId (graph , getAccountId ());
216+ final String graphId = IDHelper .getGraphId (graph , getFirstAccountId ());
217217 Validate .notEmpty (text , "text cannot be empty" );
218218
219219 final Request request =
@@ -243,7 +243,7 @@ public Annotations annotateText(final Graph graph, final String text) {
243243 */
244244 public QueryConcepts conceptualSearch (Corpus corpus , Map <String , Object > parameters ) {
245245 Validate .notNull (parameters .get (IDS ), "ids cannot be null" );
246- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
246+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
247247
248248 final Map <String , Object > queryParams = new HashMap <String , Object >();
249249 final String [] queryParameters = new String [] {CURSOR , LIMIT };
@@ -283,7 +283,7 @@ public QueryConcepts conceptualSearch(Corpus corpus, Map<String, Object> paramet
283283 * @param corpus Corpus the corpus object.
284284 */
285285 public void createCorpus (final Corpus corpus ) {
286- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
286+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
287287 final Request request =
288288 RequestBuilder
289289 .put (API_VERSION + corpusId )
@@ -314,7 +314,7 @@ public void createDocument(final Document document) {
314314 * @param corpus Corpus the corpus object.
315315 */
316316 public void deleteCorpus (final Corpus corpus ) {
317- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
317+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
318318 final Request request = RequestBuilder .delete (API_VERSION + corpusId ).build ();
319319 executeWithoutResponse (request );
320320 }
@@ -352,11 +352,11 @@ private <T extends GenericModel> T executeRequest(final String resourcePath,
352352 }
353353
354354 /**
355- * Gets the account id.
355+ * Returns the first account id.
356356 *
357357 * @return the account id
358358 */
359- private String getAccountId () {
359+ public String getFirstAccountId () {
360360 if (accountId == null ) {
361361 final Accounts accounts = getAccountsInfo ();
362362 if (accounts != null && accounts .getAccounts () != null && !accounts .getAccounts ().isEmpty ()) {
@@ -426,7 +426,7 @@ public Concepts getConceptRelatedConcepts(final Concept concept,
426426 * @return the Corpus
427427 */
428428 public Corpus getCorpus (final Corpus corpus ) {
429- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
429+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
430430 return executeRequest (API_VERSION + corpusId , null , Corpus .class );
431431 }
432432
@@ -437,7 +437,7 @@ public Corpus getCorpus(final Corpus corpus) {
437437 * @return {@link CorpusProcessingState} The processing state of a given corpus.
438438 */
439439 public CorpusProcessingState getCorpusProcessingState (final Corpus corpus ) {
440- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
440+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
441441 return executeRequest (API_VERSION + corpusId + PROCESSING_STATE_PATH , null ,
442442 CorpusProcessingState .class );
443443 }
@@ -457,7 +457,7 @@ public CorpusProcessingState getCorpusProcessingState(final Corpus corpus) {
457457 * @return {@link Concepts}
458458 */
459459 public Concepts getCorpusRelatedConcepts (final Corpus corpus , final Map <String , Object > parameters ) {
460- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
460+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
461461
462462 final Map <String , Object > queryParameters = new HashMap <String , Object >();
463463 final String [] params = new String [] {LEVEL , LIMIT };
@@ -483,7 +483,7 @@ public Concepts getCorpusRelatedConcepts(final Corpus corpus, final Map<String,
483483 * @return {@link Scores}
484484 */
485485 public Scores getCorpusRelationScores (final Corpus corpus , final List <Concept > concepts ) {
486- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
486+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
487487 Validate .notEmpty (concepts , "concepts cannot be empty" );
488488
489489 final Map <String , Object > queryParameters = new HashMap <String , Object >();
@@ -505,7 +505,7 @@ public Scores getCorpusRelationScores(final Corpus corpus, final List<Concept> c
505505 * @return the {@link CorpusStats}
506506 */
507507 public CorpusStats getCorpusStats (final Corpus corpus ) {
508- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
508+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
509509 return executeRequest (API_VERSION + corpusId + STATS_PATH , null , CorpusStats .class );
510510 }
511511
@@ -618,7 +618,7 @@ public Scores getDocumentRelationScores(final Document document, final List<Conc
618618 */
619619 public Concepts getGraphRelatedConcepts (final Graph graph , final List <Concept > concepts ,
620620 final Map <String , Object > parameters ) {
621- final String graphId = IDHelper .getGraphId (graph , getAccountId ());
621+ final String graphId = IDHelper .getGraphId (graph , getFirstAccountId ());
622622 Validate .notEmpty (concepts , "concepts cannot be empty" );
623623
624624 final Map <String , Object > queryParameters = new HashMap <String , Object >();
@@ -721,7 +721,7 @@ public Corpora listCorpora(final String accountId) {
721721 * @return {@link Documents}
722722 */
723723 public Documents listDocuments (final Corpus corpus , final Map <String , Object > parameters ) {
724- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
724+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
725725
726726 final Map <String , Object > queryParameters = new HashMap <String , Object >();
727727 final String [] queryParams = new String [] {CURSOR , LIMIT };
@@ -766,7 +766,7 @@ public Graphs listGraphs() {
766766 * @return {@link Matches}
767767 */
768768 public Matches searchCorpusByLabel (final Corpus corpus , final Map <String , Object > parameters ) {
769- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
769+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
770770 Validate .notEmpty ((String ) parameters .get (QUERY ), "query cannot be empty" );
771771
772772 final Map <String , Object > queryParameters = new HashMap <String , Object >();
@@ -809,7 +809,7 @@ public Matches searchCorpusByLabel(final Corpus corpus, final Map<String, Object
809809 * @return {@link Matches}
810810 */
811811 public Matches searchGraphsConceptByLabel (final Graph graph , final Map <String , Object > parameters ) {
812- final String graphId = IDHelper .getGraphId (graph , getAccountId ());
812+ final String graphId = IDHelper .getGraphId (graph , getFirstAccountId ());
813813 Validate .notEmpty ((String ) parameters .get (QUERY ), "query cannot be empty" );
814814
815815 final Map <String , Object > queryParameters = new HashMap <String , Object >();
@@ -833,7 +833,7 @@ public Matches searchGraphsConceptByLabel(final Graph graph, final Map<String, O
833833 * @param corpus {@link Corpus} the corpus to update.
834834 */
835835 public void updateCorpus (final Corpus corpus ) {
836- final String corpusId = IDHelper .getCorpusId (corpus , getAccountId ());
836+ final String corpusId = IDHelper .getCorpusId (corpus , getFirstAccountId ());
837837 final Request request =
838838 RequestBuilder
839839 .post (API_VERSION + corpusId )
0 commit comments