<commit_before># sparql-to-graphviz

When you find unknown data in a SPARQL endpoint, do you also go:

```sparql
SELECT DISTINCT ?class
WHERE {
  [] a ?class .
}
```

Or:

```sparql
SELECT DISTINCT ?property
WHERE {
  [] ?property [] .
}
```

Yeah, me too.

This tools helps you to explore an unfamiliar dataset in a SPARQL endpoint, optionally restricted to a named graph. It produces a class diagram in the [DOT language](http://www.graphviz.org/doc/info/lang.html), which can be turned into images by [Graphviz](http://www.graphviz.org). The class diagram shows an *empirical schema* of the explored dataset. The schema reflects the structure of instance data in terms of its vocabularies. 

If you want a more feature-rich and interactive visualization, give [LODSight](http://lod2-dev.vse.cz/lodsight-v2) a try.

Warning: The tool can also hurt your feelings by showing what a mess your data is. 

## Usage

Compile using [Leiningen](http://leiningen.org): 

```sh
git clone https://github.com/jindrichmynarz/sparql-to-graphviz.git
cd sparql-to-graphviz
lein bin
```

Observe the offered parameters:

```sh
target/sparql_to_graphviz --help
```

Find out what is hiding in your local RDF store:

```sh
target/sparql_to_graphviz -e http://localhost:8890/sparql |
  neato -Tsvg -Gepsilon=.001 -o localhost.svg
```

Give it some time, while it runs a boatload of SPARQL queries. When it finishes, `localhost.svg` should contain something beautiful. Exporting to SVG also allows you to make the visualization fancier using vector graphics tools.

For example, the resulting mess can look like this:

[[https://github.com/jindrichmynarz/sparql-to-graphviz/blob/master/resources/vvz.png|alt="Example diagram"]]

## Caveats

* Classes identifier with blank nodes are ignored.

## License

Copyright © 2017 <NAME>

Distributed under the Eclipse Public License version 1.0.
<commit_msg>We're not on a wiki<commit_after># sparql-to-graphviz

When you find unknown data in a SPARQL endpoint, do you also go:

```sparql
SELECT DISTINCT ?class
WHERE {
  [] a ?class .
}
```

Or:

```sparql
SELECT DISTINCT ?property
WHERE {
  [] ?property [] .
}
```

Yeah, me too.

This tools helps you to explore an unfamiliar dataset in a SPARQL endpoint, optionally restricted to a named graph. It produces a class diagram in the [DOT language](http://www.graphviz.org/doc/info/lang.html), which can be turned into images by [Graphviz](http://www.graphviz.org). The class diagram shows an *empirical schema* of the explored dataset. The schema reflects the structure of instance data in terms of its vocabularies. 

If you want a more feature-rich and interactive visualization, give [LODSight](http://lod2-dev.vse.cz/lodsight-v2) a try.

Warning: The tool can also hurt your feelings by showing what a mess your data is. 

## Usage

Compile using [Leiningen](http://leiningen.org): 

```sh
git clone https://github.com/jindrichmynarz/sparql-to-graphviz.git
cd sparql-to-graphviz
lein bin
```

Observe the offered parameters:

```sh
target/sparql_to_graphviz --help
```

Find out what is hiding in your local RDF store:

```sh
target/sparql_to_graphviz -e http://localhost:8890/sparql |
  neato -Tsvg -Gepsilon=.001 -o localhost.svg
```

Give it some time, while it runs a boatload of SPARQL queries. When it finishes, `localhost.svg` should contain something beautiful. Exporting to SVG also allows you to make the visualization fancier using vector graphics tools.

For example, the resulting mess can look like this:

![Example diagram](https://github.com/jindrichmynarz/sparql-to-graphviz/blob/master/resources/vvz.png)

## Caveats

* Classes identifier with blank nodes are ignored.

## License

Copyright © 2017 <NAME>

Distributed under the Eclipse Public License version 1.0.

{'fraction_non_alphanumeric': 0.09888357256778309, 'fraction_numerical': 0.007974481658692184, 'mean_word_length': 4.2925457102672295, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4636218', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1172, 'n_words': 456}