Sha256: 90466c06292015a8d84385feddcec546a4f494446aa2e5af64daa2ac5e7f1012

Contents?: true

Size: 497 Bytes

Versions: 39

Compression:

Stored size: 497 Bytes

Contents

module PublishMyData
  class ExampleResource
    include Tripod::Resource
    include BasicFeatures

    field :rdf_type, RDF.type, :multivalued => true, :is_uri => true

    def eager_load!
      eager_load_predicate_triples!(labels_only: true)
      eager_load_object_triples!(labels_only: true)
    end

    def as_ttl
      graph = RDF::Graph.new
      repository.query( [@uri, :predicate, :object] ) do |statement|
        graph << statement
      end
      graph.dump(:ttl)
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
publish_my_data-1.3.25 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.24 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.23 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.22 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.21 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.20 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.19 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.18 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.17 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.16 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.15 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.14 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.13 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.12 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.11 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.10 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.9 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.8 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.7 app/models/publish_my_data/example_resource.rb
publish_my_data-1.3.6 app/models/publish_my_data/example_resource.rb