File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/org/linkeddatafragments/servlet Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 29
29
import com .hp .hpl .jena .rdf .model .RDFNode ;
30
30
import com .hp .hpl .jena .rdf .model .Resource ;
31
31
import com .hp .hpl .jena .rdf .model .ResourceFactory ;
32
+ import com .hp .hpl .jena .shared .InvalidPropertyURIException ;
32
33
33
34
/**
34
35
* Servlet that responds with a Basic Linked Data Fragment.
@@ -174,8 +175,14 @@ private Resource parseAsResource(String value) {
174
175
* @return the parsed value, or null if unspecified
175
176
*/
176
177
private Property parseAsProperty (String value ) {
177
- final RDFNode predicate = parseAsNode (value );
178
- return predicate instanceof Resource ? ResourceFactory .createProperty (((Resource )predicate ).getURI ()) : null ;
178
+ final RDFNode predicateNode = parseAsNode (value );
179
+ if (predicateNode instanceof Resource ) {
180
+ try { return ResourceFactory .createProperty (((Resource )predicateNode ).getURI ()); }
181
+ catch (InvalidPropertyURIException ex ) {
182
+ return ResourceFactory .createProperty ("urn:invalid-predicate-uri" );
183
+ }
184
+ }
185
+ return null ;
179
186
}
180
187
181
188
/**
You can’t perform that action at this time.
0 commit comments