lambdamusic / Ontospy

Python library and command-line interface for inspecting and visualizing RDF models aka ontologies.
http://lambdamusic.github.io/Ontospy/
MIT License
218 stars 52 forks source link

use an option for output format, rather than keyboard input #59

Closed VladimirAlexiev closed 5 years ago

VladimirAlexiev commented 6 years ago
$ ontodocs -o ontology --theme readable model/ebg-ontology.ttl
OntoDocs v1.2 (OntoSpy v1.9)
------------
Please choose an output format for the ontology visualization: (q=quit)

1) Html: single-page
2) Html: multi-page
3) Markdown: multi-page
4) D3 Dendogram

It's much better to control the output through a command-line option, rather than keyboard input. Guess I could do this, but it's a round-about way.

echo 2 | ontodocs -o ontology --theme readable model/ebg-ontology.ttl
VladimirAlexiev commented 6 years ago

Note to self:

2) is similar to http://www.michelepasin.org/support/ontospy-examples/index.html

4) is interesting but it doesn't show a lot of the information. Shot is below image

lambdamusic commented 5 years ago

I've added a --type option in the latest ontospy (version 1.9.8)

ontospy gendocs
Ontospy v1.9.8
Usage: ontospy gendocs [OPTIONS] [SOURCE]...

  GENDOCS: generate documentation in html or markdown format.

Options:
  -o, --outputpath TEXT  OUTPUT-PATH: where to save the visualization files
                         (default: home folder).
  -x, --extra            EXTRA-DATA: extract implicit types and predicates
                         using basic inference rules. Note: by default ontospy
                         extracts only classes/properties which are explictly
                         declared.
  --type TEXT            VIZ-TYPE: specify which viz type to use as an integer
                         (eg 1=single-page html, 2=multi-page etc..).
  --title TEXT           TITLE: custom title for the visualization
                         (default=graph uri).
  --theme TEXT           THEME: bootstrap css style for the html-multi-page
                         visualization (random=use a random theme).
  --lib                  LIBRARY: choose an ontology from the local library.
  --showtypes            SHOW-TYPES: show the available visualization types.
  --showthemes           SHOW-THEMES: show the available css theme choices.
  -h, --help             Show this message and exit.

That shoud do it!