Permalink
Browse files

* AbstractSQLStore was incorrectly putting Literal::Language represen…

…tation rather than value in database.
  • Loading branch information...
1 parent f07a1fd commit 64fe0d38c3a8f429efd84de03c2c9a16066209b4 @gkellogg committed Jan 6, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/rdf_context/store/abstract_sql_store.rb
@@ -691,8 +691,8 @@ def buildLiteralTripleSQLCommand(triple,context)
normalizeTerm(triple.object),
normalizeTerm(context),
triplePattern,
- (triple.object.is_a?(Literal) ? triple.object.lang : NULL),
- (triple.object.is_a?(Literal) ? triple.object.encoding.value.to_s : NULL),
+ (triple.object.is_a?(Literal) && triple.object.lang ? triple.object.lang.to_s : nil),
+ (triple.object.is_a?(Literal) && triple.object.encoding ? triple.object.encoding.value.to_s : nil),
]
end
@@ -709,8 +709,8 @@ def buildTripleSQLCommand(triple,context,quoted)
normalizeTerm(triple.object),
normalizeTerm(context),
triplePattern,
- (triple.object.is_a?(Literal) ? triple.object.lang : NULL),
- (triple.object.is_a?(Literal) ? triple.object.encoding.value.to_s : NULL),
+ (triple.object.is_a?(Literal) && triple.object.lang ? triple.object.lang.to_s : nil),
+ (triple.object.is_a?(Literal) && triple.object.encoding ? triple.object.encoding.value.to_s : nil),
]
else
[

0 comments on commit 64fe0d3

Please sign in to comment.