Sha256: b80bdaf319d96187d27723edfcbb34577e88336370f812e966c4a2dada73e3fa

Contents?: true

Size: 981 Bytes

Versions: 1

Compression:

Stored size: 981 Bytes

Contents

require 'spec_helper'
require 'rdf/turtle'

describe RDF::LDP do
  
  let(:anno_ttl) { File.read(fixture_path + '/open_anno_ldp_container.ttl') }
  
  describe '#remove_ldp_triples' do
    it 'graph returned has no ldp triples' do
      graph = RDF::Graph.new
      graph.from_ttl anno_ttl
      expect(graph.count).to eql 39
      result = graph.query [nil, RDF.type, RDF::URI.new("http://www.w3.org/ns/ldp#Container")]
      expect(result.size).to eql 1
      result = graph.query [nil, RDF::URI.new("http://www.w3.org/ns/ldp#contains"), nil]
      expect(result.size).to eql 2
      
      stripped_graph = RDF::LDP.remove_ldp_triples graph
      expect(stripped_graph.count).to eql 29
      result = stripped_graph.query [nil, RDF.type, RDF::URI.new("http://www.w3.org/ns/ldp#Container")]
      expect(result.size).to eql 0
      result = stripped_graph.query [nil, RDF::URI.new("http://www.w3.org/ns/ldp#contains"), nil]
      expect(result.size).to eql 0
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rdf-ldp-0.0.4 spec/helper_spec.rb