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:
<subject_id> <http://example.com/cti#ObjectStatus "active"^^<http://example.
com/cti#ObjectStatusVocab> .
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?
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.