Introduction

sheXer receives an RDF graph, a bunch of configurations params and it gives back ShEx schemata associated to groupings of nodes within the graph.

This webapp is an online demo of sheXer . You can provide an RDF grpah in several ways, select your target individuals to build shapes, tune some config values and then get the inferred shapes. This demo does not allow you to compute huge graphs nor to configure every option of sheXer . To reach the full potential of the tool you may prefer to install the library sheXer, which is available for Python. This webapp and the library itself are prototypes under development. You can follow its updates, report bugs or make any suggestion at the sheXer github reposiroty.

The way to use the code and the meaning of each config param is documented in the repository of sheXer. Installation instructions are available in the repository as well.

Instructions about how to configure each field of this online demo are available at the bottom of this page.

In case you want to work against the Wikidata endpoint, press the following button to fill the configuration params with some recomended values:

Input

Introduce yout RDF grpah here:

Graph input format:

Choose a way to provide a remote graph:

Remote Graph
SPARQL endpoint
Graph input format:

Target shapes

All classes mode
Target classes:
Shape map:
Instantiation property:

Configuration parameters

Threshold:
Namespaces to ignore:
Infer type of unlabelled objects
All compliant mode
Discard useless constraints
Keep less specific constraints

Results

Instructions

Data input

Choose the RDF graph which is going to be analyzed. You have several ways to provide it:

  • Just copy and paste some RDF content in the tab Raw input.*
  • Provide some URL in which we can dowload RDF your target RDF content in the field Remote Graph of the tab Remote input .*
  • Provide the URL of a SPARQL endpoint in the field SPARQL endpoint of the tab Remote input . In this case we will not use the whole content retrievable through the endpoint but just a subgraph related with the elements whose shape you want. In this demo, that subgraph consist of elements directly linked with the target nodes used to build each shape. However, if you use the Python library you can configure that behaviour.

* You will be asked as well to specify the RDF syntax used.

Target shapes

Choose the shapes that you want to automatically extract. You can do this in several ways:

  • Provide the URIs of some target classes. The instances of those classes will be used to extract the corresponding shapes. To do this, provide a comma separated list of classes in the field Target classes.*
  • If you want to get the shape for every class in your graph, there is no need to list all the URIs. Just select All classes mode and sheXer will extract a shape for each element with at least one instance.*
  • You can make any custom node aggrupations out of the class-instances model to get shapes. You should provide a shape map in the field Shape map in order to define those aggrupations. Check here the structure and syntax of shape maps. All classes mode is compatible with this option. If you provide a shape map and select All classes mode as well, sheXer will extract shapes for both your custom agruppations and for every class with instances in the graph. *

* By default, sheXer assumes that A is instance of B if there is a triple (A, rdf:type, B). But you can set a property different to rdf:type in the field Instantiation property .

Configuration params

This demo online includes some parameters to tune the way in which sheXer should extract the shapes.

  • Namespaces to ignore: you can provide here a comma-separated list of namespaces. All the triples whose predicate is a property of one of these namespaces will be ignored. IMPORTANT: sheXer will discard properties which are DIRECT children of the namespaces. Ex: if you set this param with , then triples with the property will be ignored, but triples with will not.
  • Threshold: Frequently the extracted constraints are not compatible with all the nodes asociated to a givne shape. This param allow you to specify the minimun ratio [0,1] of instances that should be compilant with a given constraint for this to appear in the final shape. A value of 0 will not filter any constraint. A value of 1 will filter every constraint not compliant with all the nodes associated to a shape.
  • Infer type of unlabelled elements: when parsing the rdf grpah, a literal such as "1"^^xsd:integer can be clearly recognized as an integer. But some data include numbers or some other kind of entities not wo well labelled. If you activate this option, sheXer will try to recognize integers, floats and some special literals on its own, even is they are not labelled as so.
  • All compliant mode: by default, sheXer tries to extract constraints as precise as posible regarding cardinality, even if they are not compliant with all the nodes related to a shape, but just a big enough ratio of them. This produce shapes useful from an informative point of view, but will cause that some of the nodes used to extract the shape are not 100% with that shape. If you activate this option, every constraint which is not compliant with all the target nodes will be serialized with a kleene closure, so every node can be positively evaluated against it.
  • Discard useless constraintsSome constraints subseme others regarding cardinality. Every shape node compliant with a constraint with cardinality {2,3}, will be compliant with a positive closure (+) and with a Kleene closure (*), but not the other way arround. If you set this optionts, contraints that subsumes others (so they are less precise) which have the same ratio of compliance will be discarded even from the comments.
  • Keep less specific constraints: If this option is selected, when shaxer extract two constraints in which one subsumes the other due to cardinality and they have the same ratio, it will keep the less specific one (commonly a positive closure) in the shape.