Hi, Here is my question. There are two class, Activity and Situation. Activity has instance activity1. Situation has instance situation ValueNotAssigned. Activity has two properties, hasValue and hasSituation. The range of the two properties are int and Situation.
I want to make the following inference. for a activity, if it has no hasValue property explicitly or it has a hasValue property but there's no value specified for the property, then this activity hasSituation ValueNotAssigned. Can I write this sentence via SWRL or other languages? Thanks!

asked 25 Nov '12, 13:25

alexplorer's gravatar image

alexplorer
03
accept rate: 0%

In order to check whether an activity has a property or not, we need a negation in the language. If SWRL can express negations, then your problem is solved. I don't know SWRL though..

(25 Nov '12, 13:55) fadirra fadirra's gravatar image

'...or it has a hasValue property but there's no value specified for the property...', what do you mean by this. The range is a literal and an integer so do you mean 0?

(26 Nov '12, 09:43) William Greenly William%20Greenly's gravatar image

for example, there exists hasValue property for acitivity1. but the value of this property is not specified and is empty. I think this situation is possible. If the value is empty, the activity1 still hasSituation ValueNotAssigned. I hope I have clarity it.

(26 Nov '12, 09:48) alexplorer alexplorer's gravatar image

I don't know about SWRL, but you can do this using a simple SPARQL INSERT operation:

INSERT {
    ?x ex:hasSituation ex:ValueNotAssigned .
}
WHERE { 
    ?x a ex:Activity. 
    FILTER NOT EXISTS { ?x ex:hasValue [] } 
}
permanent link

answered 25 Nov '12, 14:20

Jeen%20Broekstra's gravatar image

Jeen Broekstra ♦
11.6k412
accept rate: 38%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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

Question tags:

×113
×55
×46

question asked: 25 Nov '12, 13:25

question was seen: 908 times

last updated: 26 Nov '12, 09:51