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:
- modeling the structure of the budget bill so that we can give context to the written texts
- reason with this model to see of data and model are consistent
- 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?