Arthur, you can write a SPIN constraint and get constraint violation
warnings in SPARQLMotion or Composer's UI.

-- Scott

On May 20, 12:48 pm, Arthur Keen <[email protected]> wrote:
> Thanks for the help.  I have one more question though:
>
> I created an SSN_Type and assigned to the range of a datatype property 
> 'hasSSN' on class Person.  Composer does not validate the format on the value 
> of the hasSSN property.  It allows me to type in any value, for example "not 
> an ssn".  I was expecting Composer to dynamically validate the formatting as 
> it does with the xsd:date and xsd:datetime properties.  
>
> The SSN_Type:
>
>   <rdfs:Datatype rdf:ID="SSN_Type">
>     <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string";
>     >SSN_Type</rdfs:label>
>     <owl:equivalentClass>
>       <rdfs:Datatype>
>         <owl:onDatatype 
> rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
>         <owl:withRestrictions rdf:parseType="Collection">
>           <rdf:Description>
>             <xsd:pattern 
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string";
>             >[0-9]{3}-[0-9]{2}-[0-9]{4}</xsd:pattern>
>           </rdf:Description>
>         </owl:withRestrictions>
>       </rdfs:Datatype>
>     </owl:equivalentClass>
>   </rdfs:Datatype>
>
> The SSN_Type on hasSSN range:
>
>   <owl:FunctionalProperty rdf:ID="hasSSN">
>     <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
>     <rdfs:domain rdf:resource="#Person"/>
>     <rdfs:range rdf:resource="#SSN_Type"/>
>   </owl:FunctionalProperty>
>
> The instance:
>   <Person rdf:ID="Person_4">
>     <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string";
>     >Person_4</rdfs:label>
>     <hasSSN rdf:datatype="http://www.w3.org/2001/XMLSchema#string";
>     >not an ssn</hasSSN>
>   </Person>
>
> On May 20, 2010, at 12:20 AM, Holger Knublauch wrote:
>
>
>
> > Arthur,
>
> > one way of doing this is:
>
> > 1) Create a subclass of rdfs:Resource, e.g. SSNType
> > 2) Change the rdf:type of that to rdfs:Datatype
> > 3) On the owl:equivalentClass field, type in:
>
> >    xsd:string[pattern "d{3}-d{2}-d{4}"]
>
> > Or enter this as rdfs:subClassOf.
>
> > Cheers,
> > Holger
>
> > On May 20, 2010, at 3:03 PM, Arthur Keen wrote:
>
> >> I would like to create a social security type to demonstrate the creation 
> >> of new types in composer and demonstrate the use of xsd:pattern
>
> >> I found 2 different examples, one from w3c and the other from a blog and 
> >> they are different, and that is fine, because I only need one of them to 
> >> work.  How does one create a structure like the W3C example in Composer?
>
> >> #From w3c
> >> Declaration( Datatype( a:SSN ) )
> >> DatatypeDefinition(
> >> a:SSN
> >> DatatypeRestriction( xsd:string xsd:pattern "[0-9]{3}-[0-9]{2}-[0-9]{4}" )
> >> )
>
> >> DataPropertyRange( a:hasSSN a:SSN )
>
> >> #from a blog
> >> <SocialSecurityDatatype>
> >>   rdfs:label "Social Security Type"@en ;
> >>   owl:equivalentClass [
> >>      a rdfs:Datatype ;
> >>      owl:onDatatype xsd:string ;
> >>      owl:withRestrictions ([xsd:pattern "d{3}-d{2}-d{4}"])
> >>   ] .
>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Group "TopBraid Suite Users", the topics of which include TopBraid 
> >> Composer,
> >> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> >> To post to this group, send email to
> >> [email protected]
> >> To unsubscribe from this group, send email to
> >> [email protected]
> >> For more options, visit this group at
> >>http://groups.google.com/group/topbraid-users?hl=en
>
> > --
> > You received this message because you are subscribed to the Google
> > Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
> > TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> > To post to this group, send email to
> > [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/topbraid-users?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/topbraid-users?hl=en

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

Reply via email to