structured-data / linter

Structured Data linter
The Unlicense
88 stars 18 forks source link

@en not compatible with range (ogc:url) messages for image:secure_url, og:url and og:image #49

Closed webcoder-eu closed 4 years ago

webcoder-eu commented 4 years ago

Hi,

Why am I getting these "property... @en not compatible with range (ogc:url)" messages when testing my domain?

Domain: https://webcoder.eu

http://linter.structured-data.org/?url=https:%2F%2Fwebcoder.eu

image:secure_url, og:url and og:image are allowed hence am puzzled.

Thanks, David Screenshot_2019-11-22 Structured Data Linter

gkellogg commented 4 years ago

Without looking at your page source, I suspect that you are setting a Lang attribute (or @language in JSON-LD) and the property value is being interpreted as a text string, rather than a URI. If using JSON-LD, either don’t set @language, at least for that property, or better yet, use the expanded value form {“@id”: “https://...”}. If using Microdata or RDFa, use an href attribute.

gkellogg commented 4 years ago

But, the linter/reasoner, could probably figure out to ignore the language in this case.

webcoder-eu commented 4 years ago

Correct, when remove lang="en"' from <html lang="en"> it's not complaining anymore. Am doing reseach on whether removing is a good thing for google.

Many thanks

webcoder-eu commented 4 years ago

hmm... now html is not validating nicely as before so will rather ignore linter/reasoner and live with its messages or try to get around it somehow - am new to this so need to figure what you said above out and apply.

Screenshot 2019-11-22 at 21 30 58
gkellogg commented 4 years ago

This looks like the line that's causing the problem:

<meta property="og:image:secure_url" content="https://webcoder.eu/assets/img/logosocial.jpg">

The problem is that meta interprets context as text, you could consider using a link element:

<link property="og:image:secure_url" href="https://webcoder.eu/assets/img/logosocial.jpg">

That interprets the value as a URL and should avoid the problem (and is really the right thing to do).

Of course, given that it's an image, you could also use an img element.

webcoder-eu commented 4 years ago

Changed it ti <link ... href=...> as above but unfortunately it's still complaining about other bits. At least HTML is validatinng now. Thank you.

Linter Messages

class ogc:url: No class definition found

property og:url: Object "https://webcoder.eu/"@en not compatible with range (ogc:url)

property og:image: Object "https://webcoder.eu/assets/img/logosocial.jpg"@en not compatible with range (ogc:url)

Screenshot_2019-11-22 Structured Data Linter(1)

webcoder-eu commented 4 years ago

I don't quite understand why a valid HTML lang is affecting it

webcoder-eu commented 4 years ago

Only one message left after changing all tags containing urls to <link... href=

Linter Messages class ogc:url: No class definition found

Screenshot_2019-11-22 Structured Data Linter(2)

Screenshot 2019-11-22 at 22 38 57

webcoder-eu commented 4 years ago

but now my og appears to be broken

Screenshot 2019-11-22 at 22 41 11

gkellogg commented 4 years ago

I can’t really debug your markup for you, but the messages seem reasonable. Of course, it’s only advisory, and you may ignore it.

The linter uses semantic reasoning to make these determinations, based on the definitions of the vocabulary terms you use.

tacsup commented 2 years ago

In my website also similar issue facing Home page error RDF::ReaderError: Statement #<RDF::Statement:0x7a0f8(nil nil nil .)> is incomplete on linter

my web url : https://www.tacsllc.com/ please help

marcoscazaux commented 1 year ago

The correct solution is add the "prefix" property to html tag. <html lang="en" prefix="og: https://ogp.me/ns#">