Skip to content

Extending Iolanta ontology
Assignment for MC-2 Fall 2025 © Anatoly Scherbakov

This is a continuation of MC-1, where the Iolanta ontology was introduced. MC-2 elaborates on a few aspects of how Iolanta works.

Modularizing a KG

Named Graphs

Iolanta loads every source of Linked Data, be it a file on local disk or a URI of such file on the Web, into a separate Named Graph in the RDF Dataset that Iolanta maintains, in-memory, relying upon rdflib.

RDF Graph Literals and Named Graphs is an Editor's Draft, but it very conveniently defines rdfg:Graph as a class for Named Graphs. That does not mean that every Named Graph will be automatically assigned this class using rdf:type, but it is a convenient endpoint to which we can connect a facet. Like this:

textual_graphs.yamlld
"@context":
  "@import": https://json-ld.org/contexts/dollar-convenience.jsonld
  iolanta: https://iolanta.tech/
  rdfs: http://www.w3.org/2000/01/rdf-schema#
  rdfg: http://www.w3.org/2009/rdfg#

  $: rdfs:label
  iolanta:is-preferred-over:
    "@type": "@id"

  iolanta:outputs:
    "@type": "@id"

$id: rdfg:Graph
iolanta:facet:
  $id: pkg:pypi/iolanta#textual-graphs
  $: Named Graphs

  iolanta:outputs: https://iolanta.tech/cli/textual

  iolanta:is-preferred-over:
    - pkg:pypi/iolanta#textual-properties
    - pkg:pypi/iolanta#textual-graph-triples

The pkg:pypi/iolanta#textual-graphs facet is using the following SPARQL query to find graphs:

textual-graphs.sparql
SELECT ?graph (COUNT(?s) AS ?count) WHERE {
    GRAPH ?graph {
        ?s ?p ?o .
    }
} GROUP BY ?graph ORDER BY DESC(?count) ?graph

And that's how this looks in Iolanta CLI (Command Line Interface):

iolanta http://www.w3.org/2009/rdfg#Graph

We called Iolanta to visualize only the rdfg:Graph node, but it imported a number of other things (like, YAML-LD files bundled with Iolanta itself), and that's how many Named Graphs have been created by the system.

Default Graph

Is a UNION of all Named Graphs. Iolanta relies upon rdflib supporting this capability. This greatly simplifies all SPARQL queries that facets have to run.

Foundational Ontology

We rely upon rdfs:label, rdfs:subClassOf, et cetera, and we try to keep Iolanta ontology very minimal.

Time and Space

Time

There is a separate Named Graph with Iolanta RDF Dataset denoted as iolanta://_meta. Let's view it.

iolanta iolanta://_meta

The triples in this graph record times when each of the other Named Graphs was loaded. This is important because Iolanta has a capability to auto reload a file in the project directory when that file is edited. This metadata store helps keep track of whether each Named Graph is in sync with its source on disk.

The iolanta:last-loaded-time property is used to record these timestamps:

last-updated-time.yamlld
"@context":
  # Use $keywords instead of @keywords in the ontology & data files.
  # This will allow to avoid extra quotes.
  "@import": https://json-ld.org/contexts/dollar-convenience.jsonld

  rdfs: http://www.w3.org/2000/01/rdf-schema#
  owl: http://www.w3.org/2002/07/owl#
  schema: https://schema.org/
  rdfg: http://www.w3.org/2009/rdfg#
  xsd: http://www.w3.org/2001/XMLSchema#
  iolanta: https://iolanta.tech/

  $: rdfs:label

  domain:
    "@id": rdfs:domain
    "@type": "@id"

  range:
    "@id": rdfs:range
    "@type": "@id"

  rdfs:subPropertyOf:
    "@type": "@id"

$id: iolanta:last-loaded-time
$type: owl:DatatypeProperty

$: Last Loaded Time

rdfs:subPropertyOf: schema:dateModified

domain: rdfg:Graph
range: xsd:dateTime

comment: |
  Records the timestamp when a Named Graph was last loaded into Iolanta's RDF Dataset.
  This property is used in the `iolanta://_meta` graph to track when each source
  of Linked Data was loaded, enabling auto-reload functionality for files in the
  project directory.
iolanta last-updated-time.yamlld

Space

Iolanta does not provide any special treatment to space-describing ontologies at this moment, but that can be implemented in specialized facets.

For instance, based on a pair of WGS84 coordinates, an Iolanta facet could generate HTML and JS code for an OpenStreetMap widget which then could be embedded into a publication.

Groups of Entities

Enforcement of OWL rules, such as

  • owl:oneOf,
  • or owl:Restriction,

requires the support of OWL reasoning. Iolanta is designed so that it does not require any inference at all.

We can, however, use Iolanta to visualize these properties themselves. Why not?

owl:oneOf

iolanta http://www.w3.org/2002/07/owl#oneOf

owl:Restriction

iolanta http://www.w3.org/2002/07/owl#Restriction

Graph Queries

  • SELECT


    ✅ Used to choose facets, and used by facets themselves, there are examples in MC-1 and in this document as well

  • ASK


    ✅ Used for facet pattern matching

  • CONSTRUCT


    ✅ Can be used if facet needs that

  • INSERT


    ❌ Not used, facets cannot modify the graph

  • UPDATE


    ❌ Not used, facets cannot modify the graph

  • DELETE


    ❌ Not used, facets cannot modify the graph

  • DESCRIBE


    ❌ Not used

RDF vs LPGs

Iolanta's domain is explicitly visualization of RDF data, not of LPGs. This is a crucial choice because Iolanta means to visualize data based on their meaning.

  • With RDF, URIs make it possible: you know how to use rdfs:label, for example, in whichever context it may appear;
  • With LPGs, the idea of Iolanta would be scarcely implementable at all.