@@ -128,6 +128,7 @@ public void testGetClassExpressions() throws Exception {
128
128
ManchesterOWLSyntaxClassExpressionParser parser =
129
129
new ManchesterOWLSyntaxClassExpressionParser (dataFactory , checker );
130
130
131
+ // Check CURIE
131
132
String template = "C part_of some %" ;
132
133
String value = "obo:UBERON_0000467" ;
133
134
Set <OWLClassExpression > expressions =
@@ -148,6 +149,32 @@ public void testGetClassExpressions() throws Exception {
148
149
for (OWLClassExpression expr : expressions ) {
149
150
assertEquals (exprMatch .toString (), expr .toString ());
150
151
}
152
+
153
+ // Check raw HTTP IRI
154
+ value = "http://purl.obolibrary.org/obo/UBERON_0000467" ;
155
+ expressions = TemplateHelper .getClassExpressions ("" , parser , template , value , 0 , 0 );
156
+ if (expressions .size () != 1 ) {
157
+ fail (String .format ("Expected exactly 1 expression, got %d" , expressions .size ()));
158
+ }
159
+ for (OWLClassExpression expr : expressions ) {
160
+ assertEquals (exprMatch .toString (), expr .toString ());
161
+ }
162
+
163
+ // Check that undeclared prefix fails
164
+ try {
165
+ value = "UNKNOWN:1234" ;
166
+ expressions = TemplateHelper .getClassExpressions ("" , parser , template , value , 0 , 0 );
167
+ fail ("CURIE with undeclared prefix should not be parsed as Manchester expression" );
168
+ } catch (Exception e ) {
169
+ }
170
+
171
+ // Check that gibberish fails
172
+ try {
173
+ value = "http.purl.obolibrary.org/obo/UBERON_0000467" ;
174
+ expressions = TemplateHelper .getClassExpressions ("" , parser , template , value , 0 , 0 );
175
+ fail ("Gibberish value should not be parsed as Manchester expression" );
176
+ } catch (Exception e ) {
177
+ }
151
178
}
152
179
153
180
/**
0 commit comments