Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Data types

Tania Tudorache tudorache at
Wed Feb 20 11:30:16 PST 2008


Nafiye Talas wrote:
> Dear Community,
> We recently started working with Protege Frames within our company.
> I have some questions regarding the value types available in protege 
> frames.
> Is there any possibility to add more types to that list? For example 
> 'date'?

No, it is not possible to add new value types. However, there are 
different solutions to your problem. See below.

> I found the plug-in date widget
> but that only captures the current date.
> What are the possibilities regarding data validation?

There are different solutions:

1. You write your own slot widget that does any kind of validation for 
the type of value. For example, even if the date will be a slot of type 
string, the user may enter the date through your own custom slot widget, 
that could do all kind of validation. Or it could show a calendar widget 
and the user will only be able to click to select a valid date.

2. Second solution uses a modeling approach for checking for violations. 
You can define a class "Date" that has three template slots, year, month 
and day of type Integer. You attach min and max numeric constraints to 
these slots (e.g. month can range only from 1 to 12, etc.)
Then, a class that needs to reference a date, will have a template slot, 
called "date" of value type Instance and allowed classes Date.
This approach gives you a very fine grained control over the date. For 
example, you can query for all the date instances in a particular year 
and so on. You will also be able to use the validation that protege 
already does. So if somebody entered a date with a month with value 13, 
he will see a red border around the invalid value. You also have API 
access to these constraint violations.

There is also a tab widget, that checks and displays all the constrain 
violations in an ontology, called the FacetConstraintsTab:

> When creating instances there is still a lot of room for making 
> mistakes when entering data.
> For example the slots that are mandatory can kept empty and will be 
> saved. I would expect that it isn't possible to save without completing
> the mandatory slots.
This is something desirable, but it should not be enforced. An ontology 
is usually developed in a step-wise manner, and there are stages in 
which not all the value fields are filled, but the user would still want 
to save the ontology and to be able to continue the work at some other time.

However, you can enforce this behavior if you want, by implementing your 
own project plugin, that will check before the save whether there are 
any constraints violations and notify the user about them.

I hope this answers your questions.


> Thanks in advance for a reply.
> With kind regards,
> Nafiye
> ------------------------------------------------------------------------
> Blijf onderweg online met Windows Live for Mobile! Download 't nu op 
> jouw mobiele telefoon. <>
> ------------------------------------------------------------------------
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at
> Instructions for unsubscribing: 

More information about the protege-discussion mailing list