robrwo / SemanticWeb-Schema

8 stars 3 forks source link

fix error that could not be `use SemanticWeb::Schema::Place` #3

Closed takaya1992 closed 4 years ago

takaya1992 commented 4 years ago

Hi @robrwo

Please review the PR.

Problem

When SemanticWeb::Schema::Place was used, an error occurred and use failed

You cannot overwrite a locally defined method (has_map) with a predicate at /Users/xxxxxxx/develop/SemanticWeb-Schema/local/lib/perl5/MooX/JSON_LD.pm line 133.

Reason

predicate option of Moo set this to just 1, the predicate is automatically named has_${attr_name}. cf. https://metacpan.org/pod/Moo#predicate

Place - Schema.org ( lib/SemanticWeb/Schema/Place.pm ) has has_map & map properties.

https://github.com/robrwo/SemanticWeb-Schema/blob/e7d00a3c8d1c3df0ca08e1104674bea6d67056ce/lib/SemanticWeb/Schema/Place.pm#L711-L734 https://github.com/robrwo/SemanticWeb-Schema/blob/e7d00a3c8d1c3df0ca08e1104674bea6d67056ce/lib/SemanticWeb/Schema/Place.pm#L875-L896

The has_map property of schema.org and the has_map property that is automatically generated with the predicate option for map propery is conflict.

robrwo commented 4 years ago

Good catch. I'll take a look at this.

takaya1992 commented 4 years ago

Thank you for merging