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

Lessons of using sh:or #10

Open
zhurui0509 opened this issue Oct 16, 2021 · 0 comments
Open

Lessons of using sh:or #10

zhurui0509 opened this issue Oct 16, 2021 · 0 comments

Comments

@zhurui0509
Copy link
Contributor

zhurui0509 commented Oct 16, 2021

There are several ways of using sh:or in our shapes, the main two are:

sh:or (
		sh:property [
		    rdfs:comment "An Observation has to have at least one phenomenon time or result time."@en ;
			sh:path sosa:phenomenonTime ;
	 	sh:minCount 1 ; 
			] 

		sh:property [
		    rdfs:comment "An Observation has to have at least one phenomenon time or result time."@en ;
			sh:path sosa:resultTime ;
		 	sh:minCount 1 ;
			]	 
	) ;
     sh:or  (    
		    [
			sh:path sosa:phenomenonTime ;
		 	sh:minCount 1 ;
			] 
			[
			sh:path sosa:resultTime ;
			sh:minCount 1 ;
			] 		   
	 ) ;

I believe the correct way is 2 based on SHACL documentation. I tested it both using (1). GraphDB, (2). SHACL Playground, and (3). pyshacl. the 2 works for both (1) and (2). It does not work for pyshacl (i.e., need to have both, so it is like sh:and) probably because their implementation is not correct (has to deeply check and create an issue for them if so).

The 1 is also tested on (1), (2), and (3), none works.

So I removed sh:or from ObservationConstraint, and updated a TimeConstraint.ttl (for the sake of adding a rdfs:comment). It can then be applied to both Observation and ObservationCollection.

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

1 participant