Questions tagged [shex]

ShEx (Shape Expressions) is a language to describe RDF graph structures. It can be used for validation, traversal and transformation of RDF graphs.

The Shape Expressions (ShEx) language describes RDF nodes and graph structures. A node constraint describes an RDF node (IRI, blank node or literal) and a shape describes the triples involving nodes in an RDF graph. These descriptions identify predicates and their associated cardinalities and datatypes. ShEx shapes can be used to communicate data structures associated with some process or interface, generate or validate data, or drive user interfaces.

Syntaxes

ShEx has an abstract syntax which can be expressed in a

  • Compact syntax (ShExC) - terse, human-readable representation of RDF schemas,
  • JSON-LD syntax (ShExJ) - a JSON representation with an @context,
  • RDF syntaxes (ShExR) - any equivalent to the JSON-LD interpretation of ShExJ.

Documentation

  • ShEx specification - defines the syntax of a ShEx schema and the semantics of testing RDF data against that schema.
  • ShapeMap specification - defines the selection of node/shape pairs for validation.
  • Primer - an introduction to ShEx
8 questions
4
votes
2 answers

Why isn't a ShEx constant matching the same term in the data?

I have a ShEx schema expecting a specific type: epri:VariableShape { a st:studyVariable ; st:subject [tax:~] ; st:signal xsd:decimal } which rejects data with that type st:envFactorEMF a st:studyVariable ; # << this isn't recognized …
teach stem
  • 132
  • 6
4
votes
1 answer

How do state multiple type constraints in ShEx?

If I have data like @prefix my: my:student1 a my:Student . my:student1 a my:FoodballPlayer . my:teacher2 a my:Teacher . my:teacher2 a my:BaseballPlayer . my:teacher2 a my:RugbyPlayer . and I want to say the subjects are either…
Andra
  • 687
  • 2
  • 9
  • 20
1
vote
1 answer

How to test for RDF language tags in ShEx?

I would like to test for language tags in a Shape Expression (ShEx). When testing for a string I usually use the following shape like to use { ex:label xsd:string ; } the following shape works for a set of language tags { …
Andra
  • 687
  • 2
  • 9
  • 20
1
vote
1 answer

How to automatically extract Shape Expressions from RDF triples?

I've started using shape expression do describe Resource Description Framework (RDF) models. How can I extract a draft ShEx from an RDF sample, such as: a wp:DataNode ,…
Egon Willighagen
  • 1,621
  • 4
  • 19
  • 36
1
vote
1 answer

SHACL/ShEX constraint to make a property to build a hierarchy (i.e. a tree)

I have very little knowledge of SHACL and ShEx. I've been reading about them and to figure out whether I could create constraints over a property to make it define a hierarchy (i.e. a tree-like structure). I guess what I'm looking for is a way to…
andrefs
  • 555
  • 4
  • 14
1
vote
1 answer

What is the correct way of validating RDF with Shex when part of the IRIs are in the Triple Store?

Say that I want to validate insertion of a company promotion in a triple Store using Shex. A possible approach would be to code Shex as in: :Promotion { my-onto:has_person @:Person ; my-onto:grants_role @:Role ; } :Person { a [ foaf:Person…
tonicebrian
  • 4,715
  • 5
  • 41
  • 65
0
votes
1 answer

ShEx Validation - reason and appInfo are null in Result Shape Map

I am learning ShEx and using 'shexjava API' done by http://shexjava.lille.inria.fr/ for my project. I have schema, data graph and fixed shape map. When I validate using refine and recursive validation, I am getting ResultShapeMap but the reason and…
M Prabodha
  • 70
  • 9
0
votes
1 answer

How do you allow not foreseen properties in RDF when performing Shex validation?

We are creating our Shex definition files checking that some IRIs are of a given type. There is no problem with our generated code but sometimes we get files generated using Protege and most of the individuals are of type X plus owl:NamedIndividual,…
tonicebrian
  • 4,715
  • 5
  • 41
  • 65