Sha256: 11a1c26fa15f5a557ced141dac151e76fbe0e65b43cf1fda3fa21ff17f4c6b7a

Contents?: true

Size: 706 Bytes

Versions: 6

Compression:

Stored size: 706 Bytes

Contents

module Spread2RDF
  module Mapping
    module Statement

      def statements_to_object(object)
        case schema.statement_mapping_mode
          when :default
            statement(subject, predicate, object)
          when :restriction
            restriction_class = RDF::Node.new
            statements(
                [ subject, RDF::RDFS.subClassOf, restriction_class ],
                [ restriction_class, RDF.type, RDF::OWL.Restriction ],
                [ restriction_class, RDF::OWL.onProperty, predicate ],
                [ restriction_class, schema.restriction_mode, object ]
            )
        end
      end
      private :statements_to_object
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spread2rdf-0.1.3 lib/spread2rdf/mapping/statement.rb
spread2rdf-0.1.2 lib/spread2rdf/mapping/statement.rb
spread2rdf-0.1.1 lib/spread2rdf/mapping/statement.rb
spread2rdf-0.1.0 lib/spread2rdf/mapping/statement.rb
spread2rdf-0.0.2 lib/spread2rdf/mapping/statement.rb
spread2rdf-0.0.1 lib/spread2rdf/mapping/statement.rb