Module: Hydra::ContentNegotiation

Defined in:
app/models/concerns/hydra/content_negotiation.rb,
app/models/hydra/content_negotiation/graph_finder.rb,
app/models/hydra/content_negotiation/fedora_uri_replacer.rb,
app/models/hydra/content_negotiation/clean_graph_repository.rb,
app/models/hydra/content_negotiation/replacing_graph_finder.rb

Defined Under Namespace

Classes: CleanGraphRepository, FedoraUriReplacer, GraphFinder, ReplacingGraphFinder

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(document) ⇒ Object



3
4
5
6
7
# File 'app/models/concerns/hydra/content_negotiation.rb', line 3

def self.extended(document)
  document.will_export_as(:nt, "application/n-triples")
  document.will_export_as(:jsonld, "application/ld+json")
  document.will_export_as(:ttl, "text/turtle")
end

Instance Method Details

#export_as_jsonldObject



13
14
15
# File 'app/models/concerns/hydra/content_negotiation.rb', line 13

def export_as_jsonld
  clean_graph.dump(:jsonld, :standard_prefixes => true)
end

#export_as_ntObject



9
10
11
# File 'app/models/concerns/hydra/content_negotiation.rb', line 9

def export_as_nt
  clean_graph.dump(:ntriples)
end

#export_as_ttlObject



17
18
19
# File 'app/models/concerns/hydra/content_negotiation.rb', line 17

def export_as_ttl
  clean_graph.dump(:ttl)
end