Giter Site home page Giter Site logo

schema's Introduction

Brick

Incubator for PHP components under development.

Build Status Coverage Status License

Once a component reaches sufficient maturity, it will be moved to its own repository and composer package, and enter a beta phase. For this reason, this repository will never contain releases.

The incubator can be included in your project using Composer. Just define the following requirement in your composer.json file:

{
    "require": {
        "brick/brick": "dev-master"
    }
}

Feel free to use the incubator for your own use/research, but please note that the API can, and will, change at any time. Components can also disappear at any time.

schema's People

Contributors

benmorel avatar grahamcampbell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

schema's Issues

Too few arguments to function Brick\Schema\SchemaReader::readHtml()

I am providing html as a string (everything as per example) yet I get thrown error that 2 expected? public function readHtml(string $html, string $url) : array As per documentation, I see nothing regarding $url

`
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Brick\Schema\SchemaReader::readHtml(), 1 passed in C:\wamp64\www\issue\webstore\testing.php on line 31 and exactly 2 expected in C:\wamp64\www\issue\webstore\vendor\brick\schema\src\SchemaReader.php on line 138

1 | 0.0006 | 373632 | {main}( ) | ...\testing.php:0
2 | 3.7949 | 1336704 | Brick\Schema\SchemaReader->readHtml( ) | ...\testing.php:31

`

Question if PR will be accepted

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 own ThingsConverter which would be fine but would you accept this change?

Thanks for a great package!

Embedded review object not surfaced

When running through this example schema (which validates without errors or warnings at validator.schema.org), the returned Car object contains an empty Review object, where I would expect the full review details.

Example schema:

{
  "@context": "https://schema.org",
  "@type": "Car",
  "name": "Citroen C5 Aircross",
  "description": "On the whole, the C5 Aircross remains a practical, comfort-focused offering, now with an improved cabin ambience",
  "review": {
    "@context": "https://schema.org",
    "name": "New Citroen C5 Aircross 2022 review",
    "author": {
      "@type": "Person",
      "name": "John McIlroy",
      "image": "https://media.autoexpress.co.uk/image/private/s--M0Zdgnzr--/v1570031644/autoexpress/dsc_9517_0.jpg"
    },
    "image": "https://media.autoexpress.co.uk/image/private/s--X-WVjvBW--/f_auto,t_content-image-full-desktop@1/v1654788066/autoexpress/2022/06/2022 Citroen C5 Aircross.jpg",
    "dateModified": "2022-06-09T16:30:30+01:00",
    "datePublished": "2022-06-09T16:30:30+01:00",
    "publisher": {
      "@type": "Organization",
      "name": "AutoExpress",
      "logo": {
        "@type": "ImageObject",
        "url": "https://www.autoexpress.co.uk/public/logo-auto-express.svg",
        "height": 93,
        "width": 88
      }
    },
    "reviewRating": {
      "@type": "Rating",
      "bestRating": 5,
      "worstRating": 0,
      "ratingValue": 3.5
    },
    "reviewBody": null
  },
  "brand": { "@type": "Brand", "name": "Citroen" }
}

ThingConvert ignores the @Context

It seems that ThingConvert ignores @context, so the library will fails to read schemas like the following ones:

{
   "@context":"https://schema.org",
   "@graph":[
      {
         "@type":"Organization",
         "@id":"https://example.org/#organization",
         "name":"Acme LTD",
         "url":"https://example.org/",
         "sameAs":[
            
         ]
      }
   ]
}

The reason is that ThingConverts expects a @type that starts with https://schema.org.

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.