1

Here is a (crude) piece of OWL modelling concerning a template for a formal financial budget bill document of the Ministries in my country. It shows the class of a Budget Bill title, as a part of the front matter of such a document (amidst colophon, table of contents, subtitle and more). The class functions as a template for the written budget bills of the government, in this case the title part. This title is partly static (always containing the string "Adoption of the Budget Bill of the Ministry of", which is no problem using the owl:hasValue notation) and partly dynamic, ideally retrieved from individuals from another class (the name of the Ministries). I do not know how to model this properly in OWL (if possible). I have googled a lot and came up with different information sources hinting at the solution yet never enough for me to really grasp it and translate it to a proper working solution.

:InitialBudgetBill-Title dct:identifier ftext:rbv1.10 .
:InitialBudgetBill-Title rdfs:label "Template Budget Bill".
:InitialBudgetBill-Title rdf:type owl:Class ;
owl:equivalentClass 
    [rdf:type owl:Class ;
     owl:intersectionOf ( doco:Title 
               [rdf:type owl:Restriction ;
                owl:onProperty c4o:hasContent;
                owl:hasValue "Adoption of the Budget Bill of the Ministry of ????....?????"]
               [rdf:type owl:Restriction ;
                owl:onProperty dct:isPartOf;
                owl:someValuesFrom :FrontMatter-InitialBudgetBill]
               )
   ]. 

Here is the code for the budget structure (the Ministries are also called Budget Chapters) and the property with Ministry names, from where I would like to retrieve the name and include it in the class of the above-mentioned budget bill title.

:BudgetChapter rdf:type owl:Class ;

            rdfs:label "Budget Chapter"@en ;

            rdfs:comment "A chapter within the national budget."@en ;

            rdfs:subClassOf :BudgetStructureElements .


:hasBudgetChapterName rdf:type owl:DatatypeProperty ;

               rdfs:label "has Budget Chapter Name"@en ;

               vann:usageNote "A budget chapter has a name." ;

               rdfs:comment "Indicates what name a budget chapter has."@en ;

               rdfs:domain :BudgetChapter ;

               rdfs:range xsd:string.
               

Individuals:


:FinanceMinistry rdf:type :BudgetChapter.
:FinanceMinistry :hasBudgetChapterName "Ministry of Finance".
:BudgetBillTemplate2021_Title rdf:type :InitialBudgetBill-Title.
:BudgetBillTemplate2021_Title rdf:type doco:Title.
:BudgetBillTemplate2021_Title c4o:hasContent "Adoption of the Budget Bill of the Ministry of Finance".
:BudgetBillTemplate2021_Title dct:isPartOf :BudgetBillTemplate2021_FrontMatter.
:BudgetBillTemplate2021_FrontMatter rdf:type :FrontMatter-InitialBudgetBill.
:BudgetBillTemplate2021_FrontMatter rdf:type doco:FrontMatter.

 

There are several reasons why I would want this:

  1. modeling the structure of the budget bill so that we can give context to the written texts
  2. reason with this model to see of data and model are consistent
  3. reason with this model to generate automatically filled in budget bill templates

We are also looking into incorporating SHACL into this (for both validating and generating), but that is not in scope of my question for now.

I have read the following related sources:

Modelling OWL datatype property restrictions with a list of values

String manipulation in RDF/OWL

How to retrieve elements of OWL enumerated datatype expression?

