Modeling a vocabulary as a user-defined type

13 views
Skip to first unread message

Paul Patrick

unread,
Jul 4, 2017, 11:20:52 AM7/4/17
to TopBraid Suite Users


What I'm trying to do is to model a vocabulary as a restricted set of values, similar to a enum.  While it is easy to define this directly using owl:oneOf directly on the property definition, except that I need to use this same definition on a number of different properties, thus I believe I need to do this as a user-defined data type so that it can be used as a value for a datatype's range.


I think I've gotten close based on the following code below, but when I look at an instance serialized, I see the data type of the selected value is represented as the datatype xsd:string (^^xsd:string).  With a suspicion that it was the value followed by ^^xsd:string, I went into Source Code view in TopQuadrant and changed the "xsd:string" to the datatype "cti:ObjectStatusVocab".  


cti:ObjectStatusVocab
    a rdfs
:Datatype ;
    rdfs
:comment     "Defines the vocabulary that defines the status of an object."@en-US ;
    rdfs
:label       "Object Status Vocabulary"@en-US ;
    rdfs
:subClassOf  rdfs:Resource ;
    owl
:onDatatype   xsd:string ;
    owl
:oneOf        ( "active"^^xsd:string "deprecated"^^xsd:string "revoked"^^xsd:string ) .



That seemed to work as I got the serialization I was looking for:




Does this seem correct?  It does what I'm looking for, but perhaps there is a better way to do this.

When I then tried to do it in the Form view, but the Form editor didn't like the syntax:


["active"^^cti:ObjectStatusVocab","deprecated"^^cti:ObjectStatusVocab, "revoked"^^cti:ObjectStatusVocab]

so still trying to figure out if I'm just doing something wrong or if I've got to use the Source Code view because the Form view doesn't let one enter in anything except primitive types.


Can anyone tell me if I'm doing this correct?


Holger Knublauch

unread,
Jul 4, 2017, 6:57:17 PM7/4/17
to topbrai...@googlegroups.com
Hi Paul,

did I not already respond to a very similar question?

https://groups.google.com/forum/#!msg/topbraid-users/i5pfTbVsd8s/bMLyYtAIBwAJ;context-place=forum/topbraid-users

If this answer doesn't help please clarify whether you can use instances instead?

Thanks,
Holger
--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages