diff --git a/lib/ontologies_linked_data/serializers/json.rb b/lib/ontologies_linked_data/serializers/json.rb index 59f54a92..de622944 100644 --- a/lib/ontologies_linked_data/serializers/json.rb +++ b/lib/ontologies_linked_data/serializers/json.rb @@ -51,7 +51,7 @@ def self.type(current_cls, hashed_obj) proc = hashed_obj end - collection = hashed_obj.collection + collection = hashed_obj.respond_to?(:collection) ? hashed_obj.collection : nil if collection proc.type_uri(collection).to_s else