Mercurial > code > home > repos > light9
changeset 1358:6ea2e1aa5070
uriValue support
Ignore-this: e54fadb2968d9c5a260fd7c4d1857e91
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sun, 05 Jun 2016 09:20:49 +0000 |
parents | 49f80544a3fb |
children | 39aa22c3bf0f |
files | light9/web/graph.coffee |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/web/graph.coffee Sun Jun 05 09:20:02 2016 +0000 +++ b/light9/web/graph.coffee Sun Jun 05 09:20:49 2016 +0000 @@ -289,19 +289,22 @@ throw new Error("no value for "+s+" "+p) when 1 obj = quads[0].object - return N3.Util.getLiteralValue(obj) + return obj else throw new Error("too many values: " + JSON.stringify(quads)) floatValue: (s, p) -> - parseFloat(@_singleValue(s, p)) + parseFloat(N3.Util.getLiteralValue(@_singleValue(s, p))) stringValue: (s, p) -> - @_singleValue(s, p) + N3.Util.getLiteralValue(@_singleValue(s, p)) uriValue: (s, p) -> + @_singleValue(s, p) objects: (s, p) -> + quads = @graph.findByIRI(s, p) + return (q.object for q in quads) subjects: (p, o) ->