Hi Markus and Kim,
driven by your inquiry Kim, I have written down a "how to realize a
range constraint" for SMW respectively SMW with Halo extension [1].
Markus: Please note that from the Halo side we have already implemented
this feature by using a special, 2-ary property "Has domain and range".
It accepts categories and allows you to define the domain and range
category of a property.
Ideally this property should also understand concepts, so that you can
use "complex class descriptions" (in the sense of OWL) for defining the
domain and range. I have already filed a feature request for that issue [2].
So why not take over this pre-defined property (and extend it) for usage
in SMW?
Best regards,
Philipp
[1]
http://smwforum.ontoprise.com/smwforum/index.php/Example:How_to_realize_a_range_constraint_for_a_property
[2] http://smwforum.ontoprise.com/smwbugs/show_bug.cgi?id=10786
Markus Krötzsch schrieb:
> On Dienstag, 28. Juli 2009, Philipp Zaltenbach wrote:
>
>> Hi Kim,
>>
>> actually the 'and' is just printed in the FactBox (I assume for readability
>> purposes), but it is not part of the semantic annotation and thus not
>> contained in the facts.
>>
>
> Also, you should not see the "and" if you set "sep=,".
>
> Anyway, what you are trying to do here is very very hacky, and it will hardly
> work well if the category contains many elements. You should rather file a
> feature request for this, so we can come up with a proper solution at some
> point.
>
> If you only want to make sure that there is a warning whenever someone tries
> to enter a non-vegetable for this property, then you could also build this
> behaviour into a template that is used to set the annotation. The query:
>
> {{#ask: [[Category:Vegetable]] [[Tomato]] | format=count }}
>
> will return "1" if Tomato is in the category Vegetable, and "0" otherwise. So
> it could be used in some #if-function to decide whether an input should be
> accepted or a warning should be given. "Tomato" could of course be a template
> parameter (in a template, better add ":" and write [[:{{{someparam}}}]] to be
> prepared for the case that someone uses, e.g., "Category:X" as a parameter
> value).
>
> Cheers,
>
> Markus
>
>
>>
>> Hi guys,
>>
>> I'm trying to create a dynamic 'Allows value' list.
>>
>> If I have a property page, 'Has Vegetables' and want it to only allow
>> values within Category:Vegetables, how should I do this?
>>
>> I googled and found one solution, which is
>>
>> [[has type::page]]
>> {{#arraymap: {{#ask:
>> [[Category:Vegetables]]|format=list|link=none|sep=,}}|,| @@|[[allows
>> value::@@]]}}
>>
>> But the last possible value comes out with an 'and' in front of it, and I
>> don't wanna add a dummy value 'ZZZ' or something like that.
>>
>> Do you guys know of any means to accomplish what I'm trying to do?
>>
>> Thanks.
>>
>> Joon
>>
>
>
>
--
Philipp Zaltenbach
Professional Services
ontoprise GmbH - know how to use Know-how
---
ontoprise presents the new SemanticMiner for SharePoint:
http://www.ontoprise.de/en/home/news/news-en/cebit-2009-ontoprise-presents-the-new-semanticminer-for-sharepoint/
---
An der RaumFabrik 29; 76227 Karlsruhe; Germany
phone: +49 721 509809-0; fax: +49 721 509809-11
mailto:zaltenbach@..., www: http://www.ontoprise.de
Registered office: Karlsruhe, Germany; Register court: Mannheim, HRB 109540
Managing directors: Prof. Dr. Juergen Angele, Dipl.Wi.-Ing. Hans-Peter Schnurr
|