The W3 has a RDF validator that plots the RDF graph. Do you know a similar utility desktop side ?
Forgot to say. I'm on a mac.
For example, raptor has the rapper command line utility that can parse various RDF syntaxes and output DOT to be plotted with GraphViz.
(Disclosure: I'm a committer in the raptor project.)
Like laalto said GraphViz is the typical thing to use and many RDF APIs have support built in for generating DOT to be plotted with ut
For example the API I develop (dotNetRDF) has a GraphVizWriter class that you can use to generate DOT files which you can then turn into images in your desired format with the dot.exe command line utility which is part of GraphViz
Though seeing as you're on a Mac my API is probably not much use to you personally - but regardless GraphViz is definitely the way to go.
+1 for using Raptor and Graphviz. Here's how to do it one go (assuming that your RDF is in Turtle syntax):
rapper -i turtle -o dot rdf.ttl | dot -Tpdf -ograph.pdf
The output is written to graph.pdf.
Related
I think this filter could be very helpful to my graphs, since I often have A LOT of nodes, with bundles of edges often going in the same direction.
Unfortunately, apart from the announcement at http://www.graphviz.org/News.php mentioning that:
This release includes a new (1.5) version of the xdot format
supporting inline text characteristics such as and
version-specific output based on xdotversion. In addition, we
introduce mingle, a filter for edge bundling.
I didnt find anything else by googling - any hint about it?
Also, I see that it is an option for xdot - I only used fdp/sfdp/neato so far, to get as output a jpg image: how should procede starting from the graphviz-file if I want to use xdot and arrive to a jpg?
So I found this link:
http://www.graphviz.org/content/how-use-mingle-and-edgepaint
That suggests piping:
fdp input.gv | mingle | neato -Tpdf -o output.pdf
or
dot input.dot | mingle | neato -Tpng -o out.png
However, I have not gotten this working on both windows and unix, as mingle apparently keeps (even for dummy graphs).
I'm new at this an essentially have very little idea of what I'm doing.
(FYI I'm working off of this tutorial:
http://bost.ocks.org/mike/map/)
I'm trying to get topojson to work.
I've successfully installed homebrew and node.
I've done the
"npm install -g topojson" part as well.
And then, after that, when I try to type in the "which ogr2ogr" etc -- just, nothing happens.
He says if having trouble to edit path variable environments. I have only a vague idea of what that means, and not sure if that's my problem or not.
Let me know what other information you need. I really just want to make a map. The global install does seem to have worked. I just don't know what to do from here.
The tutorial you linked to is a great starting point. I wish I'd seen it before trying to figure everything out on my own. :)
From what I understand, you probably missed the step in which you install gdal. If you're seeing some other errors, please post them in your question.
You can get ogr2ogr working by running:
brew install gdal
Here's some background info for you, so you'll get a better understanding of what's going on there.
topojson and ogr2ogr are two distinct utilities. ogr2ogr is part of the gdal package and in our case is used to generate GeoJSON from a shapefile.
GDAL is a translator library for raster geospatial data formats that
is released under an X/MIT style Open Source license by the Open
Source Geospatial Foundation. As a library, it presents a single
abstract data model to the calling application for all supported
formats. It also comes with a variety of useful commandline utilities
for data translation and processing.
TopoJSON is used to compress the rather large GeoJSON output from the previous GDAL conversion. It reduces redundancy by specifying paths with arcs rather than discrete points. It's pretty neat, actually:
TopoJSON is an extension of GeoJSON that encodes topology. Rather than
representing geometries discretely, geometries in TopoJSON files are
stitched together from shared line segments called arcs. TopoJSON
eliminates redundancy, offering much more compact representations of
geometry than with GeoJSON; typical TopoJSON files are 80% smaller
than their GeoJSON equivalents. In addition, TopoJSON facilitates
applications that use topology, such as topology-preserving shape
simplification, automatic map coloring, and cartograms.
The output of these two steps (shapefile -> GeoJSON -> TopoJSON) will be a JSON string which is easily interpreted by JavaScript. You'll need to use topojson in your drawing code to convert back to GeoJSON for actually drawing the map.
Recall from earlier the two closely-related JSON geographic data
formats: GeoJSON and TopoJSON. While our data can be stored more
efficiently in TopoJSON, we must convert back to GeoJSON for display.
Breaking this step out to make it explicit:
var subunits = topojson.object(uk, uk.objects.subunits);
For ubuntu, I used this way to have ogr2ogr
sudo apt-get install gdal-bin
I have tabular data with the following fields constituting a record:
SourceID
SourceLabel
SourceGroupID
TargetID
TargetLabel
TargetGroupID
I would like to convert this data to graphviz DOT format either programmatically or as part of a script. In particular, I would like to cluster nodes according to their GroupID.
This seems like it would be a common task--are there existing tools / code (preferably Python or R) examples that do this?
It sounds like the NetworkX library for Python might do what you want. What you need to do is read in an edge list (see networkx.readwrite.edgelist), process it to create the groups or anything else you need, and write out the Graphvis dot file (see networkx.drawing.nx_pydot.write_dot).
NetworkX can do other graph visualizations on its own without Graphvis (gallery, docs), and can export many other formats including GraphML. There are tons of open source tools to visualize graphs that can import GraphML, like
NodeXL, a great introductory tool that integrates network analysis into Excel 2007/2010 (Disclaimer: I'm an advisor for it). Other awesome tools include Gephi and Cytoscape, while Pajek and UCINet are some proprietary alternatives.
I'm looking for either algorithms or visualization tool for (nice) circuit/block-diagram drawing.
I am also interested in a general formulation of the problem.
By "circuit drawing", I mean the capability of exploring place & route for block-diagrams (rectangles) with I/O ports and their connections (wires). These block-diagrams can be hierarchical i.e some blocks may have some nested internal sub-structure etc.
This topic is strongly related to classical graph-drawing, with the supplemental constraint of the need to take ports location into account, and possibly the shape of the blocks (rectangle of various sizes). Graphviz tools do not respond to the problem (at least my previous experiments have not been satisfactory).
Force-directed algorithms retain my attention, but I have just found papers on classical directed graphs.
Any hints ?
[update nov 21 2013] it seems that the best reference to date is Spönemann
To make production quality circuit diagrams as well as block diagrams, I strongly recommend J. D. Aplevich's "circuit macros". It's well documented and actively maintained. See the examples produced by this package circuit macros examples
There is some learning curve, for example to be able to use the "dpic" graphing language to draw your own diagram. But the tool itself is very powerful.
For me there are two remaining issues:
no live update
svg output is lacking
I hacked up some Javascript to
(watch m4 file change)->[m4->dpic->latex->pdf]->svg->(show in html)
Here is the gist of it
// watch .m4 file
var chokidar = require('chokidar');
var resolve = require('path').resolve;
const touch = require('touch')
const {exec} = require('child_process')
chokidar.watch("*.m4").on('change', fn=>{
let ff = resolve(fn)
console.log(ff, "changed")
exec("runtask.bat " + ff, {cwd:"../"}, (err,stdin,stdout)=>{
console.log(err,stdin, stdout)
touch("index.html") //svg updated
})
})
Here is the runtask.bat for Windows
m4 pgf.m4 %1 | dpic -g > tmp.tex
C:\texlive\2017\bin\win32\pdflatex template.tex
tool\dist-64bits\pdf2svg template.pdf %~dpn1.svg
tool\dist-64bits\pdf2svg template.pdf %~dp1tmp.svg
That way, you can "draw" by writing m4/dpic code and see the result in the browser live; and svg is generated from pdf which looks a lot nicer.
I am also using TikZ at the moment but you may wish to try http://blockdiag.com/
Here is one:
http://www.physicsbox.com/indexsolveelec2en.html
Here is where to look for others:
http://www.freebyte.com/electronics/
www.educypedia.be/electronics/easoftsim.htm
There are alternatives to graphviz that may do the job - see e.g. infovis, protovis, tulip.
See also other related questions 1, 2, 3.
Can you explain where graphviz falls short? The only requirement you list that I'm not sure about is attaching to specific ports. I would have thought you might be able to solve that with composite shapes / subgraphs, but maybe not...?
EDIT: Another option, particularly if you're looking at software engineering diagrams. Have you considered the eclipse gmp toolkit? It's what's used to build e.g. the UML2 editor tools.
hth.
I don't know of any tool that is a clear winner for easily making nice block diagrams with a minimum of manual labor. Some of the best looking results I've seen have been from TikZ. Check out the examples here:
http://www.texample.net/tikz/examples/area/electrical-engineering/
I have been getting very good results from Draw.io. It is a webapp but has a pretty powerful diagram editor and some decent stock symbol libraries. Drawings can be exported as PNG or SVG so can be publication quality and they link up to
I had spent so many hours failing to find a line graph generator for my benchmark results that I just wanted to plug in. I tried quite a few like Google's chart API but it still seemed confusing or not graceful looking, I am clueless.
Examples of benchmark images I wished to make something like are this:
What specific applications /web services do you recommend for generating something even close to this? I want something "neat".
You can use python mathplotlib, which generates beautiful graphs like:
(Source code)
I use gnuplot. It is not a lib, but a separate executable file. You can output plotting data to one file, and plotting commands in another - script file, which refer to data file. Then call gnuplot with this script file.
Another way is to use qwt. It is a real library, but it depends on Qt. If you already use Qt in your project, it is very straigth way to plot graphs. If not, then just use gnuplot