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
We should have documentation showing how to set this up for (a) static serving (b) docker serving, and a live installation of at least one of these.
Background
The original demos used server side processing for 3 things:
headless browser, so that JS-injected markup can be extracted
URL fetching, since a web page can't retrieve arbitrary URLs
Some simple python/Flask to map URL paths to file paths, HTML template-based generation, and also to JSON-ify a representation of the examples.
The whole thing can be run as a docker container but it would be good to have a simplified pure static version that could be run by anyone very easily. To do this:
convert file-mapping and JSONifying steps into pre-publication file management i.e. serve the shacl, shex, Turtle and JSON files the same way we serve up JS, CSS and HTML statically.
Make a simple HTML page from templates/scc.html etc.
Document the apps configuration API i.e. the files it needs to load, and which are currently served by app.py and basic_app.py Flash python server example.
I made a first attempt at the documentation below.
Draft documentation
Config API
SchemaramaJS configures itself with various files loaded from relative URIs:
/shacl/shapes - an aggregation of SHACL shape definitions.
/shacl/subclasses - a Turtle file listing rdfs:subClassOf relationships.
/shex/shapes - an aggregation of ShEx shape definitions.
/hierarchy - a JSON description that groups shape definitions in a hierarchy of associated services/projects.
/services/map - JSON associating services from hierarchy with shapes and patterns from SHACL and ShEx.
/tests - a JSON list of tests, where each is a piece of text using JSON-LD, RDFa, Microdata.
It will also typically serve icons associated with the hierarchy of services, e.g. initial demo uses:
/static/images/services/Schema.png
/static/images/services/ServiceA.png
/static/images/services/ServiceB.png
/static/images/services/ServiceBProduct1.png
/static/images/services/ServiceBProduct2.png
/static/images/services/ServiceBProduct3.png
/static/images/services/ServiceC.png
/static/images/services/ServiceD.png
Config details
The original demo shows a mix of shapes - some basic structures from Schema.org's definitions, and some associated with example online services. SchemaramaJS will try to load these upon initialization.
/shacl/shapes
This can be quite large, e.g. looking at headers using
This data file reproduces rdfs:subClassOf assertions from relevant schemas. It is in Turtle format, and is not tightly linked to SHACL, except by the fact that only the SHACL validator uses it; it is not passed to ShEx validator during setup. In principle it could be used for other purposes, and we could change the file/url path accordingly.
In demo configuration, it is every subtype-supertype relationship defined in schema.org (and therefore note sometimes a type has multiple supertypes). Here are the lines relating to the ComedyClub type:
SchemaramaJS loads a JSON configuration file defining a hierarchy of services/applications that can be associated with the various validations being checked. In turn this file can include image URLs.
SchemaramaJS also uses a JSON service mapping file, which associates validation shapes (named in common across
SHACL and ShEX) with the services described in /services:
Possible diagnosis and fix for this not running: we're using very simple static HTTP servers that aren't sending the right media type headers for things that are in JSON (or any format for that matter).
We should have documentation showing how to set this up for (a) static serving (b) docker serving, and a live installation of at least one of these.
Background
The original demos used server side processing for 3 things:
The whole thing can be run as a docker container but it would be good to have a simplified pure static version that could be run by anyone very easily. To do this:
I made a first attempt at the documentation below.
Draft documentation
Config API
SchemaramaJS configures itself with various files loaded from relative URIs:
It will also typically serve icons associated with the hierarchy of services, e.g. initial demo uses:
Config details
The original demo shows a mix of shapes - some basic structures from Schema.org's definitions, and some associated with example online services. SchemaramaJS will try to load these upon initialization.
/shacl/shapes
This can be quite large, e.g. looking at headers using
We get a large dump of SHACL in RDF/Turtle syntax.
/shacl/shex
Similarly, here we are served (in demo configuration):
Similarly, for the ShEx version we get a large dump of ShEx in ShExJ syntax.
/shacl/subclasses
curl -s -D - http://127.0.0.1:3002/shacl/subclasses
This data file reproduces rdfs:subClassOf assertions from relevant schemas. It is in Turtle format, and is not tightly linked to SHACL, except by the fact that only the SHACL validator uses it; it is not passed to ShEx validator during setup. In principle it could be used for other purposes, and we could change the file/url path accordingly.
In demo configuration, it is every subtype-supertype relationship defined in schema.org (and therefore note sometimes a type has multiple supertypes). Here are the lines relating to the ComedyClub type:
/hierarchy
SchemaramaJS loads a JSON configuration file defining a hierarchy of services/applications that can be associated with the various validations being checked. In turn this file can include image URLs.
Demo config is this:
/services/map
SchemaramaJS also uses a JSON service mapping file, which associates validation shapes (named in common across
SHACL and ShEX) with the services described in /services:
/tests
Finally, SchemaramaJS loads a collection of example tests, each is an appropriately escaped text value,
structured in a very plain JSON file:
No additional metadata is included; SchemaramaJS will try to figure out how to parse it.
Config-using Validator code
These files are all loaded by static/js/scc/core.js:
The text was updated successfully, but these errors were encountered: