Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Use a better URI matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Mar 30, 2012
1 parent af391d2 commit 091891b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rdfmapper.coffee
Expand Up @@ -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}>"
Expand All @@ -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

Expand Down

0 comments on commit 091891b

Please sign in to comment.