npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

shex-test

v2.2.0-alpha.1

Published

Shape Expressions library tests.

Downloads

78

Readme

NPM Version ShapeExpressions Gitter chat https://gitter.im/shapeExpressions/Lobby

shexTest

Directories:

schemas

  • Test schemas in ShExC (.shex), ShExJ (.json) and sometimes SHACL (.shacl).

The ShExC and ShExJ files with the same stem name are equivalent. A ShExC syntax test consists of these steps:

  • parse the ShExC version of the document with some base URI.
  • parse the ShExJ, as JSON; evaluate the values of the following as relative IRIs:
    • values of the start, inclusion, predicate, and datatype properties.
    • shape names (keys in the shapes object).
    • terms in values properties.
  • ensure that no ValueAnd or ValueOr expression contains ValueAnd or ValueOr expressions in the list of valueExprs.
  • the two parsed products should be equivalent, with blank node substitution.

negativeSyntax

These tests violate the ShEx2 grammar.

negativeStrucutre

These tests should raise errors when parsed, noting the rule about nested ValueAnd and ValueOr expressions.

validation

  • Validation tests in a manifest (Turtle - manifest.ttl, ShExJ (obselete primer) - manifest.json).
  • Input data in Turtle (.ttl).
  • Validation returns a ShapeMap capturing which node/shape pairs conform. The expected conformance or non-conformance is captured in the test format as a ValidationTest or ValidationFailure.

A ShEx validator is logic-conformant when it returns success for the tests of type ValidationTest and failure for the tests of type ValidationFailure. A ShEx validator is result-conformant (experimental) when it executes as ValidationTest and produces the same result structure as produced by this procedure:

  • parse the result file as JSON.
  • parse the ShExJ, as JSON; evaluate the values of the following as relative IRIs:
    • values of the node, shape, subject, predicate, and object properties.
  • the two parsed products should be equivalent, with blank node substitution. A ShEx validator is error-conformant (even more experimental) when it executes a ValidationFailure and produces the same result structure as produced by the procedure above.

coverage

One frequently wants to ask "does the test suite include X". One way to test that is to guess by the relatively formulaic filenames and test names in validation/manifest. Another is to "grep" through the JSON representations of the queries for something with the appropriate structure, e.g. using jq to EachOfs that include a pattern with a min cardinality of 0:

(for f in schemas/*.json; do
  jq -e '.[]|..|objects|select(.type=="EachOf").expressions[]|select(.min==0)' $f > /dev/null &&
  echo $f;
  done
)

which yields the files which include this pattern:

schemas/1val1IRIREFExtra1Or.json
schemas/3circularRef1.json
schemas/kitchenSink.json