lib/rdf/ldp/non_rdf_source.rb in rdf-ldp-0.3.0 vs lib/rdf/ldp/non_rdf_source.rb in rdf-ldp-0.4.0
- old
+ new
@@ -15,11 +15,11 @@
# @see RDF::LDP::Resource
# @see http://www.w3.org/TR/ldp/#dfn-linked-data-platform-non-rdf-source for
# a definition of NonRDFSource in LDP
class NonRDFSource < Resource
# Use DC elements format
- FORMAT_TERM = RDF::DC11.format
+ FORMAT_TERM = RDF::Vocab::DC11.format
DESCRIBED_BY_TERM = RDF::URI('http://www.w3.org/2007/05/powder-s#describedby')
##
# @return [RDF::URI] uri with lexical representation
# 'http://www.w3.org/ns/ldp#NonRDFSource'
@@ -48,18 +48,19 @@
# @see RDF::LDP::Resource#create
def create(input, c_type)
storage.io { |io| IO.copy_stream(input.binmode, io) }
super
self.content_type = c_type
- RDFSource.new(description_uri, @data).create('', 'text/plain')
+ RDFSource.new(description_uri, @data).create('', 'application/n-triples')
self
end
##
# @see RDF::LDP::Resource#update
def update(input, c_type)
storage.io { |io| IO.copy_stream(input.binmode, io) }
+ super
self.content_type = c_type
self
end
##
@@ -68,13 +69,9 @@
#
# @see RDF::LDP::Resource#destroy
def destroy
storage.delete
super
- end
-
- def etag
- "#{Digest::SHA1.base64digest(storage.io.read)}"
end
##
# @raise [RDF::LDP::NotFound] if the describedby resource doesn't exist
#