Skip to content

Commit

Permalink
When explaining domain and range issues, include both schema and sche…
Browse files Browse the repository at this point in the history
…mas versions.
  • Loading branch information
gkellogg committed Feb 27, 2021
1 parent 55f447d commit 024857b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/rdf/reasoner/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ def lint
((messages[:property] ||= {})[pname] ||= []) << if !term.domain.empty?
"Subject #{show_resource(stmt.subject)} not compatible with domain (#{Array(term.domain).map {|d| d.pname|| d}.join(',')})"
else
"Subject #{show_resource(stmt.subject)} not compatible with domainIncludes (#{term.domainIncludes.map {|d| d.pname|| d}.join(',')})"
domains = Array(term.domainIncludes) +
Array(term.properties[:'https://schema.org/domainIncludes'])
"Subject #{show_resource(stmt.subject)} not compatible with domainIncludes (#{domains.map {|d| d.pname|| d}.join(',')})"
end
end

Expand All @@ -300,7 +302,9 @@ def lint
((messages[:property] ||= {})[pname] ||= []) << if !term.range.empty?
"Object #{show_resource(stmt.object)} not compatible with range (#{Array(term.range).map {|d| d.pname|| d}.join(',')})"
else
"Object #{show_resource(stmt.object)} not compatible with rangeIncludes (#{term.rangeIncludes.map {|d| d.pname|| d}.join(',')})"
ranges = Array(term.rangeIncludes) +
Array(term.properties[:'https://schema.org/rangeIncludes'])
"Object #{show_resource(stmt.object)} not compatible with rangeIncludes (#{ranges.map {|d| d.pname|| d}.join(',')})"
end
end
end
Expand Down

0 comments on commit 024857b

Please sign in to comment.