In OWL 2, is there a way to declare that, for individuals :a, :b, :c, and :x, and ObjectProperty :y

:x :y :a .
:x :y :b .
:x :y :c . 

(And vice versa, preferably.)

I suppose I could use class structure, but my :a, :b, and :c are really not classes, but individuals of a certain class. Is punning what I'm looking for here?

Edit, responding to Antoine...

Correct, :x is my variable.

it's hard to explain my exact purpose, so let me give a concrete (if bad) example of a similar situation.

Let's say I'm modeling permissions, and my :x is an instance of a class :User, and :y == :hasPermission.

Now, a-c are :Read :Write :ReadWrite, all instances of a class :Permission (yes, doesn't really make sense, but it's the simplest similar example I can come up with.).

What I want to say is that, for any :User :x:, if he :hasPermission both :Read and :Write, then he implicitly :hasPermission :ReadWrite.

I could map that using classes, but I'm not sure that's the best option, because I have difficulty restricting the domain of my :hasPermission to :Permission, unless I define :Read, etc. as both :SubClassOf :Permission and a :Permission. And from my limited understanding, that gets into punning, and may not do what I want in an OWL 2 DL context.

I'm reading at the moment, which I think is actually answering my question, but I don't think I'm happy with that answer.

asked 10 Aug '10, 13:06

Peter%20Kahle's gravatar image

Peter Kahle
accept rate: 0%

edited 10 Aug '10, 15:33

This is interesting, but it seems to me that this question is more easily addressed by a rule. Assuming, as Antoine had that :x is the variable, one can make the inference with the following SPARQL:

CONSTRUCT {?x :y :c}
    ?x :y :a .
    ?x :y :b .

...and this can easily be manipulated if y or both x and y are variables. This seems to state the semantics more clearly in this particular case.


answered 10 Aug '10, 16:23

scotthenninger's gravatar image

scotthenninger ♦
accept rate: 17%

Yep, that's exactly what I was going for, but I was hoping there was a way to express that inside the ontology so it's explicit.

I guess I just add annotations to the objects in question to describe the intended purpose.

(10 Aug '10, 18:20) Peter Kahle Peter%20Kahle's gravatar image

It seems to me that this is as explicit and straightforward as one can get for this example. OWL "thinks about" classification problems in a way that sometimes makes for non-intuitive definitions. Note there are likely performance advantages to the SPARQL approach as well, as the rule only gets that part of the model that matches. The OWL definition could conceivably force computation of each class meeting the restriction, then need to compute where the missing properties are needed. SPARQL processors are available that embed these rules in the model. SPIN is an example.

(10 Aug '10, 21:21) scotthenninger ♦ scotthenninger's gravatar image

Yes, it's possible, in a roundabout way. Using your hasPermission, etc examples:

:Reader owl:equivalentClass [
  a owl:Restriction ;
  owl:onProperty :hasPermission ;
  owl:someValuesFrom [ a owl:Class; owl:oneOf(:Read) ]
] .

:Writer owl:equivalentClass [
  a owl:Restriction ;
  owl:onProperty :hasPermission ;
  owl:someValuesFrom [ a owl:Class; owl:oneOf(:Write) ]
] .

:ReadWriter owl:equivalentClass [
  owl:intersectionOf (:Reader :Writer)
] , [
  a owl:Restriction ;
  owl:onProperty :hasPermission ;
  owl:someValuesFrom [ a owl:Class; owl:oneOf(:ReadWrite) ]
] .

This allows the OWL tool to figure out:

  1. that anyone who has permission to read is a Reader, anyone who has permission to write is a Writer.
  2. that anyone who is a reader and a writer must be a ReadWriter.
  3. that anyone who is a ReadWriter has permission ReadWrite.

So, that's...

  a owl:Class ;
  owl:intersectionOf ([
    a owl:Restriction ;
    owl:onProperty :y ;
    owl:someValuesFrom [ a owl:Class; owl:oneOf(:a) ]
    ] [
    a owl:Restriction ;
    owl:onProperty :y ;
    owl:someValuesFrom [ a owl:Class; owl:oneOf(:b) ]
    ]) ;
  owl:equivalentClass [
    a owl:Restriction ;
    owl:onProperty :y ;
    owl:someValuesFrom [ a owl:Class; owl:oneOf(:c) ]
    ] .

Yeah, OWL makes some things pretty tricky.


answered 11 Aug '10, 00:01

tobyink's gravatar image

tobyink ♦
accept rate: 26%

I guess that's what I was looking for. That's confusing, but I think I get it. Thanks

(11 Aug '10, 11:33) Peter Kahle Peter%20Kahle's gravatar image

In your question, there must be some variable somewhere. If :a, :b, :c, :x and :y are constants, then you can simple assert:

:x :y :c .

in your ontology. However, if :y is a variable, it is a strange rule since it means "whatever the relation, if it holds between x and a and between x and b, it has to hold between x and c". If :x is a variable, then it makes much more sense ("whatever has relation :y with both :a and :b also has the relation :y with :c"). This can be expressed in OWL 1 DL as well as in OWL 2 DL and even in OWL 2 EL:

@prefix : <> .
@prefix owl: <> .
@prefix rdfs: <> .

[ a owl:Class ] owl:intersectionOf (
    [ a owl:Restriction;
      owl:onProperty :y;
      owl:hasValue :a ]
    [ a owl:Restriction;
      owl:onProperty :y;
      owl:hasValue :b ]
) ; rdfs:subClassOf 
    [ a owl:Restriction;
      owl:onProperty :y;
      owl:hasValue :c ] .

If :a or :b or :c are variables, the rule doesn't make much sense, I would say.

If you want the "vice-versa", you can replace rdfs:subClassOf by owl:equivalentClass.


answered 10 Aug '10, 14:23

Antoine%20Zimmermann's gravatar image

Antoine Zimm... ♦
accept rate: 32%

edited 10 Aug '10, 16:24


Agreed, though you want some "owl:onProperty :y" statements in each restriction.

(10 Aug '10, 14:32) Dave Reynolds Dave%20Reynolds's gravatar image

OK, I think those two answers mostly get me there, but see my update of the question for clarification. Yes, :x is my variable.


(10 Aug '10, 15:34) Peter Kahle Peter%20Kahle's gravatar image

Dave: Oops, yes that's right. Thanks for the notice (updated).

(10 Aug '10, 16:24) Antoine Zimm... ♦ Antoine%20Zimmermann's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 10 Aug '10, 13:06

Seen: 3,236 times

Last updated: 11 Aug '10, 00:01