This repository was archived by the owner on Oct 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
This repository was archived by the owner on Oct 22, 2025. It is now read-only.
Figure out a pattern for cutting down noisy validation errors #39
Copy link
Copy link
Open
Description
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%
)
)
)+
}
Metadata
Metadata
Assignees
Labels
No labels