Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong way to specify or clause #162

Open
umbreak opened this issue Aug 13, 2018 · 1 comment
Open

Wrong way to specify or clause #162

umbreak opened this issue Aug 13, 2018 · 1 comment

Comments

@umbreak
Copy link

umbreak commented Aug 13, 2018

In this line and this other the or clause is wrongly defined and it wouldn't validate against the SHACL schema.

Also happening in this schema.

From the SHACL spec:

When the or target different properties:

ex:OrConstraintExampleShape
	a sh:NodeShape ;
	sh:targetNode ex:Bob ;
	sh:or (
		[
			sh:path ex:firstName ;
			sh:minCount 1 ;
		]
		[
			sh:path ex:givenName ;
			sh:minCount 1 ;
		]
	) .

When it target different values of the same property:

ex:PersonAddressShape
	a sh:NodeShape ;
	sh:targetClass ex:Person ;
	sh:property [
		sh:path ex:address ;
		sh:or (
			[
				sh:datatype xsd:string ;
			]
			[
				sh:class ex:Address ;
			]
		)
	] .
@MFSY
Copy link
Contributor

MFSY commented Aug 13, 2018

Hi,
Thank you for looking at this. I'll use json-ld serialization to illustrate the issue you mentioned.
The following payload is not correct as the 'or' clause is embedded in a sh:property:

{
          "property": [
            {
              "or": [
                {
                  "path": "schema:propertyID",
                  ...
                },
                {
                  "path": "schema:name",
                  ...
                }
              ]
            }
          ]
}

The correct shape for the 'or' clause is:


            {
              "or": [
                {
                  "path": "schema:propertyID",
                  ...
                },
                {
                  "path": "schema:name",
                  ...
                }
              ]
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants