You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I forget the terminology, but the AND/NOT/OR complexity here serves to suppress errors that are downstream of some more fundamental error. @ericprud et al have plans for doing this within ShEx in more standardized ways, so the actual intended shape content doesn't get lost in all the boolean trickery.
PREFIX : <http://schema.org/>
PREFIX validate: <https://google.com/search/validation/valid>
<S1> {
:url . + %validate:url{console.log('some url checking code here')%}
} AND {
:datePublished . ? %validate:date-time{console.log('some datetime checking code here')%}
} AND {
:claimReviewed .
} AND {
:itemReviewed {
a [:CreativeWork]
} AND (
NOT {
a [:CreativeWork]
} OR {
:author (
{
a [:Organization]
} OR {
a [:Person]
}
) AND (
NOT (
{
a [:Organization]
} OR {
a [:Person]
}
) OR {
:name . ?
}
)?
} AND {
:datePublished . ? %validate:date-time{console.log('some datetime checking code here')%}
}
)?
} AND {
:author (
{
a [:Organization]
} OR {
a [:Person]
}
) AND (
NOT (
{
a [:Organization]
} OR {
a [:Person]
}
) OR (
{
:name .
} OR {
:url .
}
) AND {
:url . * %validate:url{console.log('some url checking code here')%}
}
)?
} AND {
:reviewRating {
a [:Rating]
} AND (
NOT {
a [:Rating]
} OR {
:alternateName .
} AND (
(
NOT {
:name .
} OR {
:alternateName . ?
}
) AND (
NOT (
NOT {
:name .
}
) OR {
:alternateName . +
}
)
) AND NOT (
{
:alternateName .
} AND {
:name .
}
) AND (
NOT (
(
{
:ratingValue .
} OR {
:bestRating .
} OR {
:worstRating .
}
) AND NOT (
{
:ratingValue /-1/
} AND {
:bestRating /-1/
} AND {
:worstRating /-1/
}
)
) OR {
:ratingValue /([0-9]+[\.,]?[0-9]*)\/([0-9]+[\.,]?[0-9]*)/ OR /([0-9]+[\.,]?[0-9]*)%/ OR /([0-9]+[\.,]?[0-9]*)/ +
} AND (
NOT {
:ratingValue /([0-9]+[\.,]?[0-9]*)/ +
} OR {
} %validate:rating%
)
)
)+
}
The text was updated successfully, but these errors were encountered:
the idea is that if you're validating something as a CreativeWork and it has a type of Recipe but doesn't actually satisfy Recipe, ShEx won't drown you in errors about every kind of CreativeWork that it fails, but instead it will just tell you why it doesn't satisfy Recipe
(and yes, danbri, i know it's not "failing", but you get the idea)
if y'all think the above description is missing some use case or nuance, let us know
Realistically this might need initially to be done via out-of-band info rather than assuming all the shex from Google carries such details. Hence shapepath / IDs being an issue.
I forget the terminology, but the AND/NOT/OR complexity here serves to suppress errors that are downstream of some more fundamental error. @ericprud et al have plans for doing this within ShEx in more standardized ways, so the actual intended shape content doesn't get lost in all the boolean trickery.
The text was updated successfully, but these errors were encountered: