Hi Arthur,

In your example, unit:DegreeFahrenheit is tried to be used as a datatype, whereas it is actually an instance. TBC uses a Manchester Syntax parser, for Manchaster-Syntax style "visualizations" like OWL 2 user-defined datatypes. In your example, this produced an exception, most probably because the instance is tried to be used as a datatype. (Actually, the exception is too cryptic to catch this, so we will try to produce a more user-friendly exception in a later release)

I attached a small ontology with examples of OWL 2 user-defined datatypes in ranges and restrictions. Please display system classes and system properties from Preferences to be able to see some of the example resources in the Classes and Properties views.

The OWL 2 user-defined (advanced) datatypes are also described here.
http://www.w3.org/TR/owl2-primer/#Advanced_Use_of_Datatypes

To choose a syntax for easier reading of the examples, please look at the following link:
http://www.w3.org/TR/owl2-primer/#OWL_Syntaxes

As far as I have seen, QUDT doesn't contain OWL 2 user-defined datatypes, so please create your own like the one's I did or like the one's from the link.

Gokhan



On 10/5/2010 9:32 AM, Arthur Keen wrote:
I am using TBCME 3.3.2 on Mac OS-X 10.6.4 and QUDT delivered with Topbraid

I would like to add value constraints on properties using qudt unit types. For example, on owl:DatatypeProperty casingTemperature with rdfs:range unit:DegreeFahrenheit I would like to specify that the temperature range greater than zero, so I tried to create a range constraint (a) and then a local restriction (b) on the class for casingTemperature. In both cases, TBCME parses the input field on input and toggles the input text from red to black text at the last ']' as expected, however when I click 'OK', TBCME throws an exception.

a) unit:DegreeFahrenheit[>0] on the property range, and
b) casingTemperature only unit:DegreeFahrenheit[>0]
Is this a bug?
This seemed like a reasonable approach, but given the exception, should I rather express the constraints using xsd:Double[>0]? The icon on unit:DegreeFahrenheit has a "D" on it, so is it an extension of an xsd:Double?

Regards
Arthur

*The Exception:*

java.lang.reflect.InvocationTargetException
at org.topbraid.core.change.AbstractChangeEngine.execute(AbstractChangeEngine.java:282) at org.topbraidcomposer.core.change.TBCChangeEngine.execute(TBCChangeEngine.java:172) at org.topbraidcomposer.core.change.TBCChangeEngine$1.run(TBCChangeEngine.java:142) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) Caused by: org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:519) at org.topbraid.core.change.AbstractChangeEngine.execute(AbstractChangeEngine.java:268)
... 3 more
Caused by: java.lang.IllegalStateException: we failed to create the object: org.topbraid.owl.man.parser.ParseException: Encountered ".
Was expecting one of:

at org.topbraidcomposer.change.lib.ReplaceObjectChange.execute(ReplaceObjectChange.java:53) at org.topbraid.core.change.ChangeOperation.execute(ChangeOperation.java:105) at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:511)
... 4 more
Caused by: org.topbraid.owl.man.parser.ParseException: Encountered ".
Was expecting one of:

at org.topbraid.owl.man.parser.ManchesterSyntaxParser.generateParseException(ManchesterSyntaxParser.java:1416) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLDataRangeFacet(ManchesterSyntaxParser.java:882) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLDataRangeRestriction(ManchesterSyntaxParser.java:836) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLDataRange(ManchesterSyntaxParser.java:792) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLRestrictionOrNamedClass(ManchesterSyntaxParser.java:312) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLComplementClass(ManchesterSyntaxParser.java:291) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLIntersectionClass(ManchesterSyntaxParser.java:242) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLXORClass(ManchesterSyntaxParser.java:209) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLUnionClass(ManchesterSyntaxParser.java:176) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.parseFile(ManchesterSyntaxParser.java:167) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.parseClass(ManchesterSyntaxParser.java:149) at org.topbraid.change.ClassObjectProvider.getObject(ClassObjectProvider.java:29) at org.topbraidcomposer.widgets.row.editors.ClassEditorText$1.getObject(ClassEditorText.java:99) at org.topbraidcomposer.change.lib.AbstractReplaceObjectChange.replaceObject(AbstractReplaceObjectChange.java:113) at org.topbraidcomposer.change.lib.ReplaceObjectChange.execute(ReplaceObjectChange.java:49)
... 6 more
Root exception:
org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:519) at org.topbraid.core.change.AbstractChangeEngine.execute(AbstractChangeEngine.java:268) at org.topbraidcomposer.core.change.TBCChangeEngine.execute(TBCChangeEngine.java:172) at org.topbraidcomposer.core.change.TBCChangeEngine$1.run(TBCChangeEngine.java:142) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) Caused by: java.lang.IllegalStateException: we failed to create the object: org.topbraid.owl.man.parser.ParseException: Encountered ".
Was expecting one of:

