Skip to content

Conversation

@pvgenuchten
Copy link
Contributor

@pvgenuchten pvgenuchten commented Mar 28, 2025

this adds methods get_first and get_all to get elm or get list
and fixes some parse errors

schema.org has a 0-N cardinality for most of its properties, if the value is single, the actual value is returned, if it is multiple a list of elements is returned

These utility functions provide option to grab the first or all elements, while checking their type to be literal or list, get-all returns list, get-first returns literal

some samples:

either fetch the json-ld from the html or open it in https://validator.schema.org/

@pvgenuchten pvgenuchten requested a review from tomkralidis March 28, 2025 19:32
* fix export to schem-org

* Update __init__.py

* Update __init__.py

* Update __init__.py

---------

Co-authored-by: Tom Kralidis <[email protected]>
@pvgenuchten pvgenuchten force-pushed the improve-schema-org branch from 5132291 to b6ab6a0 Compare May 23, 2025 09:11
@tomkralidis
Copy link
Member

Closing in lieu of #263. @pvgenuchten feel free to re-open as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants