Skip to content
This repository has been archived by the owner on Dec 24, 2019. It is now read-only.

Help to achieve my scenario #386

Closed
phkrief opened this issue Sep 29, 2019 · 16 comments
Closed

Help to achieve my scenario #386

phkrief opened this issue Sep 29, 2019 · 16 comments
Assignees
Milestone

Comments

@phkrief
Copy link

phkrief commented Sep 29, 2019

Dear All,
Here is the scenario I would like to achieve with the help of the Scava plugin.
In my understanding, it should comply with our initial requirements.

So, please tell me how we could fix that to be able to run this scenario:

Professor request

Extract the current weather for a given city from the OpenWeather (https://openweathermap.org) open data site.
The data provided are in a JSON format. For example, for "Paris, FR"
http://api.openweathermap.org/data/2.5/weather?q=Paris&appid=abbcea2020f75409af198b98de40e3a6

Look for a JSON library

  • Look for using CROSSMINER > Project search
  • ==> Find JSONSparcerParser (For now this project is not listed, I created a bug report to add it to the KB)
  • Install it on the machine
  • Install it in the list of GIT Repos in Eclipse
  • Import it as an Eclipse project

Look for JSON recommendation

  • Create an Eclipse Java project
  • Add the downloaded project into the classpath
  • Create a Class with its main method
  • In the main method, define how to obtain the URL form the city name
  • Extract the file content as a String from the URL
  • Obtain an API recommendation using JSONUtils.
    • Doesn't work for now. I suppose it comes from the fact that this repo is not in the KB for now
    • How can we know how to extra a JSON structure from a file ?
    • We should be able to get the fact that we can cast the parsed json object to
      Hashtable<String, Object>
  • Cast the result of the returned object to Hashtable<String, Object>
  • Finalize the code by extracting the information form the "main" index in the hashtable

Here is how the code looks like after this first scenario:

  • See the attached file AppWithGNU.java

#==============================

Migrate from a GNU license to license accepted by the EPL license, e.g. Apache

Understand the new APIs

  • Find the new way to parse a JSON file
    • Obtain an API recommendation using JSONParser.
      • Doesn't work ! What should I do to get this kind of inputs
  • Fix the code with the new APIs

Here is how the code looks like after this second scenario:

  • See the attached file AppWithApache.java

Thx a lot for your help

AppWithApache.java.txt
AppWithGNU.java.txt

@creat89
Copy link
Contributor

creat89 commented Sep 29, 2019

Hello @phkrief,

For the API recommendation and maybe the understanding of a new API, I should say that apart from the recommenders created by UDA, there is one created by EHU that it's called CROSSIndex. This one should have an interface through the Knowledge Base too. CROSSIndex, rather than be connected to the Knowledge base, it is connected to the ElasticSearch Indexes. If you selected, during the analysis of projects in Scava, the indexing of data, CROSSIndex should be capable of providing you recommendations. These will depend on the data analyzed, but it can be data from documentation, BTS issues, mailing lists, forums. StackOverflow is possible, but for the moment, we would need to provide you the index according to your needs (But in the future, this might be visible from the UI). We've been chatting with Thomas and Kostantinos for indexing code and configuration files, too.

CROSSIndex can support Java, C, PHP and Javascript.

@phkrief
Copy link
Author

phkrief commented Sep 29, 2019

Dear @creat89, Sorry but I don't understand your reply.
The described scenario is using the Scva Plugin IDE. So, I have no access to any API but the user interface provided by the plugin.
Do I miss something?
Thx

@creat89
Copy link
Contributor

creat89 commented Sep 29, 2019

I thought that as any other recommender located in the Knowledge base, would be accessible through the Scava plug-in too.

@davidediruscio
Copy link
Contributor

davidediruscio commented Sep 29, 2019 via email

@creat89
Copy link
Contributor

creat89 commented Sep 29, 2019

The indexes are available through Kibiter. But I'm talking about the recommender created on the indexed data.

@davidediruscio
Copy link
Contributor

@creat89 yes thanks, I remember the branch you developed end of July about that and subsequently merged by @md2manoppello

The recommendations we are able to provide are those described in D6.5.

@phkrief maybe I'm missing something, what do you mean with "....how we could fix that..." at the beginning of this issue description? What are the things that need to be fixed?

@phkrief
Copy link
Author

phkrief commented Sep 29, 2019

@davidediruscio by "fixing" in mean: what should I/we do t make this reasonable scenario doable.
I don't know how we could "influence" the KB to obtain "useful" recommendations.
Actually, for example, I installed one of the repo listed by the plugin (json-simple). This repo provides a Json parser with some APIs. I could not find the way to setup my code to get a useful recommendation.
Does it make sense ?
Davide, who should be my contact to interact with and try to solve my issue? Juri? Adrian?

@geryxyz
Copy link
Contributor

geryxyz commented Sep 30, 2019

Hi all,
@phkrief I checked your scenario. In short:

  • The plug-in does not make any filtering on the results coming from the server, just displays these. So if the answers you are looking for are present in the KB then it should be visible in the search results.
  • The plug-in does not display any license data of the libraries since it is not provided by the server (as far we know).
  • We currently working on some issues and refactoring on the Q&A and documentation retrieval function. @gertom could give you a developer version on the meeting or you could wait until we upload it to the central repository. Note that these are not show stoping issues just minor fixes, so the feature should be usable fairly (some broken links, etc.) as it is right now.

@creat89
Copy link
Contributor

creat89 commented Sep 30, 2019

As far as I understand, the problem that Philippe is facing, is that the KB does not contain any information regarding the Json parser indicated at the beginning of the thread, as he has indicated in issue #384. This makes impossible to retrieve recommendations useful for solving one of his user cases. In other words, the recommendations retrieved are not related to the library Philippe is using. Ideally, as he has pointed in issue #382, the recommender from the KB should use the data that has been processed by Scava. Due to this point, I had recommended to use CROSSIndex, because it provides recommendations from the data indexed and processed by Scava. However, it seems to be missing in the Eclipse plugin.

In all the cases, Philippe is looking for a way to solve these issues and being able to fulfill his user case.

Am I correct Philippe?

@phkrief
Copy link
Author

phkrief commented Sep 30, 2019

Hi @creat89 ,
Your are partially right. I do agree with you that one of the 2 parsers in not included in the KB but the second is included (json-simple). So I would not mind demonstrating the recommendation on the second one only but, unfortunately I get nothing for now.
So I was wondering if I was selecting the wrong text to get some useful help form the KB.
I will be happy to go with you through the scenario and see how we can solve that.
Thanks

@phkrief
Copy link
Author

phkrief commented Sep 30, 2019

@md2manoppello , @creat89, Would it be difficult to add the license information in the KB?
IMHO, this is an important information and, for now, if I want to check this information, I will have to switch to github, browse the license file and comeback to the search dialog in Eclipse.
Now, if you cannot make it, I will just mention the workaround and ask for an enhancement in our deliverable.
Thanks

@creat89
Copy link
Contributor

creat89 commented Sep 30, 2019

In EHU case, CROSSIndex only retrieves posts from the indexes that contain information that might help you to develop the code that you're writting. It doesn't provide projects similar to those that you're using. Those recommenders are created by UDA.

@geryxyz
Copy link
Contributor

geryxyz commented Sep 30, 2019

@creat89 what do you meant by missing on the plug-in site? Does CROSSindex use a different API method? If so which one? If it use the same API as any previous request and only add more result entries to the result then it will working as the previous ones.

@creat89
Copy link
Contributor

creat89 commented Sep 30, 2019

@geryxyz I have replied to you in issue #387

@phkrief
Copy link
Author

phkrief commented Sep 30, 2019

I try to understand how the KB is created. Based on my understanding none of the projects listed in the dashboard are listed in the KB and vise versa.
Is it expected ? Personally, I was expecting to have the same projects on both UI. Like that I could either have a short description in the Eclipse IDE or make a deep dive in metrics with the dashboard.
Did I miss understand something in the architecture ?

FYI @borisbaldassari

@phkrief
Copy link
Author

phkrief commented Nov 18, 2019

Thanks a lot for your help @md2manoppello

@phkrief phkrief closed this as completed Nov 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants