如何将时间实例添加到本体

问题描述 投票:-1回答:1

我已经创建了一个时间本体保护,其中我必须添加分钟,秒和小时值为09,19等。在输出我想显示时间为11:30:00。当我将实例添加到小时然后秒时,它向我显示已经添加了个人。如何解决这个问题?

instance ontology
1个回答
1
投票

如果我正确理解你想要实现的是一个单独的课程,比如Time,你可以为其指定小时,分钟和秒。这实际上是n-ary relation的一个例子,你将时间关系建模为一个类。一种模拟方法是:

DataProperty: hours
    Domain: Time 
    Range: xsd:byte[>= "0"^^xsd:byte , <= "24"^^xsd:byte]


DataProperty: minutes>
    Domain: Time
    Range: xsd:byte[>= "0"^^xsd:byte , <= "60"^^xsd:byte]

DataProperty: seconds>
    Domain: Time
    Range: xsd:byte[>= "60"^^xsd:byte , <= "0"^^xsd:byte]

Class: Time

然后指定,比如说一些商店的开放时间,如8:30,你可以创建以下个人:

Individual: openingTime
    Types: Time

    Facts:  
     hours  "8"^^xsd:byte,
     minutes  "30"^^xsd:byte,
     seconds  "0"^^xsd:byte
© www.soinside.com 2019 - 2024. All rights reserved.