at org.topbraidcomposer.change.lib.ReplaceObjectChange.execute(ReplaceObjectChange.java:53) at org.topbraid.core.change.ChangeOperation.execute(ChangeOperation.java:105) at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:511)
... 4 more
Caused by: org.topbraid.owl.man.parser.ParseException: Encountered ".
Was expecting one of:

at org.topbraid.owl.man.parser.ManchesterSyntaxParser.generateParseException(ManchesterSyntaxParser.java:1416) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLDataRangeFacet(ManchesterSyntaxParser.java:882) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLDataRangeRestriction(ManchesterSyntaxParser.java:836) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLDataRange(ManchesterSyntaxParser.java:792) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLRestrictionOrNamedClass(ManchesterSyntaxParser.java:312) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLComplementClass(ManchesterSyntaxParser.java:291) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLIntersectionClass(ManchesterSyntaxParser.java:242) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLXORClass(ManchesterSyntaxParser.java:209) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.OWLUnionClass(ManchesterSyntaxParser.java:176) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.parseFile(ManchesterSyntaxParser.java:167) at org.topbraid.owl.man.parser.ManchesterSyntaxParser.parseClass(ManchesterSyntaxParser.java:149) at org.topbraid.change.ClassObjectProvider.getObject(ClassObjectProvider.java:29) at org.topbraidcomposer.widgets.row.editors.ClassEditorText$1.getObject(ClassEditorText.java:99) at org.topbraidcomposer.change.lib.AbstractReplaceObjectChange.replaceObject(AbstractReplaceObjectChange.java:113) at org.topbraidcomposer.change.lib.ReplaceObjectChange.execute(ReplaceObjectChange.java:49)
... 6 more

--
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
# Saved by TopBraid on Tue Oct 05 15:45:35 PDT 2010
# baseURI: http://example.org/test/tsm/2010-10-05/qudt

@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tsm-qudt:  <http://example.org/test/tsm/2010-10-05/qudt#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

<http://example.org/test/tsm/2010-10-05/qudt>
      rdf:type owl:Ontology ;
      owl:versionInfo "Created with TopBraid Composer"^^xsd:string .

tsm-qudt:DegreeFahrenheit
      rdf:type rdfs:Datatype ;
      owl:equivalentClass
              [ rdf:type rdfs:Datatype ;
                owl:onDatatype xsd:double ;
                owl:withRestrictions
                        ([ xsd:minExclusive "0"^^xsd:double
                          ])
              ] .

tsm-qudt:DegreeFahrenheit2
      rdf:type rdfs:Datatype ;
      rdfs:subClassOf xsd:double .

tsm-qudt:casingTemperature
      rdf:type owl:DatatypeProperty ;
      rdfs:range
              [ rdf:type rdfs:Datatype ;
                owl:onDatatype tsm-qudt:DegreeFahrenheit ;
                owl:withRestrictions
                        ([ xsd:minExclusive "1"^^xsd:double
                          ])
              ] ;
      rdfs:range
              [ rdf:type rdfs:Datatype ;
                owl:onDatatype tsm-qudt:DegreeFahrenheit2 ;
                owl:withRestrictions
                        ([ xsd:minExclusive "0"^^xsd:double
                          ])
              ] .

owl:Thing
      rdfs:subClassOf
              [ rdf:type owl:Restriction ;
                owl:allValuesFrom
                        [ rdf:type rdfs:Datatype ;
                          owl:onDatatype tsm-qudt:DegreeFahrenheit ;
                          owl:withRestrictions
                                  ([ xsd:minExclusive "9"^^xsd:double
                                    ])
                        ] ;
                owl:onProperty tsm-qudt:casingTemperature
              ] ;
      rdfs:subClassOf
              [ rdf:type owl:Restriction ;
                owl:allValuesFrom
                        [ rdf:type rdfs:Datatype ;
                          owl:onDatatype tsm-qudt:DegreeFahrenheit2 ;
                          owl:withRestrictions
                                  ([ xsd:minExclusive "4"^^xsd:double
                                    ])
                        ] ;
                owl:onProperty tsm-qudt:casingTemperature
              ] .

[]    rdf:type rdfs:Datatype ;
      owl:onDatatype <http://data.nasa.gov/qudt/owl/unit#DegreeFahrenheit> .

[]    rdf:type rdfs:Datatype ;
      owl:onDatatype owl:Thing .

[]    rdf:type rdfs:Datatype ;
      owl:onDatatype tsm-qudt:DegreeFahrenheit .

[]    rdf:type rdfs:Datatype ;
      owl:onDatatype tsm-qudt:DegreeFahrenheit .

Reply via email to