Permalink
Browse files

Use a better URI matcher

  • Loading branch information...
1 parent af391d2 commit 091891b68f3037cc3cca868776600e52012bee8c @bergie committed Mar 30, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 rdfmapper.coffee
View
@@ -2,6 +2,10 @@ cleaner = ///
<http://viejs.org/ns/([a-z]+)>
///
+uriMatcher = ///
+ ^<([a-z\/])>$
+///
+
idToSubject = (id, request) ->
if request.method is 'POST'
return "<#{request.url}#{id}>"
@@ -19,7 +23,7 @@ exports.fromJSONLD = (data) ->
cleaned = cleaner.exec predicate
continue unless cleaned
continue if typeof object is 'object'
- continue if typeof object is 'string' and object.substr(0, 1) is '<'
+ continue if typeof object is 'string' and uriMatcher.exec object
newData[cleaned[1]] = object
newData

0 comments on commit 091891b

Please sign in to comment.