Questions tagged [shacl]

Use this tag on questions concerning the Shapes Constraint Language for RDF: SHACL.

SHACL is a language for validating RDF graphs against a set of conditions. These conditions are also expressed in the form of RDF graphs, called "shapes". Beyond validation, shapes may facilitate user interface building, code generation, and data integration.

117 questions
1
vote
3 answers

How to create a Class as equivalent of a Class with defined type of RDF Statements?

I have three classes, let's call them :A, :B and :C and a property :p. Every statement X: :p :Y should become a member of :A, when :X a :B and :Y a :C Currently I'd prefer a solution with OWL, but could be also with SPARQL and/or SHACL.
Ivo Velitchkov
  • 2,361
  • 11
  • 21
0
votes
0 answers

what is the preferred approach to express pure shacl shape inheritance

I have a quick question about the best way to express inheritance between pure shacl shapes. E.g. :aShape a sh:nodeShape . :bshape a sh:nodeShape . Are the following 2 options equivalent, and which one is the reocmmended ? bShape rdfs:subClassOf…
MaatDeamon
  • 9,532
  • 9
  • 60
  • 127
0
votes
0 answers

Given the existence of one property, check for the existence of another using shacl

I want to use shacl to validate if a specific relationship exist, that another relationship exists as well. For example, given the next data with 1 person listing the other 2 as their parent, I want to verify that those parents list the the first…
0
votes
1 answer

Unable to validate and serialize new inferred graph from pyshacl

I'm stuck with a problem and I need your help. I'm working on pyshacl validation, which is a Python library for validating RDF graphs against SHACL graphs. I have a shacl shape graph that has a SPARQL construct clause to create new instances and…
Kuladeep
  • 15
  • 4
0
votes
1 answer

SHACL Rule Condition doesn't seem to get executed before rule execution

I'm using the Apacha Java Jena engine. I want to derive a ex:hasFather relationship by going through all instances of and then seeing if they are the subject of a ex:hasChild relationship. This would be my NodeShape to derive it. I know that I…
brudi4550
  • 562
  • 1
  • 3
  • 19
0
votes
1 answer

SHACL validation with FilerShape

Data Graph: @prefix dash: . @prefix rdf: . @prefix rdfs: . @prefix schema: . @prefix sh:…
JME
  • 27
  • 4
0
votes
1 answer

Is it possible to define a discriminated union in a SHACL schema?

Is it possible to define a discriminated union in a SHACL schema? Here is a contrived example; I only want to enforce the minCount: 1 constraint on the ex:tail property if the ex:type property has the value Dog. ex:Animal a…
hally9k
  • 2,423
  • 2
  • 25
  • 47
0
votes
2 answers

Using shacl to validate a property that has at most one value in its properties

I'm trying to create a shacl based on the ontology that my organization is developing (in dutch): https://wegenenverkeer.data.vlaanderen.be/ The objects described have attributes (properties), that have a specified datatype. The datatype can a…
0
votes
1 answer

Not full error message shown after importing RDF text snippet

I am new to GraphDB. I am trying to use SHACL validation by pasting my shapes into the text field in the "import RDF text snippet" function. The problem I have is that if there is an error not the entire error message is shown. I can see "..." at…
kratzer
  • 3
  • 2
0
votes
1 answer

Can a SHACL NodeShape target an intersection?

Is it possible for a NodeShape to target the intersection of a SHACL-core sh:targetClass and a SHACL-AF sh:target? e.g. this shapes graph: @prefix dash: . @prefix rdf:
justin2004
  • 75
  • 5
0
votes
1 answer

Shacl rule to validate data file for mismatched type

I have a set of Shacl rules to validate the incoming data files. The issue is when the type of a record in the data file mismatches with the Shacl targetClass, no validation will be done and the Shacl validation engine just reports Success. I got a…
0
votes
1 answer

How to construct a SHACL shape using SPARQL

I have a ttl file with this information: ex:Shape1 a sh:NodeShape ; sh:property ex:Property-1 rdfs:label "Shape 1" ex:Property-1 a sh:PropertyShape ; sh:path ex:property1 sh:name "Property 1" ex:property1 a…
agustaf
  • 683
  • 1
  • 6
  • 19
0
votes
2 answers

Make a UNION return a single result in SPARQL

I am trying to query for the sh:description of a property shape, and if there is none, I want to follow the path to a property and get the rdfs:comment (Also for sh:name and rdfs:label). My data looks like the following: ex:File a owl:Class ; a…
agustaf
  • 683
  • 1
  • 6
  • 19
0
votes
1 answer

Simple way to model "inverse cardinality" in SHACL?

We want to transform a UML diagram of an ontology with cardinalities into a SHACL shape to validate if the cardinalities in our data are correct. Let's say we have Author 1 ---first author ---> 1.n Book, the right part is quite easy to model…
Konrad Höffner
  • 11,100
  • 16
  • 60
  • 118
0
votes
1 answer

limit SHACL class to one of the specific types and nothing else

Suppose I have data like: abc:someProperty . a . a . a . I want to…
Bahar
  • 770
  • 5
  • 18