I have read about creating datatypes, but as far as I know, I cannot work with custom datatypes whose content is dependent on other individuals from other classes with other properties. I tried thinking of a solution using (non working) code (more or less) like below-mentioned, but I fear I am completely in the wrong direction:

    [rdf:type restriction;
     owl:onProperty c4o:hasContent;
         owl:someValuesFrom   
          [ rdf:type             rdfs:Datatype ;
            owl:onDatatype       xsd:integer ;
            owl:withRestrictions  ([xsd:pattern "Adoption of the Budget Bill of the " && <some pattern using budget chapter names>"])
          ]
       

I have also considered the use of the owl:oneOf property, but also there I cannot seem to include dynamically the property values of another class' individuals. I could store all the different budget chapter names into the class, but that does not give me the dynamics I want, nor do I know how to combine the owl:oneOf values with the static string "Adoption of the Budget Bill of". Then it leaves me for the option to model the entire title as owl:oneOf property values, one for each department:

:InitialBudgetBill-Title dct:identifier ftext:rbv1.10 .
:InitialBudgetBill-Title rdfs:label "Template Budget Bill".
:InitialBudgetBill-Title rdf:type owl:Class ;
owl:equivalentClass 
    [rdf:type owl:Class ;
     owl:intersectionOf ( doco:Title 
                [rdf:type owl:Restriction ;
                owl:onProperty c4o:hasContent ;
                owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                     owl:oneOf ( "Adoption of the Budget Bill of the Ministry of Finance"
                                                 "Adoption of the Budget Bill of the Ministry of Economic Affairs" 
                                                 "Adoption of the Budget Bill of the Ministry of Education")]
               [rdf:type owl:Restriction ;
                owl:onProperty dct:isPartOf;
                owl:someValuesFrom :FrontMatter-InitialBudgetBill]
               )
   ]. 

I am not sure whether this is solid and valid OWL coding.

In addition, as the names of the Ministries change over time it would be handier to have a validated data model/data with up-to-date names that I can cross check the titles of the budget documents with. Hence, the need for more dynamics instead of hardcoding the ministry names.

I am fairly new to OWL, so I expect to have some flawed thinking in this area, unfortunately. I have not even worked with reasoning using this model, first I wish to understand how to model it correctly. I am wondering whether Reasonable Ontology Templates (OTTR, https://ottr.xyz/) could be of use here, but I find it hard to understand and apply.

Could anyone help me out?

DatedLink
  • 11
  • 2
  • Maybe `swrlb:stringConcat()`. – Stanislav Kralin Apr 09 '21 at 09:24
  • Interesting, @StanislavKralin, thank you. Had a look at https://www.w3.org/Submission/SWRL/ but I have a hard time trying to understand how to combine SWRL with OWL. It seems like a framework inside a framework and that always sets me off in the wrong direction ;-) Would greatly appreciate if anyone could show me how to use swrlb:stringConcat() in a OWL model. – DatedLink Apr 09 '21 at 20:47
  • Additional question: how does SWRL compare to SHACL? Would you say that SHACL can do what SWRL can do and more? Asking this in relation to my original question, as I would like to know what would be the most future proof solution. We are considering applying SHACL already, especially for the consistency check, data validation and generation. OWL would still be used but for modeling the knowledge domain and re-using this in SPARQL queries (bringing more context). – DatedLink Apr 09 '21 at 20:50
  • *"how to use swrlb:stringConcat() in a OWL model"* — check the "SWRL" tab in Protege. Actually, everything depends on your triplestore. Different tripkestores supports different systems of rules. Some triplestores support SWRL. – Stanislav Kralin Apr 10 '21 at 09:40
  • *"how does SWRL compare to SHACL?"* — SHACL is rarher for validation, ± for constraint-driven modeling. SWRL is for reasoning. SHACL has reasoning capabilities (https://www.w3.org/TR/shacl-af/#rules), but it is not deductively closed. However, that is not you should care about in your particular case. – Stanislav Kralin Apr 10 '21 at 09:46
  • Thank you @StanislavKralin! I'll try to see if the SWRL tab in Protege can help me out here. Will let you know the results. – DatedLink Apr 13 '21 at 10:03
  • In a way this might be related: https://stackoverflow.com/questions/45188165/creating-regex-restriction-on-owl-class. As for the definitive answer, I am currently considering letting go of too much detail implementation in OWL. Instead, those details I will adopt in SHACL shapes, where OWL provides the more overall knowledge model. With SHACL I have a bit more standardized support in applications compared to SWRL. Second, there is an interesting discussion about the role of SHACL and OWL, see: https://www.topquadrant.com/shacl-blog/. – DatedLink Jun 18 '21 at 13:08

0 Answers0