<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by David Greco on Medium]]></title>
        <description><![CDATA[Stories by David Greco on Medium]]></description>
        <link>https://medium.com/@d.greco?source=rss-d23f361cb483------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*V17Z2iGAeo0wfZ0Kao6XWw.jpeg</url>
            <title>Stories by David Greco on Medium</title>
            <link>https://medium.com/@d.greco?source=rss-d23f361cb483------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:03:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@d.greco/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Tripatha: A Triple Store Designed for a Trillion Triples, Fast on One Machine Anyway]]></title>
            <link>https://medium.com/@d.greco/tripatha-a-triple-store-designed-for-a-trillion-triples-fast-on-one-machine-anyway-e2af710bf3ea?source=rss-d23f361cb483------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2af710bf3ea</guid>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[sparql]]></category>
            <category><![CDATA[rdf]]></category>
            <dc:creator><![CDATA[David Greco]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 11:35:10 GMT</pubDate>
            <atom:updated>2026-11-22T11:35:10.050Z</atom:updated>
            <content:encoded><![CDATA[<h3>An RDF store shaped for Accumulo and HBase clusters, measured on one machine against QLever and Oxigraph: how it works, where it wins and what it costs</h3><p>Tripatha is an RDF triple store built to run on a cluster of Apache Accumulo or Apache HBase servers, with a visibility label on every statement and a design target of 1⁰¹² triples. The same query engine also runs, over the same storage interface, on an embedded RocksDB database in a local directory. In that single-machine configuration it answered the 100 queries of the WatDiv benchmark with a geometric mean of 2.3 ms. Oxigraph took 3.8 ms and QLever 9.5 ms, and both are engines built only for one machine.</p><p>This post describes the design that a cluster imposes, why it costs little on these queries on one machine, where it does cost, and how much of the road to a trillion triples has been mapped.</p><h3>Where it comes from</h3><p>Tripatha is derived from Apache Rya [1]. It keeps Rya’s storage model and its query-time inference, rebuilt for Accumulo 2.1 [2], RDF4J 6 [5] and Java 25, and removes everything else. What is new:</p><ul><li>two more backends behind a common storage interface: HBase 3.0 [3] and an embedded RocksDB [4];</li><li>RDF 1.2 and SPARQL 1.2 [6, 7]: triple terms, reified and annotated statements, and literals with a text direction;</li><li>cell-level visibility labels, with the same meaning on every backend;</li><li>joins that are batched, merged and partly evaluated inside the storage servers (described below);</li><li>optional full-text and GeoSPARQL indexes that honour the labels;</li><li>a live trace of every storage call a query makes.</li></ul><p>The project was inspired by JanusGraph [8], an open-source property-graph database built for graphs of hundreds of billions of vertices and edges. It keeps its data in distributed NoSQL stores such as Apache Cassandra, Apache HBase and Google Cloud Bigtable. Tripatha pursues the same goal for RDF: a knowledge graph, queried in SPARQL, that reaches that order of magnitude on the same kind of distributed storage. A knowledge graph that can grow to that size opens up a wide range of new use cases.</p><p>Tripatha is available under the Apache License 2.0 [12]. It is an independent project, not part of the Apache Software Foundation.</p><h3>Every statement, three times</h3><p>The storage model, inherited from Rya, fits in one sentence. Every statement is written three times, into three tables whose row keys start with its subject, its predicate and its object respectively. Whatever parts of a triple pattern a query knows, one of the three tables keeps all the matching statements next to each other, so they come back from a single range scan.</p><p>For ex:alice ex:age 42 in the graph ex:g1, the three row keys are these, with the separator bytes in hex:</p><pre>spo  http://ex.org/alice 00 http://ex.org/age 00 800000012a 01 05<br>po   http://ex.org/age 00 800000012a 00 http://ex.org/alice 01 05<br>osp  800000012a 00 http://ex.org/alice 00 http://ex.org/age 01 05</pre><p>800000012a is the integer 42 in an encoding whose byte order is the numeric order. The closing 01 05 marks its type, xsd:integer. The graph goes in the column family and the statement&#39;s label in the cell&#39;s visibility. Because numbers sort as numbers, a filter such as ?age &gt; 60 becomes a range of the po table rather than a scan with a check on every row.</p><p>Three properties follow from this layout. Each is a cost that an engine built for one machine does not pay:</p><ul><li><strong>Terms are stored whole in every key.</strong> There is no dictionary that maps IRIs and literals to integers. At 1⁰¹² triples such a dictionary would hold hundreds of billions of terms, so whether it pays at that size is a measured decision, not a default.</li><li><strong>Statistics are kept up to date on every write.</strong> Cardinality counters per subject, predicate, object and pair are summed by the store and feed the join order. The store takes updates online.</li><li><strong>Every cell carries a label,</strong> and the label is checked on every read.</li></ul><h3>One query engine, three backends</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*s1qx0AVbXuDRqTJ3.png" /><figcaption>Figure 1. The query engine, statistics and indexes are written once, above a storage interface whose every call is one native operation of a sorted store.</figcaption></figure><p>The write path, the query engine, the statistics and the indexes are written once, above a storage interface. Every call in that interface is one native operation of a distributed sorted store: a range scan, a batch of ranges or a write. Nothing in the engine assumes that the data fits in one process.</p><p>The backends differ in where work can run. Accumulo runs Tripatha’s iterators inside its tablet servers, and HBase runs its coprocessors inside its region servers. RocksDB runs everything in the process, with native seeks. When a step is meant to run in the servers but the server code isn’t deployed, the client does the same work, with the same answers and more data moved. Labels mean the same on all three backends. On RocksDB, which has no accounts, Tripatha checks them itself. The integration tests run on all three.</p><h3>Joins shaped for a network</h3><p>On a cluster the expensive operation is the round trip. A nested-loop join asks the store once per row on its left side, so a left side of 100,000 rows means 100,000 small scans, one after the other. Most of Tripatha’s query-side work goes into asking fewer and larger questions, and into moving work to where the data is.</p><h4>Batched joins</h4><p>RDF4J evaluates joins as nested loops. Tripatha keeps those semantics but changes where the right-hand statements come from:</p><ol><li>It reads a window of left rows.</li><li>It works out the lookup that each row will make.</li><li>It fetches all of those lookups in one batch scan per table.</li></ol><p>RDF4J’s own step then runs once per row, answered from the prefetched batch. Optional variables, repeated variables and graph scopes therefore behave exactly as before. Windows start at 64 rows and double up to 1,000, so a query with a LIMIT stops after a small window instead of a full batch.</p><p>Two rewrites make the batches possible:</p><ul><li><strong>Left-deep joins.</strong> RDF4J nests joins to the right, Join(a, Join(b, c)). That leaves a single row on the left of the inner join, so there is nothing to batch. Tripatha rotates them into the left-deep Join(Join(a, b), c).</li><li><strong>Entity prefetch.</strong> A chain of joins and OPTIONALs over the same entity, such as an entity&#39;s attributes, is fetched as one batch for the whole chain.</li></ul><h4>Stars intersected where the data is</h4><p>The query shape that grows worst with the data is “all entities matching X”:</p><pre>SELECT ?x WHERE { ?x a :Person ; :worksFor :Acme ; :nationality :IT }</pre><p>At 1⁰¹² triples each of the three lists can hold billions of subjects. Looking up the other two patterns once per person would bring back the nested loop. Instead, Tripatha reads each constant pattern as a subject-sorted range of po and intersects the lists as they stream in. The subject space is cut into slices, which are intersected on several threads. On the Accumulo test cluster, this took the class-large query of Tripatha&#39;s own join benchmark from 1,446 ms to 137 ms.</p><p>That still moves every list to one client. The entity index removes that step. It is an optional second copy of the postings, sharded by subject, so that the intersection of a star is the union of the shards’ intersections. The store intersects each shard itself:</p><ul><li>in Accumulo’s tablet servers, with an iterator;</li><li>in HBase’s region servers, with a coprocessor endpoint;</li><li>in RocksDB, with native seeks.</li></ul><p>The intersection leapfrogs: each list seeks to the largest subject that the other lists have reached. A long list therefore costs about as many seeks as the shortest one has postings. Only the matches come back, or one number per shard for a COUNT. On the join benchmark, stars became 2.3 to 4 times faster on Accumulo and RocksDB. The index costs 17 % more disk and about a fifth of the load rate.</p><h4>Counting instead of reading</h4><p>In this query, ?f appears nowhere else:</p><pre>SELECT ?p WHERE { ?p a :Person ; :knows ?f }</pre><p>The pattern ?p :knows ?f doesn&#39;t choose any value that the query returns. It only decides how many times each person&#39;s row comes back. So instead of reading the matching statements, its lookups ask the store how many there are, under the query&#39;s labels, and the row is repeated that many times. Accumulo and HBase count in their servers, and RocksDB counts with native iteration. Either way, one number per range comes back instead of every match.</p><p>This is not an edge case: five of the six patterns in WatDiv’s C3 template have this form. Before the change, decoding statements and building rows took 29 % of C3’s CPU. With it, C3 about halved on the native executable: from 533 ms to 268 ms in the run of 2026–11–20. The comparison below, run a day later, measured 290 ms.</p><h4>Planning in one round trip</h4><p>To order the joins, the planner needs counters for every pattern’s estimate. Tripatha reads all of them in one batch, instead of making one round trip per pattern. On the Accumulo test cluster the median plan went from 1.69 ms to 1.23 ms. Before the change, planning had been half of a small query’s time on Accumulo.</p><p>Most of these mechanisms were built for the cluster, and they also pay on one machine. In RocksDB a batch of lookups becomes a batch of seeks. A counted pattern skips decoding rows whether those rows sit across a network or in the same process.</p><h3>On one machine, against engines built for one</h3><p>The comparison uses WatDiv [9], a standard SPARQL stress test that none of the three engines was tuned for. It ran at scale factor 100: 10,867,277 statements, and 5 queries from each of WatDiv’s 20 templates. The templates come in four shapes: linear, star, snowflake and complex. The engines ran one at a time on one machine (12 cores, 24 GB, macOS, NVMe), over HTTP:</p><ul><li><strong>Tripatha</strong> ran as its native executable on RocksDB, with the entity index on. This was the profile-guided build, which needs Oracle GraalVM, with a 6 GB heap (-Xms6g -Xmx6g).</li><li><strong>QLever 0.6.0</strong> [10] was the Homebrew build, run with -m 6G.</li><li><strong>Oxigraph 0.5.13</strong> [11] was the pinned release, opened read-only.</li></ul><p>All three held the same statements, and every query returned the same rows on all three. Each time is the median of 10 timed runs, measured to the last byte of a TSV result, with a warm cache. The figures are from 2026–11–21, at commit c1e1968.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qC9OagiHD9nvqNKH.png" /><figcaption>Figure 2. WatDiv at scale factor 100 on one machine: the geometric mean of each query’s median time, on a log scale. Lower is faster.</figcaption></figure><p>What it shows:</p><ul><li><strong>Fastest overall.</strong> Over all 100 queries, Oxigraph took 1.7 times Tripatha’s time and QLever 4.2 times. Tripatha was the fastest on 13 of the 20 templates, tied with Oxigraph on 5 of those.</li><li><strong>The 85 small queries</strong> (linear, star and snowflake): the means were 1.28 ms for Tripatha, 1.66 ms for Oxigraph and 6.79 ms for QLever. QLever spends a few milliseconds even on the smallest: 4.1 ms on L1, which returns 0 to 3 rows.</li><li><strong>The 15 complex queries:</strong> Tripatha was 16 % faster than QLever and 7 times faster than Oxigraph. C3 has the largest answer, 444,070 rows, and took 290 ms against QLever’s 355.</li></ul><p>It doesn’t win everywhere:</p><ul><li><strong>QLever</strong> is ahead on C2 (35.7 ms against 47.8), L2 and S4.</li><li><strong>Oxigraph</strong> is ahead on S3, S6, F3 and F4, by 0.2 to 2 ms. On those templates Tripatha’s time goes into building and hashing the keys of thousands of lookups, while Oxigraph joins integer IDs. That is the dictionary Tripatha does not have.</li></ul><p><strong>The cost is on the write side.</strong> Loading took Tripatha 99 s, against 11 s for each of the others. Tripatha loads through the same path as online updates: labelled cells, three orders, statistics and the entity index. Its store is 0.99 GB, against 0.28 GB for QLever’s index and 1.22 GB for Oxigraph.</p><p><strong>The comparison has limits:</strong></p><ul><li><strong>What it leaves out.</strong> It doesn’t measure concurrent queries, writes while querying, a cold cache, or data larger than memory.</li><li><strong>The build.</strong> The profile-guided build matters. The GraalVM Community build, which is open source and is what CI and the Docker image use, was 11 to 16 % slower overall on WatDiv.</li><li><strong>The machine.</strong> In the comparison of the day before, Tripatha’s mean was 2.6 ms. QLever and Oxigraph also measured 5 to 6 % faster on the second day, so part of that gain is the machine.</li><li><strong>The data.</strong> WatDiv seeds its generator from the clock, so each machine gets its own dataset, and figures compare only within one machine.</li></ul><p>One benchmark on one machine is a guide, not a ranking.</p><h3>The road to a trillion</h3><p>A lookup on a sorted key-value store costs about the same at 1⁰¹² triples as at 1⁰⁹. It is one seek, more often a cold read from disk, because only a few per cent of the data fits in cache. Batched joins, statistics reads, graph sizes and the inference refresh are bounded by the size of the query or of the ontology, not by the size of the store. What 1⁰¹² breaks is elsewhere:</p><ul><li>ingest through the write path;</li><li>statistics that are ten times bigger than they need to be;</li><li>maintenance operations that read whole tables;</li><li>queries whose intermediate results are themselves huge.</li></ul><p>An early test load stored about 160 bytes per triple after compaction, with statistics and both search indexes. At 1⁰¹² that would be about 160 TB for one copy, or 480 TB with three replicas. The work done so far for that scale:</p><ul><li><strong>Counters of 1 are not written.</strong> The planner reads a missing counter as 1, and about 90 % of the stored counters held exactly that value. Leaving them out took the cells sent per triple from 11.6 to 8.2.</li><li><strong>Bulk builds bypass the write path.</strong> The loader writes each backend’s own sorted files and imports them: RFiles on Accumulo, HFiles with label tags on HBase, SST files on RocksDB. At 10M triples on the Accumulo test cluster that took 70 s, against 906 s through the write path. A Spark job does the same for Accumulo across a cluster’s executors. It reads the generator’s data or N-Triples and N-Quads files.</li><li><strong>Tables are pre-split for their final size.</strong> At 1⁰¹² that means about 2,100 tablets per statement table.</li><li><strong>Index rebuilds run as batch jobs.</strong> Approximate sizes of graphs, classes and predicates are answered from the counters in a handful of reads.</li></ul><p>Dictionary encoding comes late on purpose. The statement tables compress about 7 times on disk. For this data, integer IDs plus a dictionary of up to 450 billion terms come out about even on disk. The change would also break the storage format, touching value ordering, triple terms, counters, indexes and labels. So it waits for a measured go/no-go.</p><p><strong>Where it stands.</strong> Tripatha has not run at 1⁰¹², and it can’t on the hardware available. The cluster used for this work has four arm64 nodes running Accumulo 2.1.6, and it holds at most 1⁰⁹ triples. Its first runs, on 2026–11–21, used the Spark job to build a 10M-triple store with every index in 155 s. A 500M load was stopped by a slow storage node and is due to be rerun. The plan:</p><ol><li>measure at 500M and at 1B;</li><li>run 500M with the layout of 1⁰¹², meaning its 2,100 tablets per table and 5,000 entity-index shards;</li><li>fit a time model to 1⁰¹² on those runs.</li></ol><p>Every item of the plan is tracked in the open in the repository’s SCALE-STUDY.md [12], with its measurements and the decisions behind it.</p><h3>How it was built</h3><p>Tripatha went from its first commit to the measurements reported here in under four weeks, between 26 October and 21 November 2026. It was built with Claude Code [13], Anthropic’s agentic coding tool, and Claude is a co-author of every one of its 146 non-merge commits. Claude Code proved a powerful tool for this kind of work: a single design carried through three storage backends, with every change held to the same answers and measured before it was kept.</p><p>Each optimization in this post went through the same loop:</p><ol><li>The hypothesis and its estimated gain were written into SCALE-STUDY.md.</li><li>It was implemented on all three backends.</li><li>The integration tests ran on Accumulo, HBase and RocksDB, and the join benchmark measured the change.</li><li>The measured figure replaced the estimate, even when it showed no gain.</li></ol><p>One optimization, reading a subject’s links as one range, was built and measured that way and is left off by default, because it didn’t pay. The documentation this post draws on, ARCH.md and SCALE-STUDY.md, was written and kept current in the same workflow.</p><h3>Trying it</h3><p>The quickest way to try it is Docker, on RocksDB:</p><pre>git clone https://github.com/dgreco/tripatha.git<br>cd tripatha<br>TRIPATHA_BACKEND=rocksdb docker compose up --build<br># then open http://localhost:8080/</pre><p>This builds the native executable with GraalVM Community, not the profile-guided build measured above. It is meant for trying Tripatha out, not for running it, and the first build takes several minutes. The query page has an examples menu with sample data (Rome landmarks), text and geo searches, and RDF 1.2 annotations. Ticking <strong>Trace</strong> streams every scan a query makes while it runs.</p><p>Class sizes come from the statistics, in a handful of reads:</p><pre>curl -s http://localhost:8080/sparql \<br>  -H &#39;Content-Type: application/sparql-query&#39; \<br>  -H &#39;Accept: text/tab-separated-values&#39; \<br>  --data &#39;PREFIX stats: &lt;urn:tripatha:stats#&gt;<br>SELECT ?class ?members WHERE { ?class stats:approxInstances ?members }&#39;</pre><p>To reproduce the comparison, run tripatha.loader/compare.sh --build from the repository&#39;s root. It builds the native executable, fetches and builds WatDiv, generates the data, loads all three engines and measures them. --check lists anything still missing. The first run takes 30 to 45 minutes.</p><p>The repository’s README covers using Tripatha. ARCH.md explains its internals with diagrams, and SCALE-STUDY.md maps the road to 10¹².</p><h3>References</h3><p>[1] Apache Rya. <a href="https://github.com/apache/rya">https://github.com/apache/rya</a></p><p>[2] Apache Accumulo. <a href="https://accumulo.apache.org/">https://accumulo.apache.org</a></p><p>[3] Apache HBase. <a href="https://hbase.apache.org/">https://hbase.apache.org</a></p><p>[4] RocksDB. <a href="https://rocksdb.org/">https://rocksdb.org</a></p><p>[5] Eclipse RDF4J. <a href="https://rdf4j.org/">https://rdf4j.org</a></p><p>[6] W3C, “RDF 1.2 Concepts and Abstract Data Model.” <a href="https://www.w3.org/TR/rdf12-concepts/">https://www.w3.org/TR/rdf12-concepts/</a></p><p>[7] W3C, “SPARQL 1.2 Query Language.” <a href="https://www.w3.org/TR/sparql12-query/">https://www.w3.org/TR/sparql12-query/</a></p><p>[8] JanusGraph. <a href="https://janusgraph.org/">https://janusgraph.org</a></p><p>[9] G. Aluç, O. Hartig, M. T. Özsu and K. Daudjee, “Diversified Stress Testing of RDF Data Management Systems,” in The Semantic Web — ISWC 2014. <a href="https://doi.org/10.1007/978-3-319-11964-9_13">https://doi.org/10.1007/978-3-319-11964-9_13</a></p><p>[10] QLever. <a href="https://github.com/ad-freiburg/qlever">https://github.com/ad-freiburg/qlever</a></p><p>[11] Oxigraph. <a href="https://github.com/oxigraph/oxigraph">https://github.com/oxigraph/oxigraph</a></p><p>[12] Tripatha: source, documentation and benchmark scripts. <a href="https://github.com/dgreco/tripatha">https://github.com/dgreco/tripatha</a>, and <a href="https://tripatha.org/">https://tripatha.org</a></p><p>[13] Claude Code. <a href="https://claude.com/product/claude-code">https://claude.com/product/claude-code</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2af710bf3ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meta Catalog: A Model-Driven Metadata Catalog with Declarative Provisioning and Policy…]]></title>
            <link>https://medium.com/@d.greco/meta-catalog-a-model-driven-metadata-catalog-with-declarative-provisioning-and-policy-c4b5e70392e6?source=rss-d23f361cb483------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4b5e70392e6</guid>
            <dc:creator><![CDATA[David Greco]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 16:04:01 GMT</pubDate>
            <atom:updated>2026-10-01T17:05:43.176Z</atom:updated>
            <content:encoded><![CDATA[<h3>Meta Catalog: A Model-Driven Metadata Catalog with Declarative Provisioning and Policy Administration</h3><h4>Design, implementation, and two case studies: a data mesh and a medallion lakehouse</h4><p><em>Figure 1. System overview. The model is authored through YAML documents, the REST API or the web interface. Provisioning, access administration, engine-facing catalog protocols and SPARQL queries all operate on that single model.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hSIdDs7xQhRoBttT.png" /></figure><p><strong>Abstract.</strong> Metadata about a modern data platform is typically spread across table catalogs, identity and access management systems, infrastructure-as-code repositories and documentation. Conventional catalogs consolidate this information by harvesting the state of running systems, so they produce a description that is neither authoritative nor enforceable. This article presents Meta Catalog, an open-source metadata catalog that inverts that relationship. The user-defined metadata model is treated as the authoritative specification. From it the catalog derives physical resources, orchestrates their lifecycle in dependency order, and administers access policies. The model is built from traits and entity types validated through JSON Schema, with immutable versioning and entity pinning. It is extended by rule-based derivations (mappings) and by aggregates, trees of entities whose roles derive from built-in traits. Two independent lifecycles, provisioning and authorization, are scheduled over a dependency graph inferred from the mappings. The system exposes the model through a REST API generated from an OpenAPI specification, through the Apache Iceberg REST catalog and Hive Metastore protocols, and through a SPARQL 1.1 endpoint backed by a virtual knowledge graph. Two case studies show how the same primitives express a data mesh and a medallion lakehouse. We report the observed behaviour of validation, derivation, lifecycle ordering, policy resolution and graph queries, and we discuss the limitations found during the evaluation. This is a follow-up to the research project described here [11] and here [12].</p><h3>1. Introduction</h3><p>A data platform can be described along two axes. The <em>operational</em> platform consists of storage locations, tables, schemas and access grants. The <em>descriptive</em> platform consists of the documentation, ownership records and catalogs that explain the operational one. In most organisations the two are maintained separately and diverge over time. A typical question such as “who may read table orders, who owns it, and what depends on it?&quot; requires consulting several systems whose contents are not mutually consistent.</p><p>Two properties of conventional catalogs contribute to this divergence. First, they are <em>descriptive</em>: they record what exists, usually by periodic harvesting, but they do not determine what exists. Second, their schema is largely <em>fixed</em>. The vocabulary of databases, tables and columns is built in, while organisation-specific concepts such as a data product, an output port or a quality tier are attached as free-form annotations without validation.</p><p>Meta Catalog addresses both properties. The metadata model is defined by the user and validated by the system. The catalog then acts on the model: it derives physical resources from logical ones, creates and removes them in dependency order, and pushes access decisions to the systems that enforce them. Query engines can use the catalog directly through standard protocols, so tables created by those engines become part of the same model.</p><p>The contributions described in this article are:</p><ol><li>a user-extensible metadata model based on traits and entity types, with schema validation, immutable type versioning, entity pinning and sanctioned relationships (Section 3);</li><li>a rule-based derivation mechanism, <em>mappings</em>, evaluated asynchronously over lifecycle events (Section 3.4);</li><li>an <em>aggregate</em> abstraction with trait-derived roles and enforced containment rules, over which two independent lifecycles, provisioning and authorization, are scheduled using a dependency graph inferred from the mappings (Sections 3.5 to 3.7);</li><li>an implementation that exposes the model through REST/OpenAPI, the Apache Iceberg REST catalog specification, the Hive Metastore Thrift protocol and SPARQL 1.1 (Section 4);</li><li>two case studies, a data mesh and a medallion lakehouse, executed against the running system (Sections 5 and 6).</li></ol><p>Section 2 summarises the background, Section 7 discusses composition and limitations, and Section 8 concludes.</p><h3>2. Background</h3><h4>2.1 Metadata catalogs</h4><p>Three families of systems are relevant. <em>Table catalogs</em>, such as the Hive Metastore [5] and implementations of the Apache Iceberg REST catalog specification [4], store the technical metadata that query engines need to resolve and commit tables. <em>Discovery catalogs</em> harvest metadata from such systems and enrich it with documentation, ownership and lineage. <em>Policy administration systems</em>, of which Apache Ranger [8] is a representative example, maintain access policies and distribute them to enforcement points.</p><p>Meta Catalog overlaps with all three. It implements two table-catalog protocols, it maintains a queryable graph of platform metadata, and it administers access policies. Its distinguishing property is that the model it maintains is the source from which resources and grants are derived, not a record collected after the fact.</p><h4>2.2 Data mesh</h4><p>Data mesh is an organisational and architectural approach defined by four principles [1]: domain-oriented decentralised data ownership and architecture; data as a product; self-serve data infrastructure as a platform; and federated computational governance. Data are partitioned <em>by domain</em>. Each domain publishes data products through well-defined output ports.</p><h4>2.3 Medallion architecture</h4><p>The medallion architecture is a data design pattern that organises a lakehouse into layers that progressively improve the structure and quality of data [2]. The <em>bronze</em> layer holds raw data in its original structure. The <em>silver</em> layer holds cleaned and conformed data. The <em>gold</em> layer holds consumption-ready data, typically denormalised for reporting and analytics. Data are partitioned <em>by quality</em>.</p><p>The two approaches therefore partition data along orthogonal dimensions. A metadata model that supports both, and their combination, must not hard-code either.</p><h3>3. Data model</h3><p>The model comprises six constructs (Figure 2): traits, entity types, entities, relationships, mappings and aggregates. This section defines each construct and the lifecycles that operate on them.</p><p><em>Figure 2. The six constructs of the metadata model.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*faNSNpLLVFyHqFKj.png" /></figure><h4>3.1 Traits, entity types and derived schemas</h4><p>A <em>trait</em> is a named, reusable unit consisting of an optional JSON Schema [7] fragment and, optionally, a role that the platform recognises (for example Aggregate or Provisionable). A trait may inherit from one parent trait.</p><p>An <em>entity type</em> consists of a name, its own JSON Schema, a set of traits, and an optional parent type. The schema against which an entity is validated is the type’s <em>derived schema</em>. It is obtained by merging the type’s own schema with the schemas reachable through its parent chain and through the traits it carries, including the traits’ own parent chains. The merge order is defined by a linearization of the inheritance graph, analogous to class linearization in Scala [6], so a diamond-shaped hierarchy has a single, deterministic result. Derived schemas forbid additional properties. A value that no contributing schema declares is therefore rejected rather than silently stored.</p><p>Figure 3 illustrates the construction for the demonstration type DataProductType. It carries WithName, Provisionableand Authorizable, and its derived schema includes the name field, the access-policy fields contributed by Authorizable, and the status fields contributed by both lifecycle traits.</p><p><em>Figure 3. Composition of a derived schema from traits and type inheritance.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*04wGuMsHJZbwYv2t.png" /></figure><h4>3.2 Versioning and entity pinning</h4><p>Traits and entity types are versioned. The live definition is held in a single row per name. Each change creates a new version: the live row is updated, its version counter incremented, and an immutable snapshot of the new state appended to a history table. Snapshots are self-contained. They retain the base schema, the derived schema, the parent and the trait list in effect at the time, so an old version can always be read back exactly. Version creation is serialised per type with a row-level lock, which yields strictly increasing version numbers under concurrent updates.</p><p>Every entity is <em>pinned</em> to the snapshot of the version it was created against. Updates to an entity are validated against the pinned snapshot, not against the live type. As a consequence, introducing a new version never changes the validation rules of existing entities. Deleting a snapshot that is still referenced by an entity is rejected, and the live version cannot be deleted through the version interface (Figure 4).</p><p><em>Figure 4. Version chain of an entity type and pinning of entities to individual versions.</em></p><h4>3.3 Relationships and referential safety</h4><p>Entities are linked by typed relationships drawn from a closed vocabulary. Each relationship has an inverse: HAS_PART / IS_PART_OF express composition, DEPENDS_ON / IS_REQUIRED_BY express ordering and lineage, and MAPPED_TO / IS_MAPPED_BY express derivation.</p><p>A link between two entities is admitted only if a <em>trait relationship</em> sanctions it. That is, a relationship of the same type must be declared between traits carried by the two entity types. Trait relationships thus play the role that foreign keys play in a relational schema.</p><p>Removal operations are checked for referential safety. An entity with links cannot be deleted individually. A containment link cannot be removed if doing so would detach a part from its aggregate. A link cannot be removed if a mapping resolves a path through it. A trait relationship cannot be removed while an entity link depends on it as its only sanction. These checks are <em>exact</em>: each candidate is re-evaluated with the removal applied, rather than approximated at the level of types.</p><h4>3.4 Mappings</h4><p>A <em>mapping</em> is a rule that derives entities of a target type from entities of a source type. Formally, a mapping consists of a source type, a target type, a set of value expressions and a set of path references. The value expressions map target fields to expressions in the Spring Expression Language (SpEL) [9]. Each path reference binds an alias to a <em>path</em>.</p><p>A path is a sequence of segments of the form REL{p}, where REL is a relationship type and p is a JSONPath predicate. Starting from the source entity, each segment moves from the current entity <em>e</em> to the entity <em>x</em> such that <em>x</em> REL <em>e</em> holds and <em>x</em>satisfies <em>p</em>. The predicate $ accepts any entity. Resolution fails if a segment yields no candidate, and it is rejected as ambiguous if more than one candidate satisfies the predicate. For example, HAS_PART{$} resolves to the aggregate that contains the source entity. The value expressions are evaluated with the source entity&#39;s values bound to #source and the values of each resolved entity bound to its alias. The base demonstration contains the following mapping:</p><pre>- sourceEntityType: FileBasedOutputPortType<br>  targetEntityType: S3FolderType<br>  mappingValues:<br>    path: &quot;&#39;/root/&#39;+ #dp.getValue(&#39;$.name&#39;).asText() + &#39;/&#39; + #source.getValue(&#39;$.name&#39;).asText()&quot;<br>    bucket: &quot;&#39;my-bucket&#39;&quot;<br>  entityPathReferences:<br>    - alias: &quot;dp&quot;<br>      referencePath: &quot;HAS_PART{$}&quot;</pre><p>Mappings are evaluated asynchronously (Figure 5). Creating or updating an entity whose type is a mapping source records a lifecycle event. A scheduled job drains pending events. It evaluates each applicable mapping, validates the result against the target schema, persists the derived entity together with the MAPPED_TO / IS_MAPPED_BY link pair, and recurses, because a derived entity may itself be a mapping source. Events are marked as processed or failed, so a failing event is not retried indefinitely. When several application instances share a database, a PostgreSQL advisory lock ensures that only one instance processes events at a time.</p><p>Derived entities are pinned to the target-type version against which the mapping was defined. Creating a new version of a target type is rejected if an existing mapping no longer satisfies the candidate schema. Target types cannot be written through the ordinary entity interface. The only exception is the status fields written by the lifecycle procedures.</p><p><em>Figure 5. Mapping evaluation: data flow (top) and asynchronous execution over lifecycle events (bottom).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ob-MlvwnCJDKK2jB.png" /></figure><h4>3.5 Aggregates</h4><p>An <em>aggregate</em> is a tree of entities connected by HAS_PART links. Composition is not declared between entity types directly. Instead, two built-in traits, Aggregate and AggregateElement, are connected by a single immutable trait relationship, Aggregate HAS_PART AggregateElement, which sanctions every containment within the model. The traits an entity type carries determine its role (Figure 6). A type carrying only Aggregate is a <em>root</em>. A type carrying both is an <em>intermediate</em>. A type carrying only AggregateElement is a <em>leaf</em>. A type carrying neither is outside the aggregate model and may contain anything.</p><p><em>Figure 6. Roles derived from built-in traits, and an aggregate instance from the base demonstration.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HJGtZq6Z7Cqsoy1C.png" /></figure><p>The containment rules implied by the roles (Figure 7) are enforced wherever a containment can arise: when a trait relationship is created, when two entities are linked, and when a trait or type is versioned in a way that would change which traits a type carries. Containment between entities must also remain acyclic, which guarantees that every traversal of an aggregate terminates.</p><p><em>Figure 7. Containment rules by role. Violations are rejected with HTTP 400.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K2beMix8u2gLPlgP.png" /></figure><p>Aggregates are authored, read and deleted as units. A single YAML document describes the root, its parts, their values and the DEPENDS_ON relationships between them, expressed through local references. The document is loaded in one transaction, so a document that fails validation leaves no partial state. For any root type, the catalog generates a combined JSON Schema in which every reachable part type appears under $defs. The web interface uses this schema to generate an authoring form (Figure 8). Deleting an aggregate removes the root, its HAS_PART tree and the entities derived from its members, provided that no member is linked to an entity outside the aggregate and no member is itself a mapping target.</p><p><em>Figure 8. The aggregate authoring form generated from the combined schema of the lakehouse root type used in Section 6.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5ufOegAlJrDs-7xm.png" /></figure><h4>3.6 Lifecycles</h4><p>Two pairs of built-in traits extend the aggregate roles with lifecycles. Provisionable and ProvisionableResource(which inherit Aggregate and AggregateElement respectively) enable <em>provisioning</em> and <em>unprovisioning</em>. Authorizableand AuthorizableResource enable <em>authorization</em> and <em>rejection</em>. The two lifecycles are independent: they record their outcomes in separate status fields, so a resource can be provisioned without being authorized (Figure 9).</p><p>For a given aggregate and resource trait <em>R</em>, the procedure constructs a directed <em>resource graph</em>. Its vertices are the members of the aggregate that carry <em>R</em>, including the entities derived from members through mappings. An edge <em>r → r′</em>exists if a path reference of the mapping that derived <em>r</em>, evaluated from <em>r</em>’s source entity, resolves to <em>r′</em>. The graph is checked for cycles before any task is executed. Provisioning and authorization execute a registered task for each vertex after all of its successors (the resources it depends on) have completed. Unprovisioning and rejection traverse the graph in the opposite direction. Independent vertices are executed concurrently. Tasks are registered per entity type. They are implemented either as Java classes or through a built-in task that invokes an external script with the resource’s values.</p><p>The procedures can be invoked synchronously (HTTP 204 when all resources have completed) or asynchronously (HTTP 202 with a schedule identifier that can be polled).</p><p><em>Figure 9. The provisioning and authorization lifecycles.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RV1iB8wgJAdF0MYM.png" /></figure><h4>3.7 Access policy administration</h4><p>Access policy is declared on the aggregate root and nowhere else. The Authorizable trait contributes three fields:</p><ul><li><em>principals</em>, which are references to subjects in an external identity provider (user, group, role or service), not entities managed by the catalog;</li><li><em>permissions</em>, an abstract vocabulary (for example READ and WRITE) that is deliberately independent of any target system;</li><li><em>grants</em>, each binding a set of principals to a set of permissions, optionally restricted by a <em>resource selector</em>.</li></ul><p>A selector restricts a grant to resources of given entity types, to resources whose values contain given fields with given values, or to both. When an aggregate is authorized, the policy is validated before any task runs. References to undeclared principals or permissions are rejected, and so are selectors that match no resource of the aggregate. The policy is then resolved per resource. Each resource records the grants applied to it (effectiveGrants), and the aggregate&#39;s access report lists the declared policy alongside the grants in force. The two may legitimately differ until the next authorization run. Rejection reads no policy at all, so it remains available as an emergency stop.</p><p>Meta Catalog acts as a policy <em>administration</em> point, not a policy <em>decision</em> point. It is not consulted at query time. Translating abstract permissions into the vocabulary of a target system is the responsibility of the registered task.</p><h3>4. Architecture and implementation</h3><p>The system is implemented in Java 25 on Spring Boot 4.1 with PostgreSQL 18. It is organised as ten Maven modules that produce three deployable applications (Figure 10).</p><p><em>Figure 10. Module and deployment architecture.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4GoKZSis5qhN8OAD.png" /></figure><p><strong>Contract-first interface.</strong> The REST interface is defined by an OpenAPI specification from which controllers, models and a client are generated. Hand-written code only implements the generated interfaces.</p><p><strong>Interface isolation of the web UI.</strong> The server-rendered web interface accesses the catalog exclusively through the REST API. The core modules are excluded from its compile-time classpath, so a direct dependency is a compilation error rather than a violation of convention.</p><p><strong>Persistence.</strong> Entity values are stored as JSONB. The relational schema (twelve tables) is owned by a single Flyway migration. The built-in model (the lifecycle traits and the containment relationship) is not seeded by SQL. It is declared by Java <em>contributors</em> and installed idempotently at start-up, as immutable rows that can be neither deleted nor versioned.</p><p><strong>Concurrency control.</strong> The mapping scheduler, the immutable-model installer and the Iceberg commit path are serialised with PostgreSQL advisory locks, so several application instances can share one database. Iceberg commits are implemented as a compare-and-swap of the metadata-location pointer within a transaction under a per-table lock. Concurrent commits from the same base therefore produce exactly one winner, and the others receive the protocol’s conflict response.</p><p><strong>SPARQL access.</strong> An embedded Ontop [3] virtual knowledge graph exposes the relational schema as RDF through a mapping and an ontology, and translates SPARQL 1.1 [10] queries into SQL. No data are replicated. A custom extension function, mtfn:jsonPathExists, is translated into PostgreSQL&#39;s jsonb_path_exists, so JSONPath predicates on entity values are evaluated by the database.</p><p><strong>Engine-facing catalogs.</strong> Two independent applications implement the Apache Iceberg REST catalog specification [4] and the Hive Metastore Thrift protocol [5] on top of the same core services. Iceberg namespaces, tables and schema versions, and Hive databases, tables and partitions, are stored as catalog entities. They are therefore subject to the same graph queries as user-defined entities.</p><p><strong>Security and verification.</strong> Authentication is pluggable (none, HTTP Basic, OAuth2/JWT with optional browser single sign-on, and LDAP). The application refuses to start without authentication when a protected deployment profile is active. The code base includes 346 automated tests that run against PostgreSQL via Testcontainers, with 55.2% instruction coverage, as well as a separately executed stress test of the mapping and provisioning machinery.</p><h3>5. Case study 1: a data mesh</h3><h4>5.1 Setup</h4><p>The first case study uses the data-product demonstration distributed with the repository. It runs the main application together with the Iceberg REST catalog and the Hive Metastore (make run-hive-demo), backed by an S3-compatible object store. Figure 11 relates the four data mesh principles to the constructs of Section 3. A data product is represented as an aggregate owned by its domain. Output ports are parts with schemas. The platform is represented by the registered provisioning tasks. Governance is represented by shared immutable traits and by one access policy per product.</p><p><em>Figure 11. Data mesh principles [1] and their representation in Meta Catalog.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VYS52so_CFbD4Pyf.png" /></figure><p>The platform defines two kinds of output port: one published as an Iceberg table and one published as a Parquet table registered in the Hive Metastore. Both port traits inherit ProvisionableResource, and the port types additionally carry AuthorizableResource:</p><pre>Traits:<br>  - name: IcebergTableOutputPort<br>    inheritsFrom: ProvisionableResource<br>  - name: HiveTableOutputPort<br>    inheritsFrom: ProvisionableResource</pre><pre>EntityTypes:<br>  - name: IcebergDataProductType<br>    traits: [Provisionable, Authorizable]<br>  - name: IcebergTableOutputPortType<br>    traits: [IcebergTableOutputPort, AuthorizableResource]<br>  - name: HiveTableOutputPortType<br>    traits: [HiveTableOutputPort, AuthorizableResource]</pre><p>The data product sales_analytics contains three Iceberg ports (customers, orders, order_items) and one Hive port (returns). Its policy declares four principals, two permissions and four grants (Figure 12). The grants use three selector forms: no selector (all ports), a value selector (name: customers) and an entity-type selector (HiveTableOutputPortType).</p><p><em>Figure 12. The </em><em>sales_analytics data product and the physical tables produced by provisioning.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vrM_aqe3Ze5yjX57.png" /></figure><h4>5.2 Results</h4><p><strong>Provisioning.</strong> A single provisioning request created three Iceberg tables in the namespace sales_analytics through the Iceberg REST protocol, and the database sales_analytics with the external table returns through the Hive Metastore Thrift interface. After creating each table, the task linked the port to the table entity that the respective catalog application had materialised (DEPENDS_ON). The following query, executed against the SPARQL endpoint, returns each port together with the type of the entity that fulfils it:</p><pre>PREFIX mt: &lt;http://metacatalog/&gt;</pre><pre>SELECT ?port ?fulfilledBy WHERE {<br>  ?dp    mt:hasEntityType/mt:name &quot;IcebergDataProductType&quot; ;<br>         mt:hasPart ?p .<br>  ?p     mt:values ?pv ;<br>         mt:dependsOn ?table .<br>  ?table mt:hasEntityType/mt:name ?fulfilledBy .<br>  BIND(REPLACE(?pv, &#39;^.*?&quot;name&quot;: &quot;([^&quot;]+)&quot;.*$&#39;, &#39;\\1&#39;) AS ?port)<br>}</pre><pre>port         fulfilledBy<br>customers    IcebergTable<br>orders       IcebergTable<br>order_items  IcebergTable<br>returns      HiveTable</pre><p><strong>Authorization.</strong> The authorization run resolved the policy into the per-port grants shown in Figure 13. The task recorded the result on the physical tables, as Iceberg table properties and Hive table parameters with identical keys. The properties of the Iceberg table customers, read back through the Iceberg REST protocol, were:</p><pre>{<br>  &quot;access.status&quot;: &quot;AUTHORIZED&quot;,<br>  &quot;access.granted-to&quot;: &quot;crm-analysts,sales-analysts,sales-etl&quot;,<br>  &quot;access.permissions&quot;: &quot;READ,WRITE&quot;,<br>  &quot;access.grants&quot;: &quot;crm-analysts=READ,sales-analysts=READ,sales-etl=READ|WRITE&quot;<br>}</pre><p>For the table orders, which the value selector does not match, crm-analysts was absent (access.granted-to: &quot;sales-analysts,sales-etl&quot;).</p><p><em>Figure 13. Effective grants per port, resolved from one policy declared on the aggregate root.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dsnWtlmlPwh1nDgd.png" /></figure><p><strong>Cross-catalog queries.</strong> Because the Iceberg catalog application stores each table schema as an entity with explicitly enumerated columns, schema-level questions can be answered across all registered tables. The query below returns the Iceberg tables that contain a column named customer_id; it returned orders and customers.</p><pre>PREFIX mt:   &lt;http://metacatalog/&gt;<br>PREFIX mtfn: &lt;http://metacatalog/fn#&gt;</pre><pre>SELECT ?table WHERE {<br>  ?t      mt:hasEntityType/mt:name &quot;IcebergTable&quot; ;<br>          mt:hasPart ?schema ;<br>          mt:values ?tv .<br>  ?schema mt:hasEntityType/mt:name &quot;IcebergTableSchema&quot; ;<br>          mt:values ?sv .<br>  FILTER(mtfn:jsonPathExists(?sv, &#39;$.columns[*] ? (@.name == &quot;customer_id&quot;)&#39;))<br>  BIND(REPLACE(?tv, &#39;^.*?&quot;name&quot;: &quot;([^&quot;]+)&quot;.*$&#39;, &#39;\\1&#39;) AS ?table)<br>}</pre><h3>6. Case study 2: a medallion lakehouse</h3><h4>6.1 Model</h4><p>The second case study was constructed for this article, using only the public API, to evaluate whether the same constructs express an architecture that partitions data by quality rather than by domain (Figure 14). The model and instance documents are available in the repository under <a href="https://github.com/dgreco/metacatalog/tree/main/examples/medallion">examples/medallion</a>.</p><p><em>Figure 14. The medallion architecture [2] as modelled in this case study.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*epWUpDW0-0nYd5mm.png" /></figure><p><strong>Per-layer contracts.</strong> Each layer imposes a different contract on its tables, expressed as one entity type per layer that shares a common Dataset trait (name, description and columns, where a column may be flagged as personal data). Bronze tables must declare their source system and ingestion mode (batch, streaming or cdc). Silver tables must declare a primary key and may declare quality expectations. Gold tables must declare a business owner.</p><pre>Traits:<br>  - name: LakehouseComponent<br>  - name: Dataset<br>    inheritsFrom: LakehouseComponent<br>    schema: { required: [name, columns], properties: { name, description, columns[] } }<br>Relationships:<br>  - { sourceTrait: LakehouseComponent, relationshipType: IS_REQUIRED_BY, targetTrait: LakehouseComponent }<br>EntityTypes:<br>  - name: BronzeTableType<br>    traits: [Aggregate, AggregateElement, Dataset]<br>    schema: { required: [sourceSystem, ingestion], ingestion: { enum: [batch, streaming, cdc] } }<br>  - name: SilverTableType<br>    traits: [Aggregate, AggregateElement, Dataset]<br>    schema: { required: [primaryKey], expectations: [string] }<br>  - name: GoldTableType<br>    traits: [Aggregate, AggregateElement, Dataset]<br>    schema: { required: [businessOwner], refresh: string }</pre><p><strong>Structure and lineage.</strong> The lakehouse acme_retail is an aggregate root (Provisionable, Authorizable). Its three parts are layer entities (BronzeLayerType, SilverLayerType, GoldLayerType), and each layer contains its tables. Lineage is expressed through dependsOn references, which become DEPENDS_ON links: silver tables depend on the corresponding bronze tables, and each gold table depends on two silver tables. Layers depend on their upstream layer. The instance comprises three layers and eight tables (Figure 15).</p><p><em>Figure 15. The logical model of the </em><em>acme_retail lakehouse. Arrows show the direction of data flow; they are stored as </em><em>DEPENDS_ON links from downstream to upstream.</em></p><p><strong>Derivation of physical resources.</strong> Six mappings derive the physical resources (Figure 16). Each layer is mapped to a LakeZoneType resource that holds a namespace (for example acme_retail_silver) and a storage prefix (s3://acme-lake/silver). The silver and gold layer mappings additionally reference the zone derived from their upstream layer, through the path IS_REQUIRED_BY{$}/MAPPED_TO{$}. Each table is mapped to a LakeTableType resource whose namespace and location are taken from its layer&#39;s zone, through the path HAS_PART{$}/MAPPED_TO{$}. Every derived resource also receives a constant layer attribute. According to Section 3.6, these references induce the resource-graph edges <em>table → zone</em> and <em>zone → upstream zone</em>.</p><p><em>Figure 16. Logical entities (left) and the physical resources derived from them by mappings (right).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DLpqTxv-TdYBbeEt.png" /></figure><p>Two modelling constraints shaped this design, and both are discussed in Section 7.2. First, a path reference must resolve to exactly one entity. Gold tables have two upstream tables, so provisioning order cannot be derived from table-level lineage; it is derived at the granularity of zones instead. Second, derived resources are collected for the lifecycle only from members that carry Aggregate, so the table types carry Aggregate in addition to AggregateElement. The output ports of the shipped demonstration follow the same pattern.</p><p><strong>Access policy.</strong> The policy declares four principals and four grants. Each grant selects resources through the layerattribute stamped by the mappings:</p><pre>grants:<br>  - { principals: [&quot;data-platform&quot;], permissions: [&quot;READ&quot;, &quot;WRITE&quot;] }<br>  - { principals: [&quot;ingest-bot&quot;], permissions: [&quot;WRITE&quot;], resources: { values: { layer: &quot;bronze&quot; } } }<br>  - { principals: [&quot;data-science&quot;], permissions: [&quot;READ&quot;], resources: { values: { layer: &quot;silver&quot; } } }<br>  - { principals: [&quot;data-science&quot;, &quot;analysts&quot;], permissions: [&quot;READ&quot;], resources: { values: { layer: &quot;gold&quot; } } }</pre><h4>6.2 Results</h4><p>The experiment was executed on a single workstation with the stack described in Section 5.1. The demonstration task registered for the two resource types records each operation in the application log instead of acting on external systems.</p><p><strong>Validation.</strong> Two invalid documents were submitted. The first contained a bronze table with an ingestion mode outside the enumeration; the second contained a silver table without a primary key. Both were rejected with HTTP 400 and the following messages:</p><pre>$.ingestion: does not have a value in the enumeration [&quot;batch&quot;, &quot;streaming&quot;, &quot;cdc&quot;]<br>$: required property &#39;primaryKey&#39; not found</pre><p>No lakehouse entity existed after either request, which confirms that aggregate documents are loaded atomically.</p><p><strong>Derivation.</strong> After the valid document was loaded, the mapping engine derived three zones and eight physical tables. Each table had the expected namespace and location (for example acme_retail_gold and s3://acme-lake/gold/daily_revenue), and the silver and gold zones carried readsFrom attributes naming their upstream namespaces.</p><p><strong>Lifecycle ordering.</strong> The provisioning run executed the eleven resources in four waves (Figure 17):</p><ol><li>the bronze zone;</li><li>the silver zone and the three bronze tables;</li><li>the gold zone and the three silver tables;</li><li>the two gold tables.</li></ol><p>Within each wave the tasks started concurrently. The unprovisioning run executed all eight tables first, then the gold, silver and bronze zones, in that order. Both orders agree with the resource graph defined in Section 3.6.</p><p><em>Figure 17. Observed execution order of provisioning (top) and unprovisioning (bottom).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*47VR6yQTXvDion-e.png" /></figure><p>The lifecycle operations are also available in the web interface for every aggregate root (Figure 18). Runs started there are asynchronous and report progress.</p><p><em>Figure 18. Lifecycle operations exposed in the web interface.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_KZKjaDtO37bTkRE.png" /></figure><p><strong>Authorization.</strong> The authorization run produced the effective grants summarised in Figure 19. The application log records the following grants for the three zones; each table carries the same grants as the zone of its layer:</p><pre>bronze zone  data-platform(GROUP)=[READ, WRITE], ingest-bot(SERVICE)=[WRITE]<br>silver zone  data-platform(GROUP)=[READ, WRITE], data-science(GROUP)=[READ]<br>gold zone    analysts(GROUP)=[READ], data-platform(GROUP)=[READ, WRITE], data-science(GROUP)=[READ]</pre><p><em>Figure 19. Effective grants per layer. The selector matches the </em><em>layer attribute that the mappings stamp on every zone and table.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ci_dZ05359qX0s7W.png" /></figure><p><strong>Graph queries.</strong> Three queries were evaluated against the SPARQL endpoint.</p><p>The first query is an impact analysis. It returns the gold tables that lie two DEPENDS_ON hops downstream of the bronze table orders_raw. The result was daily_revenue and customer_lifetime_value (Figure 20).</p><pre>PREFIX mt:   &lt;http://metacatalog/&gt;<br>PREFIX mtfn: &lt;http://metacatalog/fn#&gt;</pre><pre>SELECT ?gold WHERE {<br>  ?raw mt:values ?rv .<br>  FILTER(mtfn:jsonPathExists(?rv, &#39;$ ? (@.name == &quot;orders_raw&quot;)&#39;))<br>  ?g   mt:dependsOn/mt:dependsOn ?raw ;<br>       mt:hasEntityType/mt:name &quot;GoldTableType&quot; ;<br>       mt:values ?gv .<br>  BIND(REPLACE(?gv, &#39;^.*?&quot;name&quot;: &quot;([^&quot;]+)&quot;.*$&#39;, &#39;\\1&#39;) AS ?gold)<br>}</pre><p><em>Figure 20. Execution of the impact-analysis query in the embedded SPARQL editor.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tf7U_izQatKH0nVL.png" /></figure><p>The second query identifies tables with at least one column flagged as personal data ($.columns[*] ? (@.pii == true)). It returned the bronze table customers_raw and the silver table customers.</p><p>The third query returns the physical tables for which the group analysts holds a grant ($.effectiveGrants[*] ? (@.principal.id == &quot;analysts&quot;)). It returned the two gold tables in acme_retail_gold.</p><h3>7. Discussion</h3><h4>7.1 Composition of the two architectures</h4><p>The two case studies use the same constructs and differ only in how they are arranged. Because data mesh partitions by domain and the medallion architecture partitions by quality, the two can be combined (Figure 21). Each domain’s data product is an aggregate whose intermediate parts are layers, and only the gold layer is exposed to other domains, through grants that select it. No additional mechanism is required for this composition.</p><p><em>Figure 21. Combination of the two architectures: layered data products within a data mesh.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V4YSiwnag0RYQaY1.png" /></figure><h4>7.2 Limitations and threats to validity</h4><p>The evaluation surfaced the following limitations.</p><p><strong>Derived resources of leaves.</strong> When an aggregate is read for a lifecycle run, derived entities are collected only from members that carry Aggregate. Resources derived from pure leaves are therefore not provisioned and do not appear in the access report, although they are removed when the aggregate is deleted. The case study avoided the limitation by making the tables intermediates.</p><p><strong>Unrestricted containment.</strong> The single built-in sanction Aggregate HAS_PART AggregateElement permits any element type within any aggregate. The model alone cannot express, for instance, that a bronze layer may contain only bronze tables. The generated authoring form accordingly offers every element type known to the catalog.</p><p><strong>Uniqueness of path references.</strong> A path reference must resolve to exactly one entity, and the resource graph is derived from path references only. Dependencies on a variable number of upstream resources therefore cannot drive lifecycle ordering. In the medallion case study, ordering was expressed at the level of zones, while table-level lineage remains available for queries.</p><p><strong>Typing of derived values.</strong> Mapping results are validated as strings. Derived resources consequently cannot carry structured values such as column lists.</p><p><strong>SPARQL expressiveness.</strong> In the configuration used, queries with arbitrary-length property paths (for example mt:dependsOn+) failed, so lineage queries were formulated with fixed-length paths. Entity values are exposed as JSON text. Projecting individual fields therefore requires string functions, while filtering is pushed down to the database through the extension function.</p><p><strong>Enforcement.</strong> Meta Catalog administers policies but does not enforce them. In the data mesh case study, access decisions were recorded as table properties rather than enforced by a query engine. In the medallion case study, the registered task logged the operations instead of executing them. The ordering, derivation and policy-resolution results are independent of the task implementation; the effects on external systems are not covered by this evaluation.</p><p><strong>Defect found during evaluation.</strong> The medallion case study revealed a defect in the aggregate loader: of several dependsOn references on one node, only the last one was linked. A regression test was added, and the results reported here were obtained with the corrected loader.</p><p><strong>Scope.</strong> All measurements were taken on a single node with a single application instance. No performance figures are reported.</p><h3>8. Conclusion</h3><p>Meta Catalog treats a user-defined metadata model as the authoritative specification of a data platform. It derives physical resources from logical ones through mappings, executes provisioning and authorization over dependency graphs inferred from those mappings, and makes the resulting state, including tables created by external engines, available through standard catalog protocols and SPARQL. The two case studies show that the same small set of constructs (traits, entity types, relationships, mappings and aggregates) expresses both a domain-oriented data mesh and a quality-oriented medallion lakehouse, and their combination.</p><p>Future work includes collecting derived resources from all aggregate members, constraining containment beyond the built-in roles, supporting dependencies on multiple upstream resources in the resource graph, and evaluating the system with multiple instances and at scale.</p><p><strong>Availability.</strong> Meta Catalog is available under the Apache License 2.0 at <a href="https://github.com/dgreco/metacatalog">github.com/dgreco/metacatalog</a>. The data mesh case study can be reproduced with make run-hive-demo. The medallion case study is available under <a href="https://github.com/dgreco/metacatalog/tree/main/examples/medallion">examples/medallion</a>, together with the instructions to run it on top of the same stack.</p><h3>References</h3><p>[1] Z. Dehghani, “Data Mesh Principles and Logical Architecture,” martinfowler.com, 3 December 2020. <a href="https://martinfowler.com/articles/data-mesh-principles.html">https://martinfowler.com/articles/data-mesh-principles.html</a></p><p>[2] Databricks, “What is a Medallion Architecture?” <a href="https://www.databricks.com/glossary/medallion-architecture">https://www.databricks.com/glossary/medallion-architecture</a></p><p>[3] Ontop: A Virtual Knowledge Graph System. Free University of Bozen-Bolzano. <a href="https://ontop-vkg.org/">https://ontop-vkg.org</a></p><p>[4] Apache Iceberg, “REST Catalog Specification.” <a href="https://iceberg.apache.org/rest-catalog-spec/">https://iceberg.apache.org/rest-catalog-spec/</a></p><p>[5] Apache Hive. <a href="https://hive.apache.org/">https://hive.apache.org</a></p><p>[6] The Scala Language Specification, Chapter 5, “Classes and Objects,” section “Class Linearization.” <a href="https://www.scala-lang.org/files/archive/spec/2.13/05-classes-and-objects.html">https://www.scala-lang.org/files/archive/spec/2.13/05-classes-and-objects.html</a></p><p>[7] JSON Schema. <a href="https://json-schema.org/">https://json-schema.org</a></p><p>[8] Apache Ranger. <a href="https://ranger.apache.org/">https://ranger.apache.org</a></p><p>[9] Spring Framework Reference, “Spring Expression Language (SpEL).” <a href="https://docs.spring.io/spring-framework/reference/core/expressions.html">https://docs.spring.io/spring-framework/reference/core/expressions.html</a></p><p>[10] W3C, “SPARQL 1.1 Query Language,” W3C Recommendation, 21 March 2013. <a href="https://www.w3.org/TR/sparql11-query/">https://www.w3.org/TR/sparql11-query/</a></p><p>[11] V. De Leo et al., “Ontology-Based Generation of Data Platform Assets,” in 2023 IEEE International Conference on Big Data (BigData), Sorrento, Italy, 2023, pp. 2937–2941, doi: 10.1109/BigData59044.2023.10386910. url: <a href="https://doi.ieeecomputersociety.org/10.1109/BigData59044.2023.10386910">https://doi.ieeecomputersociety.org/10.1109/BigData59044.2023.10386910</a></p><p>[12] Greco, D., Osborne, F., Pusceddu, S. et al. Modelling big data platforms as knowledge graphs: the data platform shaper. J Big Data 12, 64 (2025). <a href="https://doi.org/10.1186/s40537-025-01094-w">https://doi.org/10.1186/s40537-025-01094-w</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4b5e70392e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modeling a data platform with Data Platform Shaper]]></title>
            <link>https://medium.com/agile-lab-engineering/modeling-a-data-platform-with-data-platform-shaper-a2896313ccc9?source=rss-d23f361cb483------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2896313ccc9</guid>
            <category><![CDATA[data-platforms]]></category>
            <category><![CDATA[data-mesh]]></category>
            <dc:creator><![CDATA[David Greco]]></dc:creator>
            <pubDate>Thu, 26 Sep 2024 16:07:33 GMT</pubDate>
            <atom:updated>2024-09-26T16:07:33.439Z</atom:updated>
            <content:encoded><![CDATA[<h3>Modeling a data platform</h3><p>In a previous post, we presented our research project, Data Platform Shaper (DPS), which we used as a laboratory to investigate new ideas around flexible metadata catalogs. We tried to make DPS as flexible and expressive as possible during our investigation. A sound data platform design process that aims to introduce good engineering practices drives DPS development; this process could be quickly summarized in the following phases, as outlined in the previous post:</p><ol><li>Gathering user requirements.</li><li>User requirements analysis and logical model definition.</li><li>Defining the logical assets inside the catalog.</li><li>The compilation/transformation rules define the corresponding physical assets inside the catalog.</li><li>Defining the provisioning tasks for deploying physical assets on the target technologies.</li></ol><p>This post shows a new DPS feature that allows us to better adhere to the above process.</p><p>Let’s suppose we want to build a data mesh so that after the process phases above, we would come up with the following overall model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*jEr7FwPtKMGvCpeZyyEyAA.png" /><figcaption>The data mesh model</figcaption></figure><p>The figure above is a pictorial representation of a data mesh across different models.</p><p>The conceptual model defines the kind of assets a data mesh contains and their possible relationships. So, in the figure, the conceptual model includes the following assets:</p><ol><li><em>DataProduct</em> is the fundamental asset in a data mesh, which can be considered a collection of connected data products. For the sake of simplicity, in our example, a <em>DataProduct</em> contains a list of <em>OutputPort</em>.</li><li>OutputPort with its variants: <em>FileBasedOutputPort</em> and <em>TableBasedOutputPort</em>.</li><li><em>FileBasedOutputPort</em> conceptually models a data collection stored as a collection of files stored somewhere.</li><li><em>TableBasedOutputPort</em> conceptually models a data collection exposed as an SQL table.</li></ol><p>In DPS, the conceptual model can be expressed in terms of traits and their relationships. So, we can create a corresponding trait for each asset above.</p><p>Once the assets/traits are defined, we must determine their relationships.</p><p>A <em>DataProduct</em> has a <em>hasPart</em> (with its opposite <em>partOf</em>) relationship with <em>OutputPort, which models</em> that a data product contains a list of output ports.</p><p>A <em>TableBasedOutputPort</em> has a <em>dependsOn </em>relationship with a <em>FileBasedOutputPort</em>. This relationship models the typical situation where the computational layer, i.e., a SQL engine, is separated from the storage layer, i.e., object storage. In this context, we model it in such a way that a table is mapped on top of a collection of stored files using a specialized SQL engine.</p><p>Now, we can move to the logical model. We must define the actual types with their attributes, making the <em>abstract </em>concept described in the conceptual model concrete.</p><p>In DPS, the logical model is defined in terms of types associated with specific traits to determine their nature and behavior.</p><p>In this case, it’s pretty simple; we define the following types:</p><ol><li><em>DataProductType</em> is a type with a <em>hasTrait</em> relationship with the <em>DataProduct </em>trait. It’s a concrete type with the attributes <em>name </em>and <em>domain.</em></li><li><em>FileBasedOutputPortType </em>is a type with a <em>hasTrait </em>relationship with the trait <em>FileBasedOutputPort</em>. It’s a concrete type with the attribute <em>name.</em></li><li><em>TableBasedOutputPortType </em>is a type with a <em>hasTrait </em>relationship with the trait <em>TableBasedOutputPort</em>. It’s a concrete type with the attribute <em>name.</em></li></ol><p>In DPS, the relationships are automatically inherited from the traits, so we don’t need to define them explicitly in the logical model.</p><p>Once we define the logical model, we need to determine the physical model. The physical model represents how the data platform assets are implemented with a specific technology. In DPS, we defined a special relationship <em>mappedTo</em> to describe this mapping type.</p><p>For example, a <em>FileBasedOutputPortType</em> needs a place to store its files, so if the target technology is AWS, we could define a type <em>S3FolderType</em> with an attribute <em>path</em> and associate the <em>FileBasedOutputPortType </em>with <em>S3FolderType</em> with the special relationship <em>mappedTo.</em></p><p>Similarly, a <em>TableBasedOutputPortType</em> needs an SQL engine capable of creating a table on top of stored files; in the AWS ecosystem, we could choose <a href="https://aws.amazon.com/athena">Athena</a> and create a specific type <em>AthenaTableType </em>with three attributes: <em>dataPath</em>, <em>database</em>, and <em>table. </em>Then, we can map <em>TableBasedOutputPortType </em>to<em> AthenaTableType</em> with the <em>mappedTo </em>relationship.</p><h3>The <em>mapping mechanism</em></h3><p>In DPS, the <em>mappedTo </em>relationship is associated with the mapping feature. First of all, the <em>mappedTo</em> relationship is a ternary relationship with the following structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*t6sfT2yMvB_9d0kEphn0vw.png" /><figcaption>The <em>mappedTo</em> relationship</figcaption></figure><p>A <em>SourceType </em>is mapped to a <em>TargetType, </em>which means that every time we create an instance of the <em>SourceType, </em>an instance of <em>TargetType </em>is automatically created and linked to the source instance by a <em>mappedTo</em> relationship.</p><h4>The mapper</h4><p>The <em>mapper </em>is a particular instance of the TargetType where its attributes contain expressions used by DPS to compute the attribute values of the target instance. During the mapping evaluation, DPS injects a reference of the source instance into the expression engine, so it’s possible to define the mapper expressions in terms of the values of the source instance attributes. Additionally, DPS is also able to inject any reference to instances that can be reached from the source instance. In this way, it’s also possible to compute attribute values, taking into account the surrounding instances.</p><p>In our example, the mapper associated with the <em>mappedTo</em> relationship between <em>FileBasedOutputPortType </em>and <em>S3FolderType</em> contains only one expression attribute:</p><blockquote>path: “dataproduct.get(‘domain’) += ‘/’ += dataproduct.get(‘name’)”</blockquote><p>In the expression above, <em>dataproduct</em> is an alias for the instance of <em>DataProductType </em>that can be reached through this path:</p><blockquote>source/partOf/DataProductType</blockquote><p>where <em>source</em> is the source instance in the mapping (an instance of <em>FileBasedOutputPortType). </em>This expression simply computes the folder path as &lt;dataproduct_domain&gt;/&lt;data_product_name&gt;.</p><p>The other mapper associated with the <em>mappedTo</em> relationship between <em>TableBasedOutputPortType </em>and <em>AthenaTableType</em> contains three expression attributes:</p><blockquote>table: “source.get(‘name’)”</blockquote><p>The table name is simply the name of the <em>TableBasedOutputPortType.</em></p><blockquote>database: “dataproduct.get(‘domain’) += ‘.’ += dataproduct.get(‘name’)”</blockquote><p>The database name is defined as &lt;dataproduct_domain&gt;.&lt;data_product_name&gt;.</p><blockquote>dataPath: “s3folder.get(‘path’) += ‘/’ += ‘outputport’ += ‘/’ += source.get(‘name’)”</blockquote><p>The data path, where the table files are stored, is defined as &lt;s3_folder_path&gt;/outputport/&lt;outputport_name&gt;. Where <em>s3folder</em> is an alias for the instance at the path:</p><blockquote>source/dependsOn/FileBasedOutputPortType/mappedTo/S3FolderType</blockquote><p>That path shows the usage of the <em>dependsOn</em> relationship. In our example, an instance of <em>TableBasedOutputPortType </em>depends on an instance of <em>FileBasedOutputPortType</em> since its attributes can only be derived from the attribute values the instance depends on.</p><p>The full example, particularly the file <a href="https://github.com/agile-lab-dev/data-platform-shaper/blob/main/examples/datamesh/simple/DataPlatformShape.yaml">DataPlatformShape.yaml</a>, contains all the DPS definitions for creating the model above, and it can be found in the project directory <a href="https://github.com/agile-lab-dev/data-platform-shaper/tree/main/examples/datamesh/simple">https://github.com/agile-lab-dev/data-platform-shaper/tree/main/examples/datamesh/simple</a>.</p><h3>Conclusion</h3><p>Data Platform Shaper has been a fantastic project in which we had the opportunity to experiment with new ideas. Most of those ideas have been gradually incorporated into my company&#39;s flagship product, <a href="https://www.witboost.com/">Witboost</a>.</p><p>We got excellent feedback from the scientific community with our paper and from the Witboost development team; for us, this is an essential confirmation that a modern data platform can be effectively managed only by adopting a flexible metadata catalog capable of modeling the complexity of all the assets it’s based upon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2896313ccc9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/agile-lab-engineering/modeling-a-data-platform-with-data-platform-shaper-a2896313ccc9">Modeling a data platform with Data Platform Shaper</a> was originally published in <a href="https://medium.com/agile-lab-engineering">Agile Lab Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Platform Shaper: an advanced catalog for managing data platform assets]]></title>
            <link>https://medium.com/agile-lab-engineering/data-platform-shaper-an-advanced-catalog-for-managing-data-platform-assets-f44351fae213?source=rss-d23f361cb483------2</link>
            <guid isPermaLink="false">https://medium.com/p/f44351fae213</guid>
            <dc:creator><![CDATA[David Greco]]></dc:creator>
            <pubDate>Fri, 09 Feb 2024 15:12:36 GMT</pubDate>
            <atom:updated>2024-04-18T15:45:50.120Z</atom:updated>
            <content:encoded><![CDATA[<h3>A data platform is a patchwork of many technologies</h3><p>A modern data platform is a complex patchwork of different technologies that must be integrated to offer an adequate user experience. Very broadly, a data platform is built on top of a layered architecture, where each layer plays a specific role:</p><ol><li>Storage Layer</li><li>Computational Layer</li><li>Governance Layer</li></ol><h4>Storage Layer</h4><p>This layer contains all the platforms offering ways for storing data; most of the time, this layer includes just an object storage platform. But in a more complex situation, this layer could consist of highly specialized platforms like columnar databases, knowledge/property graphs, etc.</p><h4>Computational Layer</h4><p>This layer contains all the platforms offering ways to transform, query, and analyze data. We could put into this layer platforms like <a href="https://spark.apache.org/">Spark</a>, <a href="https://flink.apache.org/">Flink</a>, <a href="https://www.dask.org/">Dask</a>, <a href="https://trino.io/">Trino</a>, etc. There are plenty of platforms for digesting data out there.</p><h4>Governance Layer</h4><p>This layer is supposed to contain all the platforms needed for managing the data from different perspectives: security and quality — control, metadata management, etc. We could put catalogs, identity management systems, and access control engines in this layer.</p><h3>The complexity of designing a data platform</h3><p>As you can imagine, putting all those pieces together is a complex task, especially if you want to provide an excellent user experience to the platform users. For example, users should be able to explore the available data and their meaning; they should provided with simple-to-use tools for data manipulation and querying. Power users should be able to access the computational platforms to implement more sophisticated analyses like training machine learning models. On top of this, everything should be tracked and audited to support regulator compliances like GDPR.</p><p>Designing and implementing a data platform is a complex application integration task. Unfortunately, tackling the task is too often tactical, based on a brute force approach to integrating technologies, like starting from technology first and then adapting the platform requirements to the platform’s specifics. In general, the design of data platforms often lacks an adequate level of abstraction that could make them more resilient to technological changes, like the evolution of the adopted technologies or simply adding a new one.</p><p>Another problem commonly affecting data platforms is the need for more automation; too many tasks are manually managed, and onboarding new data, changing ownership, or making the data available to someone else is typically manual. Monitoring and rechecking data quality need more automation. This general lack of automation dramatically decreases the data platform&#39;s productivity, and the data platform team needs to catch up in giving data and hints to the business.</p><p>What could be a possible strategy for mitigating all those problems?</p><h3>A data platform as a set of managed assets</h3><p>The root problem is that the architect doesn’t introduce the right level of abstraction at design time, casting the data platform architecture on a specific set of technologies, and the user requirements are forced to be adapted to the actual features provided by the target technologies.</p><p>Data engineering, as any software engineering practice, should always start from the business/user requirements and, after the analysis process, define a logical model capable of catching what the user has in mind.</p><p>The logical model of a data platform is primarily focused on how the data is collected and managed. It mainly describes the data containers. So, a data platform is a collection of managed assets used collectively for storing and managing data.</p><p>A list of possible managed assets could be:</p><ul><li>Data Collection: a generic container of data; it could be a filesystem or an object storage folder containing files. It could also be a RDBMS table.</li><li>Data Product: if our platform follows the data mesh socio-architectural pattern, the main managed asset is a data product.</li><li>Data Transformation Pipeline: a sequence of data transformation steps.</li></ul><p>All these assets should be defined without targeting any specific technology. The logical model should describe them in terms of metadata, i.e., a list of properties that the user thinks better qualify them for his purposes.</p><h3>The data platform catalog</h3><p>All the data platform-managed assets and their definitions must be stored in a flexible catalog. This catalog should support our simple design process:</p><ol><li>User requirements gathering.</li><li>Analysis and logical model defined.</li><li>Definition of the logical assets inside the catalog.</li><li>The compilation/transformation rules define the corresponding physical assets inside the catalog.</li><li>Definition of the provisioning tasks for deploying the physical assets on the target technologies.</li></ol><p>The picture below shows the process and the role that the catalog plays.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*oluSFlE29gl_XHw2bzZWKw.png" /></figure><p>A catalog able to support this approach should be able to:</p><ul><li>Allow users to define types together with a schema.</li><li>Mark a user-defined type with “traits” to describe its kind and behavior.</li><li>Strict separation between the shape/form of a type and the relationships among each other. In a data platform, the managed assets are mainly characterized by their relationships.</li></ul><h3>Data Platform Shaper</h3><p>The Data Platform Shaper is a highly configurable catalog conceived to support the design of complex data platforms in a technologically agnostic approach.</p><p>Our first implementation is based on <a href="https://www.w3.org/RDF/">RDF</a> technologies with the support of a knowledge graph, either <a href="https://graphdb.ontotext.com/">graphdb</a> or <a href="https://virtuoso.openlinksw.com/">virtuoso</a>; in general any knowledge graph supporting <a href="https://rdf4j.org/">rdf4j</a> can be used.</p><p>We designed our catalog system based on an ontology structured into four layers (L0, L1, L2, L3):</p><ul><li>L0 provides the mechanism for creating user-defined types.</li><li>All the types will be defined in L2, which is used as a container for all the possible user-defined<br>types.</li><li>Each user-defined type is associated with a name and a schema:<br>* A schema is a list of pair names/types.<br>* A type can also be structured like a list, structure, or option (optional attribute). It supports an arbitrary level of nesting.</li><li>L1 describes all the traits corresponding to the asset kinds:<br>* A trait can be used to represent the behavior of a user-defined type.<br>* L1 defines all the possible structural relationships among traits.<br>* These will be automatically inherited by all the instances implementing those traits.</li><li>L3 contains all the user-defined type instances.</li></ul><p>The prototype is available with an Apache 2 open-source license on GitHub at <a href="https://github.com/agile-lab-dev/data-platform-shaper.git">https://github.com/agile-lab-dev/data-platform-shaper</a>.</p><p>It’s a micro-service exposing REST APIs for creating traits, relationships among them, user-defined types with their schema, and user-defined types instances. The README file provides some examples for getting the flavor of this system, and the documentation provides additional examples and describes the internal behavior and APIs.</p><p>Through an example, we show how it works.</p><h4>L0: the basic machinery</h4><p>The L0 ontology layer provides the mechanisms for defining a user-defined type together with a schema:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wDmHJKzMVeVPJH0nTk6U1g.png" /></figure><p>A user-defined type is an instance of EntityType; an EntityType can be associated with one or more Traits. An EntityType is associated with AttributeType, and an AttributeType can be StringType, IntType, LongType, etc. We support all the typical basic types, including date and timestamp.</p><p>A particular attribute type is StrcutType; a StructType could contain other attribute types; this is the mechanism allowing arbitrary nesting levels.</p><p>The Mode entity is an enumeration: Nullable, Repeated, Required; the meaning is obvious. An attribute can be optional, repeated (a list of values), or mandatory.</p><p>Using the L0 entities and their relationships, it’s possible to define complex nested schemas and associate them with the user-defined types.</p><h4>L1: Traits and Relationships</h4><p>This layer contains a predefined list of possible relationships among Traits. Currently, we provide the <em>hasPart</em> relationship, for example, in this picture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29IcUiZZyxf1AgWMh8is6A.png" /></figure><p>The trait DataCollection is linked to the trait TableSchema through the <em>hasPart</em> relationship.</p><h4>L2: User-defined Types</h4><p>Suppose we describe a managed asset called DataCollectionType, which represents a generic data collection. To mark this user-defined type as a data collection, we must associate it with the trait DataCollection defined for representing this concept.</p><p>A user-defined type is built by assembling a name, a schema, and a list of traits. We provide a REST API that accepts a YAML document representing a user-defined type definition:</p><pre>name: DataCollectionType <br>traits:<br>- DataCollection<br>schema:<br>- name: name<br>  typeName: String<br>  mode: Required<br>- name: organization<br>  typeName: String <br>  mode: Required<br>- name: domain <br>  typeName: String <br>  mode: Required</pre><p>This definition generates the following graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iOqNrr9bHzt5DUlQ3cuuXg.png" /></figure><p>Let’s see a more complex example:</p><pre>name: TableSchemaType <br>traits:<br>- TableSchema<br>schema:<br>- name: tableName <br>  typeName: String <br>  mode: Required<br>- name: columns <br>  typeName: Struct <br>  mode: Repeated <br>  attributeTypes:<br>    - name: columnName <br>      typeName: String <br>      mode: Required<br>    - name: columnType <br>      typeName: String <br>      mode: Required</pre><p>This example shows a repeated struct, columns, containing two attributes. This definition produces the following graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xnp1L8ZgXvhxPdPvmMG0BQ.png" /></figure><h4>L3: User-defined Types Instances</h4><p>Now that we have the user-defined types defined, we can create instances of them. For example, the system provides a REST API accepting a YAML document for instance creation.</p><p>Let’s create an instance for the DataCollectionType user-defined type:</p><pre>entityTypeName: DataCollectionType <br>values:<br>  name: Person <br>  domain: Registrations <br>  organization: HR</pre><p>And the corresponding graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*iY223q478eTf-21vaMvE5w.png" /></figure><p>Now, let’s create an instance of TableSchemaType user-defined type:</p><pre>entityTypeName: TableSchemaType <br>values:<br>name: Person<br>columns:<br>- columnName: firstName<br>  columnType: String<br>- columnName: familyName<br>  columnType: String <br>- columnName: age<br>  columnType: Int</pre><p>And the corresponding graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQCGecn8Ljk0CIa-v3n15w.png" /></figure><h4>L3: Linking instances</h4><p>An interesting property of the system is that if a specific relationship links two traits, then all the instances of the user-defined types associated with those traits can be linked with the same relationship.</p><p>This property is mandatory, i.e., two instances can be linked through a relationship R if and only if the two types T1 and T2 of the two instances are associated with two traits, TR1 and TR, linked by R.</p><p>In our example, since the traits DataCollection and TableSchema are linked with the <em>hasPart</em> relationship, then any instances of types associated with those traits can be linked with the same relationship.</p><p>This graph shows the link between an instance of DataCollectionType and an instance of TableSchemaType:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AYUt34LOvbtN804QdNmXJA.png" /></figure><h3>Next Steps</h3><p>We are considering adding a validation mechanism to the system. We want the user to define constraints on the possible values for the instance attributes. We are considering different possibilities, such as integration with <a href="https://cuelang.org/">CUE</a> or <a href="https://www.w3.org/TR/shacl/">SHACL</a>.</p><h3>Conclusions</h3><p>We presented Data Platform Shaper, a flexible catalog aiming to contain all the information around the managed assets composing a modern data platform. It’s a work in progress, and our idea is to extend it to incorporate new ideas for supporting the process of designing and implementing a modern data platform, starting from a pure and technologically agnostic model toward the physical model, where the logical assets are mapped on their physical counterparts.</p><p>We presented our ideas to the Big Data community at the 2023 IEEE International Conference on Big Data, and we got our <a href="https://www.computer.org/csdl/proceedings-article/bigdata/2023/10386910/1TUOZNsY3Ru">paper published</a>.</p><h3>Credits</h3><p>This project is the result of the collaborative effort of an amazing team:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d28363ad1cc924e44a46cdb15ddff2a0/href">https://medium.com/media/d28363ad1cc924e44a46cdb15ddff2a0/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f44351fae213" width="1" height="1" alt=""><hr><p><a href="https://medium.com/agile-lab-engineering/data-platform-shaper-an-advanced-catalog-for-managing-data-platform-assets-f44351fae213">Data Platform Shaper: an advanced catalog for managing data platform assets</a> was originally published in <a href="https://medium.com/agile-lab-engineering">Agile Lab Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>