1

As part of my research, I have been working on a DMN table and OWL ontology. I must map rules from the DMN table into an OCQA web ontology file and work later with SHACL to infer some rules.

In this process, as an initial step recently, my supervisor gave me a hint to map the DMN table with OWL. His message:

https://www.omg.org/spec/DMN/1.2/About-DMN

You find an rdf specification on the bottom of the page.

First, you have to define the dmn schema in owl. Then you can directly define or import a dmn table into owl. Or you use the rdf schema.

I have very little idea about semantic web technology. So I studied some documents or tutorials and understood that classes, individuals, and relationships (object properties, data prop) made an ontology. Like this, I did practice an example development in Protege software.

After his reply, I started to read "what is an rdf scheme or OWL schema", but unfortunately, I didn't go further.

Can someone help me to understand the schema or define a relevant schema for the DMN table, as my supervisor suggested?

What should I do to define a schema? Is this nothing but making classes and individuals with relations or creating some placeholders and then getting them from the mapping of DMN? I am clueless. Should I use RDFPY library to do all these things?`

Stack Overflow is not supporting uploading DMN file. It is nothing but data in XML. Here is a picture:

DMN table for quality checks of a concrete curing method

This table is not a relational database. DMN table is a type of a table works as rule engine for BPMN and generates output when only matches with input data. This is written in XML.

DMN table backend XML code

Here is a sample of my schema My rdfs

Kuladeep
  • 15
  • 4
  • Could it be, the assignment is to express each of the Decision Table rows (Rules) as an OWL graph? I would pick for instance the first Rule (row) in the DMN model, and try to implement that with OWL syntax. – tarilabs Feb 13 '23 at 15:12

1 Answers1

0

I would suggest making your schema in Protege. Your schema (ontology) will have a set of classes and properties between. Some ontologies will have named individuals, some will separate the named individuals out of the ontology. This is generally A-Box vs T-Box.

Personally, I use rdflib for python development but performance isn't great. For better performance you can use the redland python bindings - but it's a pain in the ass to work with.

As for your table... This is mostly an exercise in mapping from a relational data structure to a graph data structure. Each row represents a node of type 'Inspection' and has relations to the columns. For example consider the pseudo rdf,

Inspection_A rdf:type Inspection
Inspection_A hasActivity "Curing" 
Inspection_A hasApprover "Site Engineer"

tldr; Your ontolgoy should have classes and relations (T-Box). Then in a separate file create instances of the classes (A-Box). T-Boxes will most likely be .owl files while the A-Box is turtle, nquads, json-ld, etc. When you load the two together in a graph database, it should be able to take the definitions in your T-Box and reason over your A-Box. You can use rdflib for programatically working with RDF. Your task is to map a table to a graph. The columns are relations, and table name is a class.

Thomas
  • 720
  • 9
  • 22
  • 1
    Thanks Thomas. I will give a try and come back to you if I stuck anywhere. – Kuladeep Feb 15 '23 at 12:49
  • Hi Thomas, I have done the schema as you suggested. Now I don't know how to map the data from DMN(nothing but XML) to my schema. I have edited the question and added DMN table as XML. Please suggest to me how to proceed further. As you see above my supervisor also said that I should define or directly import. Is that possible to import data from XML ? – Kuladeep Mar 10 '23 at 13:15
  • The main idea of this research is to infer new rules with SHACL using the DMN table. As the DMN table is convenient for anyone to edit or enter new values every time. – Kuladeep Mar 10 '23 at 13:25
  • Okay for the next part... You need to write a program that ingests your XML files - and creates RDF as it reads. I would use a python xml library to iterate over the XML file, and then use RDFLib to create the RDF. RDFLib will actually. insert your rdf into an in-memory graph database-so you'll need to serialize it to disk to get the raw RDF (plenty of examples around). Also. SHACL can't infer new rules. SHACL is a validation language-it only tells you whether your RDF conforms to a SHACL rule – Thomas Mar 10 '23 at 17:56