Academic Meta Tool (AMT) – Interactive

About this notebook

This interactive notebook is a full Python port of the Academic Meta Tool (AMT), originally written in JavaScript using N3.js and vis.js. It demonstrates how an archaeological domain expert can encode graded (fuzzy) attributions between finds, figure types, potters and find contexts as a small ontology, and then let a reasoner derive new weighted relations from the asserted ones.

Everything on this page runs entirely in your browser via Pyodide and quarto-live. No server, no local Python installation, no account – the code cells are real, editable, and re-executable.

Note

On first load, your browser downloads the Python runtime (Pyodide, ~10 MB) plus rdflib and pyvis via micropip. Please allow a moment for it to initialise.

Why this example

The accompanying dataset, PotterAttributionExample.ttl, is a minimal but faithful version of the Potter Attribution use case that motivated AMT in the first place. Roman-period terra sigillata sherds carry stamped or moulded figure types; some figure types are characteristic of a particular potter, others are shared across several workshops. Attribution is therefore rarely certain – it is a matter of degree. AMT encodes exactly that: every relation carries a weight in the interval [0, 1], and weights propagate along role-chain axioms under a user-chosen fuzzy logic (Łukasiewicz, Product, or Gödel).

What you’ll learn

  1. How AMT’s tiny RDF vocabulary (amt:Concept, amt:Role, amt:weight, amt:RoleChainAxiom, …) models a fuzzy attribution graph.
  2. How to parse such a graph with rdflib and rebuild the concept/role/node/edge/axiom structures that AMT’s reasoner needs.
  3. How RoleChainAxiom and InverseAxiom derive new weighted edges, and how DisjointAxiom and SelfDisjointAxiom flag inconsistencies.
  4. How the same data looks with and without reasoning, visualised interactively with pyvis.

Data-context notes

  • Weights on the sample edges (0.33, 0.5, 0.6, 0.83, 1.0, …) are illustrative, not empirically derived. They exist to make the different fuzzy logics produce visibly different results.
  • The ontology uses the reified-statement pattern (rdf:subject / rdf:predicate / rdf:object / amt:weight) so that each edge is itself an RDF resource and can carry its own weight literal. This is how the original AMT serialises role instances and the parser in Step 2 reflects that choice.
  • Inferred edges rendered in the graph are marked in red dashed style and are not round-tripped back into the source TTL – they are reasoner output, not data.

Tooling notes

  • The browser variant uses pyodide.http substitutes for the usual Python HTTP stack and micropip for non-bundled packages. No requests, no SPARQLWrapper on this page.
  • For analysing your own TTL files (file upload, larger graphs, editing workflows), use the companion Jupyter notebook locally in JupyterLab or VS Code.

Step 1 – Setup


Step 2 – Load data & reasoning engine

The TTL file is shipped with this page via quarto-live’s resources: frontmatter entry and mounted into Pyodide’s virtual file system, so Path(...).read_text() just works – no network call needed.

load_amt() turns the RDF graph into five plain-Python structures (concepts, roles, nodes, edges, axioms) that the reasoner then operates on. Keeping the reasoner pure-Python (no OWL, no rdflib inference plug-ins) is deliberate: it matches the original AMT behaviour exactly and makes the fuzzy-logic choices explicit.


Step 3 – Visualisation & export

pyvis writes a full self-contained HTML document to the Pyodide VFS, which we then read back and wrap in an iframe so each graph on the page is its own sandboxed render.


Step 4 – Graph without reasoning

The raw asserted edges, straight from the TTL file – no inference applied. Node colour encodes the concept, edge width encodes the weight.


Step 5 – Graph with reasoning

Inferred edges are rendered as red dashed arrows. The two role chains declared in the ontology (RCA0001, RCA0002) both use Product Logic, so a chain of weights 0.5 and 0.6 becomes an inferred edge of weight 0.30. Feel free to edit the TTL file and switch one of them to amt:LukasiewiczLogic or amt:GoedelLogic to see how the derived weights change.


Step 6 – Consistency check

DisjointAxiom and SelfDisjointAxiom express what cannot be simultaneously true in the graph (for example: the same edge holding under two mutually exclusive roles, or a role being used reflexively when it mustn’t be). The Potter Attribution example ontology does not currently declare any integrity axioms, so the check returns consistent – add one to the TTL file to watch a violation show up here.


Tip

Want to analyse your own TTL files? The Jupyter notebook companion supports uploading arbitrary TTL files and runs locally in VS Code or JupyterLab with the full scientific Python stack.


This notebook is part of an Open Educational Resource built with the NFDI4Objects OER Quarto template. The Academic Meta Tool was originally developed by Martin Unold and Florian Thiery at i3mainz (2017) and is now maintained by Allard Mees and Florian Thiery at LEIZA within NFDI4Objects.