Domain Driven Design

25 views
Skip to first unread message

Michael DeBellis

unread,
Apr 15, 2026, 11:35:28 PM (6 days ago) Apr 15
to ontolog-forum
Has anyone tried using OWL and SHACL for Domain Driven Design (DDD)? DDD is the most common method for designing microservices. It is also used for Data Mesh and Data Products. Dehgani describes DDD as essentially the method for Data Mesh and Data Products. I just started reading the original DDD book by Eric Evans and it is fascinating. He describes how we need to model concepts and knowledge not code. As with Dehgani's book (also Strengholt's book on Enterprise Data and Ole Olesen-Bagneux's Data Catalog book), everything they describe screams out for semantic languages, query engines, transformations, graph databases and reasoners like OWL, SHACL, and SPARQL. Yet, the only one to actually discuss OWL and knowledge graphs is Strengholt. 

Michael

Paul Tyson

unread,
Apr 16, 2026, 12:15:16 AM (6 days ago) Apr 16
to ontolo...@googlegroups.com

Well, substituting "RDFS+" for "OWL", and "RIF" for "SHACL", and omitting all the buzzwords, I think I might have done something like that. My task was to reconcile 3 (or 4, or 5) disparate PLM systems. Of course you need semantic languages. Lift the native data to RDF (R2RML, anyone?), write business rules in RIF using the RDF terms, and put it all in motion however you like for whatever ends you have.

OWL has quickly diminishing returns in my experience. I got along fine with RDFS + a few OWL features (enumerations, ad-hoc classes).

I thought RIF was complicated until I got down & dirty with SHACL. SHACL is an unfortunately useful standard in the RDF/SPARQL ecosystem, but industrial-strength solutions require RIF. What's missing in the standards is RIF-SPARQL harmonization. I made do with a rough-n-ready RIF2SPARQL transformation.

Regards,
--Paul

--
All contributions to this forum are covered by an open-source license.
For information about the wiki, the license, and how to subscribe or
unsubscribe to the forum, see http://ontologforum.org/info
---
You received this message because you are subscribed to the Google Groups "ontolog-forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontolog-foru...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ontolog-forum/34e06831-867d-46b2-a8b3-72f4d8dd6292n%40googlegroups.com.

Michael DeBellis

unread,
Apr 16, 2026, 12:34:29 AM (6 days ago) Apr 16
to ontolo...@googlegroups.com
Where can I find an implementation of RIF? How does it compare to SWRL? Does it use Open or Closed World semantics? That is the one thing about SWRL I find so limiting. It's great when you can use it but the OWA means there are lots of inferences you can't do. I think SPARQL is actually a very powerful reasoning engine. I often define rules in SWRL first in Protege and then manually re-write them in SPARQL. Once you have the logic right the way you implement doesn't matter much and going from SWRL to SPARQL is very straight forward (and way more efficient), even though one line of SWRL will be 10 lines of SPARQL). It isn't rules but you can get the same effect and in some ways it is better than traditional rules because you can do more flexible pattern matching. I've used SPARQL and Python to automate refactoring transformations, similar to the way we used transformation rules in KBSA. 

You received this message because you are subscribed to a topic in the Google Groups "ontolog-forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ontolog-forum/qd3fAnRgQvc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ontolog-foru...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ontolog-forum/fbfe9e99-3f6c-4023-8818-10433a1f82ce%40sbcglobal.net.

Mike Peters

unread,
Apr 16, 2026, 6:53:18 PM (5 days ago) Apr 16
to ontolog-forum
Michael

Yes, I have also done something like this. I manually imported some ontologies and used them to generate DDD. Worked well. A future step is to fully automate this process.

I'll report back when that is done, publicly documented and a recorded demo on YouTube.

Mike Peters
Ajabbi

Michael DeBellis

