Returns list of SHACL constraints from test suite as resources
import NodeShapesPromise, { NodeShapesMapPromise } from 'shacl-test-as-object';
(async () => {
const NodeShapes = await NodeShapesPromise;
const NodeShapesMap = await NodeShapesMapPromise;
for (const shape of NodeShapes) {
/* Run test operation on shape here */
}
const shape = NodeShapesMap['http://datashapes.org/sh/tests/core/complex/personexample.test#PersonShape']
/* Run test operation on specific shape */
})();
Each of the resolved shapes conforms to the rdf-object.js Resource
API.
import { ProxiedNodeShapes, ProxiedNodeShapesMapPromise } from 'shacl-test-as-object';
(async () => {
const NodeShapes = await ProxiedNodeShapes;
const NodeShapesMap = await ProxiedNodeShapesMapPromise;
for (const shape of NodeShapes) {
/* Run test operation on shape here */
}
const shape = NodeShapesMap['http://datashapes.org/sh/tests/core/complex/personexample.test#PersonShape']
/* Run test operation on specific shape */
})();
Each of the resolved shapes conforms to the rdf-object-proxy ProxiedResource
API.
For further examples refer the test suite for this library.
getNodeShapes
and getProxiedNodeShapes
can be used if one wishes to manually supply the path to the manifest file. See the get test suite for usage.
Inferenced versions of these objects are also exposed. Inferencing is performed using sparql-inferenced over the SHACL ontology, and these specific shacl inferences.
The inferenced shapes can be accessed similarly to the other objects
import { InferencedProxiedNodeShapes, InferencedProxiedNodeShapesMapPromise } from 'shacl-test-as-object';
(async () => {
const NodeShapes = await InferencedProxiedNodeShapes;
const NodeShapesMap = await InferencedProxiedNodeShapesMapPromise;
for (const shape of NodeShapes) {
/* Run test operation on shape here */
}
const shape = NodeShapesMap['http://datashapes.org/sh/tests/core/complex/personexample.test#PersonShape']
/* Run test operation on specific shape */
})();
©2021–present Jesse Wright, MIT License.