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
st:subject tax:1758 ;
st:signal -.00043 .
(demo) Why would that be?
The error message from the demo that you linked to actually describes the exact problem.
Error validating http://www.epri.com/studies/3002011786studyVariable as {"type":"NodeConstraint","datatype":"http://www.epri.com/studies/3002011786studyVariable"}: mismatched datatype: http://www.epri.com/studies/3002011786studyVariable is not a literal with datatype http://www.epri.com/studies/3002011786studyVariable
You're using a datatype constraint, which isn't what you want.
You need to use a [ st:studyVariable ]
, instead, since you want to specify a value set:
epri:VariableShape {
a [ st:studyVariable ];
st:subject [tax:~] ;
st:signal xsd:decimal
}
Joshua Taylor's answer is spot on but, since this is the most common mistake in ShEx, I thought I'd elaborate with a little ascii art.
ShEx datatypes are expressed as bare IRIs while value sets are expressed in []s
. You had an rdf:type
of st:studyVariable
:
epri:VariableShape {
a st:studyVariable ; # <-- datatype
st:subject [tax:~] ; # <-- value set
st:signal xsd:decimal # <-- datatype
}
when you wanted a (small) value set of st:studyVariable
:
epri:VariableShape {
a [st:studyVariable] ; # <-- value set
st:subject [tax:~] ; # <-- value set
st:signal xsd:decimal # <-- datatype
}
(demo)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With