unread,
Apr 16, 2026, 7:33:32 PM (5 days ago) Apr 16
to ontolo...@googlegroups.com
Excellent. I'm looking forward to seeing it. I would appreciate it if you add me to any lists of people who will get notified when you publish videos or papers.  I've also been doing some work on a semantic data catalog that includes a model of data products and concepts from DDD like bounded context and context maps. I leveraged DCAT, PROV, and SKOS and then added the DDD concepts.  I'm hoping I'll be able to release it in a few months, not completely under my control. IMO, this is where the real value of the Semantic Web is. Also, the thing that really provides amazing potential is to treat all the documents like the corpus of a RAG system. The first time I thought of this is when I was reading Ole Olesen-Bagneux's Data Catalog book and he emphasized how a data catalog is all about search but since his  book predates the LLM revolution, he was talking about keyword search. LLM powered search allows you to answer all kinds of interesting questions about your data that goes way beyond keyword search. I sent him an email asking about this (if he would now include LLMs as a search tool for data catalogs) and he totally agreed. 

One last thought: IMO, this is about enterprise data in general and the boundaries between knowledge management, data catalog, data lake, were always very artificial and an integrated approach based on semantic technology for what Evans calls the "ubiquitous language" to model domains and RAG type search for the data has incredible potential for the future. Some people seem to view LLMs as competitors to semantic technology but I think just the opposite. They solve very different problems and the high level explicit knowledge representation of the Semantic Web is the perfect complement to the NLP power of LLMs. The strengths of the semantic approach (explicit knowledge representation, explanations) offset the weaknesses of LLMs (black box reasoning) and vice versa (the power of LLMs is that you don't need to know query languages or schema structures and can interact with the data using natural language). 

Cheers,
Michael

Mike Peters

unread,
Apr 17, 2026, 12:28:15 AM (5 days ago) Apr 17
to ontolog-forum
Hi Michael

Will do. Great, I look forward to reading it.

Pipi is completely ontology-driven. At the moment, I'm prioritising the complete self-managed automation of Pipi to increase DevOps speed 1000x by June 2026. 
After that, a mountain of freely available documentation should come out. Including, Ontology > Boro Engine (bor) > DDD
Cheers
Mike Peters
Ajabbi

Paul Tyson

unread,
Apr 17, 2026, 11:13:16 PM (4 days ago) Apr 17
to ontolo...@googlegroups.com

> Where can I find an implementation of RIF? How does it compare to SWRL? Does it use Open or Closed World semantics?

I haven't kept up with RIF or it's implementations. As far as I can tell the rules world is terribly fragmented and unfocused, suffering from narrow and prejudiced viewpoints. RIF was meant to solve that--Rule INTERCHANGE Format--but appears to have been ignored.

I had 3 viable choices: RIF, RuleML, or Common Logic. It only made sense to use a language with a robust XML syntax option if you aim to encode enterprise business rules for use over a wide scope of application. I also was concerned with theoretical soundness, since I am no rules expert. CL's original XML syntax was buggy. RuleML's was overly complicated (but very powerful). RIF hit the sweet spot of soundness, usability, and compatibility with other W3C standards (such as datatypes and functions).

As for implementation, I rolled my own xslt transformations to make 2 outputs: rif2sparql to generate sparql queries, and rif2html to create documentation (advantage: xml). This approach could be used just as well to emit sql, prolog, python, whatever implementation language you need or favor. (There are, however, some expressivity gaps between RIF and SPARQL. See Polleres 2012 [1].)

RIF has both an XML and RDF representation, so you can imagine what a powerful system you could build by integrating external information (say, SQL DDL) into an RDF rules repository.

In practice I have never been troubled by the OWA/CWA problem, so I can't say how RIF would handle that. I have only looked glancingly at SWRL but when I did (many years ago) it did not appear suitable for my needs--i.e., encoding business rules in application-agnostic form, for use in multiple contexts.

Regards,
--Paul

[1] http://www.polleres.net/presentations/20120913Datalog20_Tutorial.pdf

John F Sowa

unread,
Apr 18, 2026, 12:27:11 PM (3 days ago) Apr 18
to ontolo...@googlegroups.com, CG, Arun Majumdar
Paul,

I have never used Google AI to answer a complex question about logic, but I thought that it might find useful information from published documents.  So I asked "Compare SWRL, RIF, and Common Logic."   The answer below is better than I expected.

Unfortunately, the worst errors are about Common Logic.  The major reasons why the CL answers are so weak is that some people published articles with the mistaken claim that naive users can make serious mistakes with an undecidable version of logic.  But that claim is absolutely false.  

Frege and Peirce developed notations for full first-order logic almost 50 years before Gödel discovered any statements in FOL that were undecidable.  Even today, only an expert logician is capable of writing an undecidable statement.
Unfortunately the LLM probabilities cannot detect or reason about such issues.  That's a topic that Arun Majumdar and I will discuss in our talk on June 3.

In any case, following is the answer that Google AI generated for my question.  Note that Google includes links to other sources for more information.

John
__________________________

Google AI:  SWRL (Semantic Web Rule Language), RIF (Rule Interchange Format), and Common Logic (CL) are technologies used to represent knowledge and rules, but they serve different purposes within the semantic web and artificial intelligence landscapes. SWRL extends OWL ontologies, RIF acts as a standard to swap rules between systems, and Common Logic provides a foundational framework for first-order logic.
At a Glance Comparison

FeatureSWRLRIF (BLD/Core)Common Logic
Primary GoalExtend OWL with rulesInterchange formatHigh-expressivity foundation
Logic TypeHorn Logic + Description LogicHorn LogicFirst-Order Logic (Full)
StructureAntecedent
Consequent
If-Then RulesetInteroperable syntaxes (XML/Text)
Relationship to OWLTight (Syntactic Extension)Moderate (Combination Semantics)Weak (Translational)
FunctionsNoYes (RIF-BLD)Yes




NegationLimited ("different-from")Limited (Negation as failure)Full

SWRL (Semantic Web Rule Language)
SWRL is designed to make OWL ontologies more expressive by allowing rules to be defined that infer new knowledge from existing OWL individuals (e.g., combining class properties to infer a new class).
  • Strengths: Tight integration with OWL; easy for ontology engineers to use.
  • Weaknesses: Limited to unary and binary predicates (limited to 2 properties at a time).
  • Use Case: Adding "if-then" constraints within a Protégé OWL ontology.
RIF (Rule Interchange Format)
RIF is a W3C standard designed specifically to enable different rule-based systems (e.g., Drools, SWRL engines) to exchange rules. It is not a single language but a framework of dialects, with RIF-BLD (Basic Logic Dialect) being the most common.
  • Strengths: Designed for interoperability; supports functions and n-ary predicates (multiple properties).
  • Weaknesses: Complexity of standardizing multiple dialects.
  • Use Case: Moving rules from a production rule system into a semantic web application.
Common Logic (CL)
Common Logic is an ISO standard (ISO/IEC 24707:2007) for a family of logic languages aimed at exchanging knowledge. It is more expressive than SWRL or RIF, covering full first-order logic, including features like negation and disjunction.
  • Strengths: Extremely high expressivity; can represent almost any classical logical system.
  • Weaknesses: Reasoning in full first-order logic is undecidable (machines can't guarantee a solution).
  • Use Case: Creating complex, foundational ontologies requiring maximum expressivity.
Key Differences
  • Expressivity: Common Logic
    >
    RIF
    >
    SWRL.
  • Ontology Focus: SWRL is built for OWL, while RIF can interact with it, and Common Logic is mostly independent.
  • Rule Type: SWRL and RIF-BLD are primarily based on Horn clauses (a subset of logic), whereas Common Logic supports full First-Order Logic.

 


From: "Paul Tyson" <pht...@sbcglobal.net>

Michael DeBellis

unread,
Apr 20, 2026, 12:25:05 PM (yesterday) Apr 20
to ontolo...@googlegroups.com
John, that was interesting, thanks. Is there a reason you didn't include Prolog in the list? I've never used Prolog for any real work but from what I've seen the Prolog that AllegroGraph has which is integrated with RDF looks extremely powerful. It combines SPARQL’s graph pattern matching with Prolog’s goal-directed reasoning.

On RIF: I know even less about its detail than I do about Prolog (so please correct me if I'm wrong) but I was always skeptical when I read about RIF. The challenge I see with any rule interchange language is the fundamental diversity of rule systems themselves. Languages like SWRL and Prolog differ along key dimensions. Open vs. closed world assumptions, forward vs. backward chaining, and monotonic vs. non-monotonic reasoning. These are not superficial differences; they reflect different execution models and semantics. As a result, any attempt to define a common interchange language risks collapsing into a lowest common denominator that captures only a small subset of what each system can express or execute meaningfully.

In addition, you can always have multiple rule systems work on the same RDF graph so if you need two rule systems (e.g.,you have one problem that only needs forward chaining and the OWA and another that needs backward chaining and the CWA) you have them both read/write to the same RDF graph. 

This is quite different from something like an Interface Definition Language (IDL). An IDL does not attempt to unify the semantics of languages like Java, Python, Lisp, and C. Instead, it standardizes how independently implemented systems communicate across boundaries.  Essentially defining data structures and interfaces, not execution behavior. That is a much more tractable problem. By contrast, a rule interchange language is implicitly trying to bridge differences in reasoning paradigms themselves, which makes faithful interoperability far harder to achieve in practice.

Michael

--
All contributions to this forum are covered by an open-source license.
For information about the wiki, the license, and how to subscribe or
unsubscribe to the forum, see http://ontologforum.org/info
---
You received this message because you are subscribed to a topic in the Google Groups "ontolog-forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ontolog-forum/qd3fAnRgQvc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ontolog-foru...@googlegroups.com.

John F Sowa

unread,
Apr 20, 2026, 3:23:23 PM (22 hours ago) Apr 20
to ontolo...@googlegroups.com, CG, Arun Majumdar
Michael,

I strongly agree with you about the importance of Prolog.   In our VivoMind and Permion companies, Prolog has been our primary programming language for any kind of AI and NLP.  We also use other programming languages for dealing with system stuff.

But Prolog also has many features for dealing with computational issues, and its logic isn't as expressive as Common Logic.  So we use CL for pure knowledge representation.

There are many more issues involved, and I'll cite the following slides for a summary:
Language, Ontology, and the Semantic Web, https://jfsowa.com/talks/eswc.pdf .

These slides were presented in 2020, and there is much more to say about LLMs.  But these 64 slides are still good for what they address.

John

PS:  The reason why I used Google AI to compare RIF, SWRL, and CL is that I was replying to a question by Paul Tyson, who asked about those three.   But I deleted all that material, since it made the note too long.  The ending of your note contains all the deleted material.

In our VivoMind and Permion companies, we never use RIF, SWRL, or other notations for any version of logic.  We immediately translate any information in any notation (including any kind of Knowledge Graphs) to Common Logic in the conceptual graph form.  CL is a superset of all those representations and our tools (implemented in Prolog) can handle anything represented in any of them
____________________

Paul Tyson

unread,
Apr 20, 2026, 9:50:00 PM (15 hours ago) Apr 20
to ontolo...@googlegroups.com


On 4/20/26 11:24, Michael DeBellis wrote:
John, that was interesting, thanks. Is there a reason you didn't include Prolog in the list? I've never used Prolog for any real work but from what I've seen the Prolog that AllegroGraph has which is integrated with RDF looks extremely powerful. It combines SPARQL’s graph pattern matching with Prolog’s goal-directed reasoning.

On RIF: I know even less about its detail than I do about Prolog (so please correct me if I'm wrong) but I was always skeptical when I read about RIF. The challenge I see with any rule interchange language is the fundamental diversity of rule systems themselves. Languages like SWRL and Prolog differ along key dimensions. Open vs. closed world assumptions, forward vs. backward chaining, and monotonic vs. non-monotonic reasoning. These are not superficial differences; they reflect different execution models and semantics. As a result, any attempt to define a common interchange language risks collapsing into a lowest common denominator that captures only a small subset of what each system can express or execute meaningfully.

You might avoid RIF for other reasons, but lack of expressiveness or coverage is not a valid one. The RIF Framework for Logic Dialects (FLD)[1] is a robust extension mechanism, designed to support FOL and higher-order logics. RIF-Core and RIF-BLD (Basic Logic Dialect) are defined using FLD. Other dialects are, as they say, left as an exercise for the reader.

Regards,
--Paul

[1] https://www.w3.org/TR/rif-fld/

You received this message because you are subscribed to the Google Groups "ontolog-forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontolog-foru...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ontolog-forum/CALGFikc_TSt1rwQeT6%3D9JiX7UX65j%2BD6MLTsVgQ7CW2P6gHvZw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages