Protege-OWL:类必须具有每个< value>中的一个 [英] Protege-OWL: Class must have one of each <value>
问题描述
我是新手,必须使用曼彻斯特OWL语法对具有与soduku类似属性的网格进行建模.
I'm new to protege and i have to model a grid with similar properties to soduku, in Manchester OWL syntax.
我一直在搜索,但是我似乎找不到找到这样一个公理的方法:每个列必须有4个单元格,并且必须具有这些值中的每一个". 就像,假设一个4x1列,每个单元格必须包含一个数字,并且该列必须具有所有数字[1:4].
I have been searching but i can't seem to find a way to make an axiom that says "each column must have 4 cells, and must have each one of these values ". As in, assuming a 4x1 column, each cell must contain one number and the column must have all the numbers [1:4].
我已经设置了一些Objects,data属性和Object属性,这些属性我将留在这里.我将在此处保留完整的.owl文件,以便可以加载它,从而更轻松地提供帮助.
I have already set up some Objects , data properties and Object properties which i will leave here. I will leave the full .owl file here so it can be loaded thus making it easier to give help.
我们非常感谢所有帮助.
All help is highly appreciated.
Prefix: dc: <http://purl.org/dc/elements/1.1/>
Prefix: owl: <http://www.w3.org/2002/07/owl#>
Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Prefix: GridTest: <http://www.semanticweb.org/existance/ontologies/2017/4/GridTest#>
Prefix: xml: <http://www.w3.org/XML/1998/namespace>
Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>
Ontology: <http://www.semanticweb.org/existance/ontologies/2017/4/GridTest>
Datatype: xsd:int
Datatype: xsd:integer
ObjectProperty: GridTest:hasCell
SubPropertyOf:
GridTest:hasRelation
Domain:
GridTest:Grid
InverseOf:
GridTest:isCellOf
ObjectProperty: GridTest:hasColum
SubPropertyOf:
GridTest:hasRelation
Domain:
GridTest:Grid
Range:
GridTest:Grid
InverseOf:
GridTest:isColumOf
ObjectProperty: GridTest:hasRelation
ObjectProperty: GridTest:isCellOf
InverseOf:
GridTest:hasCell
ObjectProperty: GridTest:isColumOf
InverseOf:
GridTest:hasColum
DataProperty: GridTest:hasValue
Characteristics:
Functional
Domain:
GridTest:Cell
Range:
{"1"^^xsd:int , "2"^^xsd:int , "3"^^xsd:int , "4"^^xsd:int}
Class: GridTest:Cell
SubClassOf:
GridTest:Grid,
GridTest:hasValue exactly 1 xsd:int
Class: GridTest:Colum
SubClassOf:
GridTest:Grid,
GridTest:hasCell exactly 4 GridTest:Cell
Class: GridTest:Grid
SubClassOf:
GridTest:hasColum exactly 4 GridTest:Colum
Individual: GridTest:cell1
Facts:
GridTest:isCellOf GridTest:col,
GridTest:hasValue 1
Individual: GridTest:cell2
Facts:
GridTest:isCellOf GridTest:col
Individual: GridTest:cell3
Facts:
GridTest:isCellOf GridTest:col
Individual: GridTest:cell4
Facts:
GridTest:isCellOf GridTest:col
Individual: GridTest:col
Facts:
GridTest:isColumOf GridTest:grid
Individual: GridTest:grid
关键是当我运行推理机时,某些单元格的值会推断其他单元格的值. e.x:cell1 = 1,cell2 = 2,cell3 = 3 =>推理机将推断出cell4的值为4.
the point of this is that when i run the reasoner, values to some of the cells, it will infer the values of the other cells. e.x: cell1 = 1, cell2 =2, cell3 = 3 => the reasoner will infer that cell4's value is 4.
推荐答案
我通过更改方法提出了针对该项目和具体问题的解决方案.代替单元格是具有值的类,可以通过认为值可以是需要放置到单元格中的实体来轻松实现.
I have come up with a solution for this project and this question in specific, by changing the approach. Instead of a Cell being a Class that has a Value, it can be done easily by thinking that a Value can be an entity that needs to be placed into a Cell.
使用这种思路,所有这些都可以归结为斧头中的逻辑表达式.
Using this line of thinking it can all come down to logic expressions in the axions.
通过具有类Value,向个体添加值的数据属性以及具有适当断言的Data属性的代表该值的个体,可以简单地说,Cell对象(hasvalue value 1) or (hasValue value 2) ...
和hasvalue exactly 1 value
By having a class Value, a data property that adds a value to an individual, and individuals that represent the value with the proper Data property asserted, it can simply be said that, the Cell object (hasvalue value 1) or (hasValue value 2) ...
and hasvalue exactly 1 value
这篇关于Protege-OWL:类必须具有每个< value>中的一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!