lib/rdf/reasoner/schema.rb in rdf-reasoner-0.4.4 vs lib/rdf/reasoner/schema.rb in rdf-reasoner-0.5.0

- old
+ new

@@ -5,11 +5,11 @@ module RDF::Reasoner ## # Rules for generating RDFS entailment triples # - # Extends `RDF::Vocabulary::Term` with specific entailment capabilities + # Extends `RDF::URI` with specific entailment capabilities module Schema ## # Schema.org requires that if the property has a domain, and the resource has a type that some type matches some domain. # @@ -52,11 +52,11 @@ # @param [Hash{Symbol => Object}] options ({}) # @option options [Array<RDF::Vocabulary::Term>] :types # Fully entailed types of resource, if not provided, they are queried def range_compatible_schema?(resource, queryable, options = {}) raise RDF::Reasoner::Error, "#{self} can't get ranges" unless property? - if respond_to?(:rangeIncludes) && !(ranges = Array(self.rangeIncludes) - [RDF::OWL.Thing]).empty? + if !(ranges = Array(self.rangeIncludes) - [RDF::OWL.Thing]).empty? if resource.literal? ranges.any? do |range| case range when RDF::RDFS.Literal then true when RDF::Vocab::SCHEMA.Text then resource.plain? || resource.datatype == RDF::Vocab::SCHEMA.Text @@ -183,8 +183,8 @@ compact end end end - # Extend the Term with this methods - ::RDF::Vocabulary::Term.send(:include, Schema) + # Extend URI with this methods + ::RDF::URI.send(:include, Schema) end \ No newline at end of file