In shex, if we define cardinality of a predicate to be 0-1, but in the RDF we have multiple predicates, we receive array of values instead of a single value.
Therefore, the type doesn't match the result.
Expected behavior
We expect LDO object to match type, even if RDF data are inconsistent. Not sure which of the multiple possible values should be chosen in this case.
Example
(omitting prefix definitions)
shape:
ex:FoafProfile EXTRA a {
a [ foaf:Person ] ;
foaf:name xsd:string ? ;
}
In shex, if we define cardinality of a predicate to be 0-1, but in the RDF we have multiple predicates, we receive array of values instead of a single value.
Therefore, the type doesn't match the result.
Expected behavior
We expect LDO object to match type, even if RDF data are inconsistent. Not sure which of the multiple possible values should be chosen in this case.
Example
(omitting prefix definitions)
shape:
data:
result:
Reproduce
You can see a minimal example on codesandbox or run it locally.
The code is here, shape is here and the output is
Originally posted by @mrkvon in https://github.com/o-development/ldo/issues/22#issuecomment-1590228592