Awesome
Transform docker images into knowledge graphs.
Installation
For using this repo we asume that you have installed:
Create a virtual environment and install from source:
pip install -r requirements.txt
CLI Usage
To create your knowledge graph from your Docker container you must run one of these commands. (add -s to the command to save the json files in the output_path)
To create the graph from a local image: ({name} can be Image ID or image tag)
py CLI.py image -i {name} -o {output_path}
To create the graph from a file with a list of local images (the file must have this format:
"mongo:latest
python:3.10
mysql:latest")
py CLI.py image -p {file_path} -o {output_path}
To create the graph from a DockerHub image:
py CLI.py dockerhub -i {name} -o {output_path}
To create the graph from a file with a list of DockerHub images (the file must have this format:
"mongo:latest
python:3.10
mysql:latest")
py CLI.py dockerhub -p {file_path} -o {output_path}
To create the graph from a DockerFile:
py CLI.py dockerhub -p {dockerhub_path} -o {output_path}
How it works
We inspect your image to get enviroment properties. Then we use syft to obtain the image dependencies. After that we have to transform a bit the output.
Once we have these data sources, we have to create a knowledge graph. For this purpose we will use morphkgc
Ontology Documentation
Available here: https://osoc-es.github.io/c2t/onto_documentation/index-en.html
Landing Page
Available here: https://osoc-es.github.io/c2t/website
Demo Page
Available here: https://c2t.linkeddata.es/
Assuming you have the sparql endpoint up, you can launch the demo with docker run -it -p 3000:3000 c2t_demo
. The Dockerfile for creating the image is under the web-demo
folder