From 11eaf5b33b8fde4481f0e85493e7a9661ed77c96 Mon Sep 17 00:00:00 2001 From: Maximilian Blochberger Date: Thu, 11 Mar 2021 13:02:01 +0100 Subject: [PATCH] Add makefile and example --- .gitignore | 3 + Makefile | 29 +++++++++ README.md | 26 ++++++-- example.svg | 159 ++++++++++++++++++++++++++++++++++++++++++++++ fixtures/.gitkeep | 0 graphs/.gitkeep | 0 6 files changed, 211 insertions(+), 6 deletions(-) create mode 100644 Makefile create mode 100644 example.svg create mode 100644 fixtures/.gitkeep create mode 100644 graphs/.gitkeep diff --git a/.gitignore b/.gitignore index ec40429..5ec4696 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ dblp/*.dtd dblp/*.xml dblp/*.gz dblp/*.md5 +fixtures/*.json +graphs/*.dot +graphs/*.svg # Python __pycache__ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a7bcf7c --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +.PHONY: all clean +.SUFFIXES: .dot .pdf .svg .tex + +DB = db.sqlite3 +DOT = dot +DOTTOTEX = dot2tex +MANAGE = ./manage.py +TAGDAG = $(MANAGE) tagdag --threshold 1 + +all: graphs/citations.svg graphs/sok.svg + +clean: + rm -f graphs/*.dot + rm -f graphs/*.svg + +.dot.pdf: + $(DOT) -Tpdf -o$*.pdf $< + +.dot.svg: + $(DOT) -Tsvg -o$*.svg $< + +.dot.tex: + $(DOTTOTEX) -f tikz --usepdflatex $< > $@ + +graphs/citations.dot: $(DB) sok/management/commands/citations.py + $(MANAGE) citations --pk --min-citations 10 > $@ + +graphs/sok.dot: $(DB) sok/management/commands/tagdag.py + $(TAGDAG) > $@ diff --git a/README.md b/README.md index 5ea9d96..a160b52 100644 --- a/README.md +++ b/README.md @@ -82,19 +82,33 @@ Tags and citations can be exported in DOT format, which can be rendered using Gr ```sh # Render relevant publications that have more than ten citations -./manage.py citations --min-citations 10 > citations.dot && dot -Tsvg -ocitations.svg citations.dot +./manage.py citations --min-citations 10 > graphs/citations.dot && make graphs/citations.svg +# or +make graphs/citations.svg # Render tag DAG -./manage.py tagtag --root 'Literature on Systematic Mapping' --threshold 1 > sysmap.dot && dot -Tsvg -osysmap.svg sysmap.dot +./manage.py tagtag --root 'Literature on Systematic Mapping' --threshold 1 > graphs/sysmap.dot && make graphs/sysmap.svg # Render classification for a single publication -./manage.py tagtag 'DBLP:conf/ease/PetersenFMM08' > petersen08.dot && dot -Tsvg -opetersen08.svg petersen08.dot +./manage.py tagtag 'DBLP:conf/ease/PetersenFMM08' > graphs/petersen08.dot && make graphs/petersen08.svg # Render with TIKZ pip install dot2tex -dot2tex -f tikz --usepdflatex sysmap.dot > sysmap.tex +make graphs/citations.tex ``` +You can edit the `Makefile` so that you can generate all graphs quickly with: +```sh +make -j 4 +``` + +An example graph generated with: +```sh +./manage.py tagdag --root 'Methodology' 'DBLP:conf/ccs/EgeleBFK13' > example.dot && make example.svg +``` + +Example graph + If you want to get the BIB entry from DBLP: ```sh @@ -105,10 +119,10 @@ If you want to get the BIB entry from DBLP: ```sh # Export -./manage.py dumpdata --natural-primary --natural-foreign sok | jq --sort-keys > "$(date '+%Y-%m-%d')-sk.json" +./manage.py dumpdata --natural-primary --natural-foreign sok | jq --sort-keys > "fixtures/$(date '+%Y-%m-%d')-sk.json" # Import -./manage.py loaddata 2021-03-11-sok.json +./manage.py loaddata fixtures/2021-03-11-sok.json ``` ## Installation diff --git a/example.svg b/example.svg new file mode 100644 index 0000000..0d92417 --- /dev/null +++ b/example.svg @@ -0,0 +1,159 @@ + + + + + + +G + + + +T129 + +Methodology + + + +T102 + +Static Analysis + + + +T102->T129 + + + + + +T103 + +Static Analysis (Automatic) + + + +T103->T102 + + + + + +T98 + +CryptoLint + + + +T98->T103 + + + + + +T105 + +Gray Box (APKs without Native) + + + +T98->T105 + + + + + +T99 + +Developed CryptoLint + + + +T99->T98 + + + + + +T187 + +Artifacts + + + +T187->T129 + + + + + +T104 + +Gray Box + + + +T104->T187 + + + + + +T105->T104 + + + + + +T40 + +Evaluation + + + +T40->T129 + + + + + +T41 + +Data Set + + + +T41->T40 + + + + + +T96 + +Android Apps + + + +T96->T41 + + + + + +T97 + +Google Play Store + +145 095 applications + + + +T97->T96 + + + + + diff --git a/fixtures/.gitkeep b/fixtures/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/graphs/.gitkeep b/graphs/.gitkeep new file mode 100644 index 0000000..e69de29