Tag Archives: XSLT

Simple Visualisation of Small RDF Graphs

One of the things that we have created in the SYNAT project is an RDF knowledge base that contains information about resources from:

  • the Digital Libraries Federation,
  • NUKAT (a union catalogue of Polish academic libraries),
  • the National Museum in Warsaw,
  • and will soon be supplemented with data from the National Museum in Kraków.

The metadata is obtained from the sources in their original metadata format (which means: PLMET, MARC 21, Mona system format, CDWA-Lite), and is transformed to the target format (CIDOC CRM / FRBRoo) using the jMet2Ont mapper and a set of rules expressed in XML.

The RDF data can be queried using the SPARQL language, viewed with a browser at the Linked Open Data endpoint (well, it is going to be open soon) and is processed by the SYNAT portal. Still, sometimes we want to look at the data after mapping to understand how a record has been mapped, especially when we detect that the resulting graph is disconnected.

There are a few RDF visualisation tools, but not all of them produce satisfying results. Here is how we visualise the graphs:

  1. The graph is serialized (a result of the mapping process) in the RDF/XML form. An example can be found here.
  2. A very simple XSLT transformation (available here) is run against the RDF/XML file, producing a PlantUML source code. The transformation can be applied with a tool like Saxon.
  3. PlantUML is a simple tool to create UML diagrams based on text files. Here is the automatically generated PlantUML code.
  4. Finally, PlantUML is used to generate a diagram like this:
PlantUML-generated (class) diagram showing relation between RDF/XML entities

So, to go from a test.xml file to the test.png diagram:

Transform.exe -xsl:RDF2PUML.xsl -s:test.xml -o:test.puml

java -jar plantuml.jar  test.puml

We thought this might me useful 🙂