具有包含特定字符串的属性的个体 OWL 类模型,其中字符串内容部分依赖于其他个体/其他类

如何解决具有包含特定字符串的属性的个体 OWL 类模型,其中字符串内容部分依赖于其他个体/其他类

这是一个(粗略的)OWL 模型,它是关于我国各部委正式财务预算法案文件模板的。它显示了预算法案标题的类别,作为此类文档前言的一部分(在版权页、目录、副标题等之间)。该类用作政府书面预算法案的模板,在本例中为标题部分。这个标题部分是静态的(总是包含字符串“Adoption of the Budget Bill of the Ministry of”,使用 owl:hasValue 表示法没有问题),部分是动态的,理想情况下是从另一个类的个人(部委的名称)中检索的)。我不知道如何在 OWL 中正确建模(如果可能)。我在谷歌上搜索了很多,并提出了暗示解决方案的不同信息来源,但从来没有足够让我真正掌握它并将其转化为适当的工作解决方案。

: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]
               )
   ]. 

这是预算结构的代码(部门也称为预算章节)和带有部门名称属性,我想从中检索名称并将其包含在上述预算法案标题的类中.

: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.
               

个人:


: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.

 

我想要这个有几个原因:

  1. 为预算法案的结构建模,以便我们可以为书面文本提供上下文
  2. 这个模型看到的数据和模型一致的原因
  3. 使用此模型自动生成填充的预算账单模板的原因

我们也在考虑将 SHACL 纳入其中(用于验证和生成),但这目前不在我的问题范围内。

我已阅读以下相关资料:

Modelling OWL datatype property restrictions with a list of values

String manipulation in RDF/OWL

How to retrieve elements of OWL enumerated datatype expression?

我已阅读有关创建数据类型的内容,但据我所知,我无法使用自定义数据类型,其内容依赖于具有其他属性的其他类的其他个体。我尝试考虑使用(非工作)代码(或多或少)的解决方案,如下所述,但我担心我完全走错了方向:

    [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>"])
          ]
       

我还考虑了 owl:oneOf 属性的使用,但在那里我似乎无法动态包含另一个类的个人的属性值。我可以将所有不同的预算章节名称存储到类中,但这并没有给我想要的动态,我也不知道如何将 owl:oneOf 值与静态字符串“Adoption of the Budget Bill of”结合起来。然后我可以选择将整个标题建模为 owl:oneOf 属性值,每个部门一个

: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]
               )
   ]. 

我不确定这是否是可靠且有效的 OWL 编码。

此外,随着各部委的名称随着时间的推移而变化,拥有经过验证的具有最新名称的数据模型/数据会更方便,我可以用它来交叉检查预算文件标题。因此,需要更多的动态而不是硬编码部门名称

我对 OWL 相当陌生,因此很遗憾,我希望在这方面有一些有缺陷的想法。我什至没有使用这个模型进行推理,首先我想了解如何正确建模。我想知道合理的本体模板 (ottR,https://ottr.xyz/) 是否可以在这里使用,但我发现它很难理解和应用。

有人可以帮我吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?