Sha256: ce1b8ebd2f921ed9445498dc19723f2f6f8114d2656c008a3afe5cb8dc6bca42

Contents?: true

Size: 722 Bytes

Versions: 4

Compression:

Stored size: 722 Bytes

Contents

module Spread2RDF
  module Schema
    module StatementMapping

      def statement_mapping_mode
        case
          when statement == :none then :ignore
          when predicate.nil?     then :ignore
          when restriction_mode   then :restriction
          else                         :default
        end
      end

      def restriction_mode
        case statement
          when :restriction then RDF::OWL.hasValue
          when Hash         then statement[:restriction]
          else false
        end
      end

      def inverse_mode
        statement == :inverse ||
            ( statement.is_a?(Hash) && statement.try(:fetch, :inverse, false) )
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spread2rdf-0.1.7 lib/spread2rdf/schema/statement_mapping_schema.rb
spread2rdf-0.1.6 lib/spread2rdf/schema/statement_mapping_schema.rb
spread2rdf-0.1.5 lib/spread2rdf/schema/statement_mapping_schema.rb
spread2rdf-0.1.4 lib/spread2rdf/schema/statement_mapping_schema.rb