如何定义一个没有两个等效谓词对象的类? [英] How to define a class that does not have two equivalent predicate objects?

查看:83
本文介绍了如何定义一个没有两个等效谓词对象的类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试定义间隔的类别.每个间隔对象最多可以(可选)具有两个边界点.其中一个-下边界,另一个-上边界.如何限制我的间隔等级,以使上下边界点必须不同(如果提供)?

I'm trying to define class of intervals. Each interval object may have (optionally) at most two boundary points. One of them - lower boundary, and another - upper boundary. How can I restrict my class of intervals, so that lower and upper individual boundary points must be different (if provided)?

推荐答案

您可以声明 hasLowerBound hasUpperBound 属性是不相交的.这意味着同时具有两个值的个人不能具有相同的 值.这是一个例子.我在这里使用了对象属性,但是您也可以将不相交的属性公理与数据类型属性一起使用.

You can declare that the hasLowerBound and hasUpperBound properties are disjoint. This means that an individual with values for both cannot have the same value for both. Here's an example. I've used an object property here, but you can use disjoint property axioms with datatype properties, too.

@prefix :      <http://stackoverflow.com/q/36043590/1281433/> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .

<http://stackoverflow.com/q/36043590/1281433/#hasLowerBound>
        a                         owl:ObjectProperty ;
        owl:propertyDisjointWith  <http://stackoverflow.com/q/36043590/1281433/#hasUpperBound> .

<http://stackoverflow.com/q/36043590/1281433/#hasUpperBound>
        a       owl:ObjectProperty .

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns="http://stackoverflow.com/q/36043590/1281433/"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
  <owl:ObjectProperty rdf:about="http://stackoverflow.com/q/36043590/1281433/#hasUpperBound"/>
  <owl:ObjectProperty rdf:about="http://stackoverflow.com/q/36043590/1281433/#hasLowerBound">
    <owl:propertyDisjointWith rdf:resource="http://stackoverflow.com/q/36043590/1281433/#hasUpperBound"/>
  </owl:ObjectProperty>
</rdf:RDF>

这篇关于如何定义一个没有两个等效谓词对象的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