brick / schema Goto Github PK
View Code? Open in Web Editor NEWSchema.org library for PHP
License: MIT License
Schema.org library for PHP
License: MIT License
Currently there are just the Sub-properties gtin12
, gtin13
, gtin14
, gtin8
readable not the main property gtin
e.g. on Product: https://schema.org/gtin
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!
Interface names are created as is, but may occasionally conflict with PHP reserved words.
We need to figure out what to do in this case.
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
1 | 0.0006 | 373632 | {main}( ) | ...\testing.php:0
2 | 3.7949 | 1336704 | Brick\Schema\SchemaReader->readHtml( ) | ...\testing.php:31
`
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.
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" }
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.