2024-11-03: Code Is Flowing
We could live in that waterfall.
I just started a new conversation with ChatGPT. In response to its “What can I help with?”, I gave a rather impersonal message: “blog update about my semantic flow cli.” Usually I’m a bit friendlier.
Without my asking, it filled a canvas with a suggested update that I hated before even looking at it. Then I tried to read it and started finding falsehoods and lameness everywhere.
Yes, I’m hostile to synthetic prose. But ChatGPT at least gave me a skeleton and the motivational annoyance to get things going. So for experiment’s sake, the meat of this update is going to be a rewrite of ChatGPT’s intolerable draft.
I’ll admit though... I’m curious to hear its feedback. Maybe I’ll post it in the comments.
To my four subscribers and posterity:
I’m reluctantly sharing an update about the Semantic Flow CLI I’ve been bumbling through. At the moment, this under-designed command-line tool will set up a folder hierarchy and a configuration file for a semantic site “root” repository, the foundation of the Semantic Flow RDF versioning and self-publishing methodology. I’m excited to be in the flow with an actual piece of software, I’m eager to get back to it, and the kids need breakfast. So I’ll try to make this quick.
Semantic Flow CLI: Key Features
Reference Pages for De-referenceable entity IRIs
You may know that Semantic Web data is composed of triples that link together resources. The subject is the resource being described. The predicate is a property resource that defines the relationship. And an object is another resource that is related to the subject.
For two examples:
:the-old-man-in-the-cave :helped :goldsmith .
You may also know that an IRI is a URL that supports international characters and doesn’t necessarily locate a web page, although it should. IRIs are how resources are identified (or uniquely named, if you prefer) on the Semantic Web.
The above examples use namespacing to hide the full IRI, which otherwise might look something like this:
<https://djradon.github.io/the-old-man-in-the-cave> <https://djradon.github.io/ns/d/helped> <https://djradon.github.io/ns/d/goldsmith> .
From the W3c’s RDF 1.1 Concepts and Abstract Syntax recommendation: “Any IRI or literal denotes something in the world (the "universe of discourse"). These things are called resources. Anything can be a resource, including physical things, documents, abstract concepts, numbers and strings; the term is synonymous with "entity" as it is used in the RDF Semantics specification. The resource denoted by an IRI is called its referent...” and “The IRI owner can establish the intended referent by means of a specification or other document that explains what is denoted... A good way of communicating the intended referent is to set up the IRI so that it dereferences to such a document.”
Semantic Flow can generate these documents. I’m calling them reference pages.
Namespace and IRI curation
Semantic Flow is about publishing RDF data, and useful RDF resources need a namespace, a place where their identifiers can live and be made legible. I’d like to be able to create git repositories of semantic data that can define and populate namespaces in a Semantic Flow site with a single deft command, or at worst a series of prompts.
Dataset Series Handling
The central conceit of Semantic Flow is that every entity worth its salt should be associated with at least two sets of versioned datasets: a catalog series and a default series. Grouping dataset versions into a series is the heart of Semantic Flow, and the CLI will help automate version bumps at the entity level. When changes are made to entity data (in the default series or otherwise), sf-cli can update the corresponding catalog automatically.
Template Integration
When generating the HTML reference pages, you should be able to apply one or more templates to effectively convey information visually and make the pages usable.
Tech Stack
I’m building the CLI using Deno, which has been a frustrating experience so far, no fault of Deno’s. Eventually, Deno’s ability to run untrusted remote code in a hopefully-secure way might be a great foundation for composable, interactive alternate realities.
I’m using prdct.cliffy (Private) for the command-line framework although I keep glancing at Oclif and Inquirer.js.
Challenges
From smallest to biggest:
-
Dealing with Cliffy and Deno release candidate compatibility has been tricky.
-
The CLI only has one command so far and it’s already a ball of razors in need of decomposition.
-
Immutability holds a great deal of promise for data management. See XTDB’s walkthrough for some insight. But I’m doing a lot of mental hand-waving right now: Will entity references in Semantic Flow-compatible RDF data have to specify the version they’re referring to? Or can some kind of software reasoner figure it out based on context?
What’s Next?
- importing existing Data Repos into a Root Repo
- scanning Data Repos for covered IRIs and minting some primitive Reference Pages
- SFLO Ontology with classes and properties to support this whole effort
- docs with clarifying examples
I’m expecting to get a beta version out... no time soon. ChatGPT has been a valuable, tireless coding partner, but I could use more than its credulous efforts to get things flowing. So please reach out if you’re a javascript code reviewer or seasoned ontologist.