File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
src/org/linkeddatafragments Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ private int parseAsInteger(String value) {
166
166
*/
167
167
private Resource parseAsResource (String value ) {
168
168
final RDFNode subject = parseAsNode (value );
169
- return subject instanceof Resource ? (Resource )subject : null ;
169
+ return subject == null || subject instanceof Resource ? (Resource )subject : INVALID_URI ;
170
170
}
171
171
172
172
/**
@@ -178,11 +178,9 @@ private Property parseAsProperty(String value) {
178
178
final RDFNode predicateNode = parseAsNode (value );
179
179
if (predicateNode instanceof Resource ) {
180
180
try { return ResourceFactory .createProperty (((Resource )predicateNode ).getURI ()); }
181
- catch (InvalidPropertyURIException ex ) {
182
- return ResourceFactory .createProperty ("urn:invalid-predicate-uri" );
183
- }
181
+ catch (InvalidPropertyURIException ex ) { return INVALID_URI ; }
184
182
}
185
- return null ;
183
+ return predicateNode == null ? null : INVALID_URI ;
186
184
}
187
185
188
186
/**
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ public class CommonResources {
31
31
public final static Property HYDRA_NEXTPAGE = createProperty (HYDRA + "nextPage" );
32
32
public final static Property HYDRA_PREVIOUSPAGE = createProperty (HYDRA + "previousPage" );
33
33
34
+ public final static Property INVALID_URI = createProperty ("urn:invalid" );
35
+
34
36
private final static Property createProperty (String uri ) {
35
37
return ResourceFactory .createProperty (uri );
36
38
}
You can’t perform that action at this time.
0 commit comments