-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Question if PR will be accepted #3
Comments
Hi, it depends on whether the thing names are case-sensitive, in which case I'd be happy to accept a PR to change this. |
Thanks for your quick response @BenMorel . I should have done this research before but it looks like Schema is case-sensitive so we shouldn't change this. This is from Google Note: Schema.org markup can be used on web pages written in any language. The markup, like HTML, is in English. Schema.org values are case-sensitive.. What do you think is the best way for me to solve this? It will be hard but maybe I can parse the HTML before I send it to the ThingsConverter and look for all |
I'm still not sure what they understand by values. I'd rather try to find this information on https://schema.org/ if it exists! Otherwise, TBH I'm not sure what value case-sensitivity brings, I mean, nobody will ever create a But let's first be 100% sure that it's supposed to be case-sensitive, before introducing a setting. Also please test the output of the Google Structured Data Testing Tool and Yandex Structured data validator to see how they behave with a lowercase Report your findings here, and we'll decide what to do! |
I agree. Don't see why we should completely dismiss the item if it's a little bit misspelled. Maybe go with just checking The Yandex tool was down for me but with Google Structured Data Testing Tool it does recognize Personally I don't think that this needs a setting because it's pretty clear that they have tried to put in structured data and Google are accepting it as well. |
I can confirm that Google handles it case-insensitively. I could not find a better source for case sensitivity, but this link says:
I think it could make sense to make case sensitivity an option, still. |
I agree that a config wouldn't hurt but I think default should be case-insensitively. Where do you think a config like this should reside? Do you then find it sufficient to "only" build up the preg_match string depending on this config at ThingsConverter like $pattern = $caseInsensitively ? '[a-zA-z0-9]' : '[A-Za-z0-9]';
if (preg_match("/https?\:\/\/schema.org\/([{$pattern}]+)$/", $schemaOrgId, $matches) === 1) {
//
} |
This would probably have to go into
Which isn't super efficient, but it'll get the job done. I guess the best way to make it configurable would be to have the config live as a property on |
Hi guys.
Not sure how I can request a feature before I build it to see if it will be accepted. At ThingConverter you are doing the right thing when ignoring a type of
https://schema.org./product
with a lowercase first letter.Unfortunately I'm crawling a site that do not respect the full schema.org contract and are using a lowercase first letter. If I change the preg_match in ThingsConverter to
preg_match('/https?\:\/\/schema.org\/([a-zA-z0-9]+)$/', $schemaOrgId, $matches) === 1
it all works because now it doesn't have to be an uppercase first letter.Would this be OK otherwise I will have to extend the package by creating my own
SchemaReader
and ownThingsConverter
which would be fine but would you accept this change?Thanks for a great package!
The text was updated successfully, but these errors were encountered: