Code Monkey home page Code Monkey logo

Comments (3)

gkellogg avatar gkellogg commented on June 24, 2024

Yes, this is confusing. The RDF to Microdata spec uses a registry to determine if values should be in a list or not; as it ends up, Google doesn't actually make use of this, but it creates an RDF signature that looks like the following:

@prefix md: <http://www.w3.org/ns/md#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfa: <http://www.w3.org/ns/rdfa#> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<> md:item (<AllCareCorp>);
   rdfa:usesVocabulary schema: .

<AllCareCorp> a schema:Corporation;
   schema:review [
     a schema:Review;
     schema:creator ([
         a schema:Person;
         schema:name "John Doe";
         schema:worksFor [
           a schema:Organization;
           schema:name "A Company"
         ]
       ]);
     schema:reviewBody "\"We get everything on time.\""
   ],  [
     a schema:Review;
     schema:creator ([
         a schema:Person;
         schema:name "Jane Doe";
         schema:worksFor [
           a schema:Organization;
           schema:name "Another Company"
         ]
       ]);
     schema:reviewBody "\"Amazing Team.\""
   ] .

As a result, the value is an rdf:List, which contains a single schema:Person, so the linter is complaining that rdf:List (and superclass rdfs:Resource) are not in the range of schema:creator, which they aren't.

Arguably, the schema.org data model should allow a list to be in range if every member of that list is in range. This is not without precedent, as similar logic is used to validate schema:Role.

Also, a future version of the Microdata to RDF spec may change the registry to use the published schema.org JSON-LD context instead, in which case we would be consistent with how schema.org actually defines properties such as schema:creator.

I'll make this a feature request to change the schema.org content model to allow this, although the change will go in another library.

from linter.

moderndeveloperllc avatar moderndeveloperllc commented on June 24, 2024

Thank you for your detailed explanation. Everytime I think I have a good handle on structured web data, a new layer of the onion if revealed :-) As these are textual reviews, I'll switch over to author for now as that appears to carry the same semantic meaning in this context.

from linter.

gkellogg avatar gkellogg commented on June 24, 2024

Released in version 1.1.2 now live.

from linter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.