Skip to content

Instantly share code, notes, and snippets.

@ericprud
Last active May 12, 2021 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericprud/e82f51ed74a463a55711019059514ac8 to your computer and use it in GitHub Desktop.
Save ericprud/e82f51ed74a463a55711019059514ac8 to your computer and use it in GitHub Desktop.
Schema.org to ShExR to ShExJ to ShExC
BASE <http://localhost/checkouts/shexSpec/shex.js/packages/shex-webapp/doc/shex-simple.html>
<S1> {
<http://schema.org/url> . +
%<https://example.org/extension/dummy>{console.log('some url checking code here')%}
} AND {
<http://schema.org/datePublished> . ?
} AND {
<http://schema.org/claimReviewed> .
} AND {
<http://schema.org/itemReviewed> {
<rdf:type> [<file:///Users/solbrig/git/hsolbrig/shexrtoj/data/danbri/danbri.ttl>]
} AND (NOT {
<rdf:type> [<file:///Users/solbrig/git/hsolbrig/shexrtoj/data/danbri/danbri.ttl>]
} OR {
<http://schema.org/author> ({
<rdf:type> [<http://schema.org/Organization>]
} OR {
<rdf:type> [<http://schema.org/Person>]
}) AND (NOT ({
<rdf:type> [<http://schema.org/Organization>]
} OR {
<rdf:type> [<http://schema.org/Person>]
}) OR {
<http://schema.org/name> . ?
})?
} AND {
<http://schema.org/datePublished> . ?
})?
} AND {
<http://schema.org/author> ({
<rdf:type> [<http://schema.org/Organization>]
} OR {
<rdf:type> [<http://schema.org/Person>]
}) AND (NOT ({
<rdf:type> [<http://schema.org/Organization>]
} OR {
<rdf:type> [<http://schema.org/Person>]
}) OR ({
<http://schema.org/name> .
} OR {
<http://schema.org/url> .
}) AND {
<http://schema.org/url> . *
%<https://example.org/extension/dummy>{console.log('some url checking code here')%}
})?
} AND {
<http://schema.org/reviewRating> {
<rdf:type> [<http://schema.org/Rating>]
} AND (NOT {
<rdf:type> [<http://schema.org/Rating>]
} OR {
<http://schema.org/alternateName> .
} AND ((NOT {
<http://schema.org/name> .
} OR {
<http://schema.org/alternateName> . ?
}) AND (NOT (NOT {
<http://schema.org/name> .
}) OR {
<http://schema.org/alternateName> . +
})) AND NOT ({
<http://schema.org/alternateName> .
} AND {
<http://schema.org/name> .
}) AND (NOT (({
<http://schema.org/ratingValue> .
} OR {
<http://schema.org/bestRating> .
} OR {
<http://schema.org/worstRating> .
}) AND NOT ({
<http://schema.org/ratingValue> /-1/
} AND {
<http://schema.org/bestRating> /-1/
} AND {
<http://schema.org/worstRating> /-1/
})) OR {
<http://schema.org/ratingValue> /([0-9]+[\.,]?[0-9]*)\/([0-9]+[\.,]?[0-9]*)/ OR /([0-9]+[\.,]?[0-9]*)%/ OR /([0-9]+[\.,]?[0-9]*)/ +
} AND (NOT {
<http://schema.org/ratingValue> /([0-9]+[\.,]?[0-9]*)/ +
} OR {
<rdf:type> [<file:///Users/solbrig/git/hsolbrig/shexrtoj/data/danbri/danbri.ttl>]
})))+
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment