-
-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update BaseType to serialize Identifier property to '@id' in order conform to LD-JSON specification #79
Conversation
… LD-JSON specification
Hey, first of all thanks for your work! I have multiple points so I will try to structure them:
|
Hello, 1&2 - Understood, I'll make those changes
One thought I had would be to create a Let me know if adding Also, in the collaboration document it mentions to document any changes. Would this warrant a mention on the README? I'm also assuming the changelog is automatically updated or otherwise handled during the release process? Thanks! |
Thanks. 😊 I be honest and would like to request a decision by @sebastiandedeyne . I definitely would feel better to handle it optional. Primary to prevent a BC release and I'm not an expert.^^ But before you change anything I hope that Sebastian would have time. And yes, the readme should be adjusted in the PR and the changelog is done by us during release. |
I like your idea, having a flag like that and the checking for it in toArray would likely make the least dramatic changes and keep this backwards compatible. I will await input from @sebastiandedeyne . |
I think the approach of this PR makes sense. Is a flag necessary? What are the odds of someone already using |
The problem is that the |
On one hand, this plugin's "toScript" method outputs LD-JSON - so making this change would play well with the handy auto-generation of templates based on the Schema.org documentation while also adhering with Schema.org's own stance to use the identifier property as the "id" for whichever format you're rendering the data. In LD-JSON's case, that is On the other, by doing this in the current proposal, it would effectively remove "identifier" as a property from the output and that could cause grief to users if they are parsing their output for that property. I imagine though, that my particular usecase is like many others: making Google's schema parser happy. So they probably were using the fix suggested by Issue #59. I await a judgement call from the maintainers. The flag is potentially counter-intuitive to new users but preserves backwards compatibility. I appreciate y'alls input on this! |
@practical42 I'm super happy that you shared this link! I have to get deeper into the differences and standards. My final suggestion would be:
At all I would like to have the transforming logic splitter of the serializer and outputter. I also would like to add this non breaking but prepare the next major release. I also would like to prepare other outputters with this, like microdata or whatever. If this way is accepted and we would do it like this I would request following: |
I am not bothered if you guys would rather handle this internally, its y'alls repo. I would appreciate the author credit where and if appropriate! |
👊 @sebastiandedeyne how would we proceed here? Atm the PR is failing. But how do you want to handle this? |
Hey @practical42 , I'm super sorry for this long delay! The package and it's PR wasn't in my sight the last time and wasn't actively maintained. :( Thanks again for your work, time and all the links/quotes you searched for and posted! <3 |
https://schema.org/identifier
https://schema.org/docs/datamodel.html#identifierBg
This solution tries to address the concerns raised by PR #72 and Issue #59 in a clean way that will not interfere the Schema generation nor require the user to "hack" in the property via
setProperty
. It does this by extending thetoArray
to serialize the "identifier" property as "@id" and remove "identifier".I believe this library only has the
toScript
method to print out the schema, so I am making an assumption here that it is safe to make this modification in thetoArray
method. However, as Schema.org mentions, there are other formats that also have their own URI syntax and each format's syntax should be respected.