Giter Site home page Giter Site logo

softwareunderstanding / somef-vider Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 5.85 MB

Web application for displaying the contents automatically retrieved from a code repository by applying the Software Metadata Extraction Framework (SOMEF)

License: Apache License 2.0

Python 8.62% JavaScript 5.33% HTML 2.50% Vue 81.78% Dockerfile 1.48% Shell 0.29%
demo software metadata codemeta scientific-software research-software open-science rdf knowledge-graphs

somef-vider's Introduction

SOMEF Vider

Web application for SOMEF

Description

SOMEF Vider is a web application based on Vue.js and Flask to visualize the metadata retrieved from the SOMEF API.

Demo

We have a running demo in https://somef.linkeddata.es. If the demo is down, please let us know by opening an issue.

Development Installation

In the development installation client and service are independent. They are mounted and executed separately from each other.

Dependencies

  • npm 6.14.8
  • Python 3.9

Installation

Clone this repository

$ git clone https://github.com/SoftwareUnderstanding/SOMEF-Vider.git      

Client

Before installation, configure the target server in client/src/service/axiosService by changing the variable LOCAL_URL. For local tests, use 127.0.0.1:5000 (assuming the application is deployed in that port).

Install dependencies for client

$ cd SOMEF-Vider/client/
$ npm install

Run client

$ npm run serve

Service

Install dependencies for server

cd SOMEF-Vider/server/
python3.9 -m venv virtualenv/
source virtualenv/bin/activate 
python -m pip install -r requirements.txt --no-dependencies
python -m nltk.downloader all

Run service. Ports can be configures in app.py

python app.py

Production installation

It follows roughly the same process as the development installation but, in this case, the client is compiled and integrated into the flask service.

Go to the client folder and install the dependencies if they are not installed.

$ cd SOMEF-Vider/client/
$ npm install

Now instead of running the client, execute the following command to build it:

$ npm run build

This will generate a new folder in the current directory called "dist" with all the client files compiled. To integrate this files in the service, just move the folder "dist" to the service folder and rename it to "static".

$ mv dist ../server/static

This last 2 mandates are (for now) the only difference between development and production. To run the tool follow the steps listed above at the "Service" section.

To generate the bundle with Docker, see the client deployment instructions.

Docker bundle

If you want an image of the whole application, you can generate a Docker image as follows:

First configure the GitHub token in the /server/installer.sh setting the property token to the desired GitHub token. (ensure that this file is marked as executable)

Then run the Docker command in the root directory

docker build -t somef-vider .

And run the container

docker run -p 5000:5000 somef-vider

Now you will have the complete application running on the port 5000

Authors

  • @Vitoriox: design and implementation
  • @dgarijo: supervision, testing and deployment

Contributing

If you find problems or if you wish to add new features, please let us know by opening an issue or submitting a pull request.

somef-vider's People

Contributors

dgarijo avatar vitoriox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

somef-vider's Issues

Code documentation

If someone else is to use this project, it should be documented enough to support it.

Dynamic color change in confidence chip

Currently, the values for the confidence chip to change color are fixed.

Color change could be dynamic depending on the threshold value given by the user

Codemeta representation has mixed keys

I just downloaded a codemeta representation for a project; and it mixes both the regular JSON keys with codemeta keys.

This is wrong: codemeta should only return codemeta values.

Small html improvements

Two small things:

  • The button for searching the repo does not have the same height as the threshold/repo panels.
  • There should be a small separation (maybe an horizontal line) between the title of the repo and the rest

Add .gitignore file

Gitignore contains all the extensions of the files to ignore, such as .idea

Writable example URL

Give the user the capability to use the example URL without copying it from the source.

Realocate confidence and extraction method chips

In the fields with more than one result, remove the confidence chip from the header and put one in each result, alongside the extraction method used.

Maintain the extraction method chips in the header but, specify in each result, which one is used.

Server deployment is not correct

The server should be run with the following:
python app.py. That way you can control the ports where the app is deployed.

If I run it that way, I get a CORS error. This should be addressed.

How to change ports?

What if I want to deploy the server in a different port? This is not specified.

Filters do not work

I tried to test the filters by clicking on the right part of the logo here:
Screenshot from 2021-12-15 11-36-11
but the requests to the server don't change and the content does not change, even after clicking "apply"

Show warning for repos

While waiting, I would like to show a message:
"We are analyzing your repository. Time may vary depending on its size. Please be patient"

Transition to FAST API?

Flask is not a proper server for deployment. Maybe we should consider creating a fast api server. This should have low priority.

Cannot run client in Node 17

Hello,
I have run into an issue when running the client. See stacktrace below:

dgarijo@pop-os:~/Documents/GitHub/SOMEF-Vider/client$ sudo npm run serve

> [email protected] serve /home/dgarijo/Documents/GitHub/SOMEF-Vider/client
> vue-cli-service serve

 INFO  Starting development server...
10% building 2/5 modules 3 active ...ents/GitHub/SOMEF-Vider/client/src/main.jsError: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-12-14T16_35_15_008Z-debug.log

The log shows:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'serve' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preserve', 'serve', 'postserve' ]
5 info lifecycle [email protected]~preserve: [email protected]
6 info lifecycle [email protected]~serve: [email protected]
7 verbose lifecycle [email protected]~serve: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~serve: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/dgarijo/Documents/GitHub/SOMEF-Vider/client/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
9 verbose lifecycle [email protected]~serve: CWD: /home/dgarijo/Documents/GitHub/SOMEF-Vider/client
10 silly lifecycle [email protected]~serve: Args: [ '-c', 'vue-cli-service serve' ]
11 silly lifecycle [email protected]~serve: Returned: code: 1  signal: null
12 info lifecycle [email protected]~serve: Failed to exec serve script
13 verbose stack Error: [email protected] serve: `vue-cli-service serve`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (node:events:390:28)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (node:events:390:28)
13 verbose stack     at maybeClose (node:internal/child_process:1062:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/dgarijo/Documents/GitHub/SOMEF-Vider/client
16 verbose Linux 5.15.5-76051505-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "serve"
18 verbose node v17.2.0
19 verbose npm  v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] serve: `vue-cli-service serve`
22 error Exit status 1
23 error 22 error Exit status 1
23 error Failed at the [email protected] serve script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Failed at the [email protected] serve script.

NPM version: 6.14.8
Commands run: npm install, npm run serve

NPM run build gives the same error

New version of SOMEF

The project uses an old version of somef.

The GitHub data is not showing correctly. Docker files neither. :(

Use a faster example

SOMEF is nice because it has docker images, notebooks, etc.

However, it takes around 10 sec. to show the results. We should either have a cache with this repo already analyzed; or have a faster example (i.e., a smaller repo)

Autocomplete information

You can autocomplete by pressing tab. But you have to know this.

We should indicate on the lower part of the box that if you press tab you can complete with an example

If there is a logo, display it

In SOMEF I plan to add a small extension to capture the logo of the repo
Please add a small space in case the logo is detected.

Improve how citations appear

For example, we see:

Garijo, D. (2017). WIDOCO: a wizard for documenting ontologies. International Semantic Web Conference, 94โ€“102. https://doi.org/10.1007/978-3-319-68204-4_9

@inproceedings{garijo2017widoco, title={WIDOCO: a wizard for documenting ontologies}, author={Garijo, Daniel}, booktitle={International Semantic Web Conference}, pages={94--102}, year={2017}, organization={Springer, Cham}, doi = {10.1007/978-3-319-68204-4_9}, funding = {USNSF ICER-1541029, NIH 1R01GM117097-01}, url={http://dgarijo.com/papers/widoco-iswc2017.pdf} }

Instead, I would like to see the bibtex properly formatted as a text block. The citation would be great as something that could be copied/pasted in the model card.

Proper errors due to rate limitation

Since the server is public, we can suffer rate limitation problems, specifically if somef is not properly configured.

If such thing happens, Vider should show an error such as "We have hit a GitHub API rate limitation. Please try in a few minutes" warning message.

Default values

I have to write the values for threshold and repo every time. There should be an option to include them by default (especially the threshold)

What does this do?

I have no idea about what the middle button here does:
Screenshot from 2021-12-15 11-36-11
I don't see any impact in the application

Bug with repository

I get an error with https://github.com/hezhangsprinter/DCPDN,

but I can run it with SOMEF with no issue. What is the problem?

Change page title

Right now the page title shows "client".
It should be "SOMEF Vider"

Docker, notebooks in header

Add an indication at the header that shows if the repository has docker and/or notebooks.
Include link to both files.

Add a cache for files

Since we have API limitation restrictions, it would be great to have a small cache with the JSON files generated, as well as the date.
That way we could have the option to load files from the cache without loading the repo again.

This is a "nice to have" feature.

Github metadata does not show correctly anymore

I don't understand why, but when I tested this today I get the overview of the repo empty.
Looks like a bug. The server does not show any errors
Screenshot from 2022-03-25 18-55-18

Inspecting the error, I see:

TypeError: t.confidence is undefined
    buildPanelItem MetadataCard.vue:409
    generateTabs MetadataCard.vue:327
    created MetadataCard.vue:470
    VueJS 18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.