forked from crs4/rocrate-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Checks for rules about Responsible Project #27
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
01ab430
first commit for set 1 of rules
EttoreM 7ff5c9d
Added extra tests
EttoreM 0122c79
Made test 'five-safes-crate:AgentProjectIntersection' in 'must/1_requ…
EttoreM ac46c75
Changed the Copyright
EttoreM 2d2d882
Added tests for ruleset 1
EttoreM a123045
Made line long shorter
EttoreM e17cece
Made line long shorter 2
EttoreM c184c6a
Amended inconsistency with names
EttoreM 5cea22e
Addresses Eli's comments
EttoreM 779022a
removed white spaces from blank line.
EttoreM 964ff31
Addressed Eli's and Doug's comments.
EttoreM 72077b7
Addressed class of members of reponsible project.
EttoreM 1e5d8c6
Addressed class of members of reponsible project 2.
EttoreM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
rocrate_validator/profiles/five-safes-crate/may/1_responsible_project.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Copyright (c) 2025 eScience Lab, The University of Manchester | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| @prefix ro: <./> . | ||
| @prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> . | ||
| @prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> . | ||
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
| @prefix schema: <http://schema.org/> . | ||
| @prefix sh: <http://www.w3.org/ns/shacl#> . | ||
| @prefix validator: <https://github.com/crs4/rocrate-validator/> . | ||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
|
||
|
|
||
| five-safes-crate:ResponsibleProject | ||
| a sh:NodeShape ; | ||
| sh:name "Responsible Project" ; | ||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:prefixes ro-crate:sparqlPrefixes ; | ||
| sh:select """ | ||
| SELECT DISTINCT ?this WHERE { | ||
| ?action a schema:CreateAction ; | ||
| schema:agent ?agent . | ||
| ?agent schema:memberOf ?this . | ||
| } | ||
| """ | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "funding" ; | ||
| sh:path schema:funding; | ||
| sh:minCount 1 ; | ||
| sh:severity sh:Info ; | ||
| sh:message """The Responsible Project does not have the property `funding`.""" ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "member" ; | ||
| sh:path schema:member; | ||
| sh:minCount 1 ; | ||
| sh:severity sh:Info ; | ||
| sh:message """The Responsible Project does not have the property `member`.""" ; | ||
| ] . |
82 changes: 82 additions & 0 deletions
82
rocrate_validator/profiles/five-safes-crate/must/1_requesting_agent.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # Copyright (c) 2025 eScience Lab, The University of Manchester | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| @prefix ro: <./> . | ||
| @prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> . | ||
| @prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> . | ||
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
| @prefix schema: <http://schema.org/> . | ||
| @prefix sh: <http://www.w3.org/ns/shacl#> . | ||
| @prefix validator: <https://github.com/crs4/rocrate-validator/> . | ||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
|
||
|
|
||
| five-safes-crate:AgentIsMemberOf | ||
| a sh:NodeShape ; | ||
| sh:name "Requesting Agent" ; | ||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:prefixes ro-crate:sparqlPrefixes ; | ||
| sh:select """ | ||
| SELECT DISTINCT ?this WHERE { | ||
| ?action a schema:CreateAction ; | ||
| schema:agent ?this . | ||
| } | ||
| """ | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "memberOf" ; | ||
| sh:path schema:memberOf; | ||
| sh:class schema:Project ; | ||
| sh:severity sh:Violation ; | ||
| sh:message """The 'memberOf' property of an agent MUST be of type Project.""" ; | ||
| ] . | ||
|
|
||
|
|
||
| five-safes-crate:AgentProjectIntersection | ||
| a sh:NodeShape ; | ||
| sh:name "Agent Project Intersection" ; | ||
| sh:description """At least one Project referenced by Agent -> memberOf MUST be included in the set of Projects referenced by RootDataEntity -> sourceOrganization.""" ; | ||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:prefixes ro-crate:sparqlPrefixes ; | ||
| sh:select """ | ||
| SELECT DISTINCT ?this WHERE { | ||
| ?action a schema:CreateAction ; | ||
| schema:agent ?this . | ||
| } | ||
| """ | ||
| ] ; | ||
| sh:sparql [ | ||
| a sh:SPARQLConstraint ; | ||
| sh:name "Agent Project Intersection" ; | ||
| sh:description """At least one Project referenced by Agent -> memberOf MUST be included in the set of Projects referenced by RootDataEntity -> sourceOrganization.""" ; | ||
| sh:prefixes ro-crate:sparqlPrefixes ; | ||
| sh:select """ | ||
| SELECT $this WHERE { | ||
| FILTER EXISTS { | ||
| $this schema:memberOf ?anyProject . | ||
| } | ||
| FILTER NOT EXISTS { | ||
| $this schema:memberOf ?commonProject . | ||
| ?metadata schema:about ?root . | ||
| ?root schema:sourceOrganization ?commonProject . | ||
| } | ||
| } | ||
| """ ; | ||
| sh:severity sh:Violation ; | ||
| sh:message """At least one Project referenced by Agent -> memberOf MUST be included in the set of Projects referenced by RootDataEntity -> sourceOrganization.""" ; | ||
| ] . |
59 changes: 59 additions & 0 deletions
59
rocrate_validator/profiles/five-safes-crate/must/1_responsible_project.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Copyright (c) 2025 eScience Lab, The University of Manchester | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| @prefix ro: <./> . | ||
| @prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> . | ||
| @prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> . | ||
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
| @prefix schema: <http://schema.org/> . | ||
| @prefix sh: <http://www.w3.org/ns/shacl#> . | ||
| @prefix validator: <https://github.com/crs4/rocrate-validator/> . | ||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
|
||
|
|
||
| five-safes-crate:ResponsibleProject | ||
| a sh:NodeShape ; | ||
| sh:name "Responsible Project" ; | ||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:prefixes ro-crate:sparqlPrefixes ; | ||
| sh:select """ | ||
| SELECT DISTINCT ?this WHERE { | ||
| ?action a schema:CreateAction ; | ||
| schema:agent ?agent . | ||
| ?agent schema:memberOf ?this . | ||
| } | ||
| """ | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "funding" ; | ||
| sh:path schema:funding; | ||
| sh:class schema:Grant ; | ||
| sh:severity sh:Violation ; | ||
| sh:message """The property 'funding' of the Responsible Project MUST be of type schema:Grant.""" ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "member" ; | ||
| sh:path schema:member; | ||
| sh:or ( | ||
| [ sh:class schema:Organization ] | ||
| [ sh:class schema:Person ] | ||
| ) ; | ||
| sh:severity sh:Violation ; | ||
| sh:message """The property 'member' of the Responsible Project MUST be of type schema:Organization or schema:Person.""" ; | ||
| ] . | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
rocrate_validator/profiles/five-safes-crate/should/1_responsible_project.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Copyright (c) 2025 eScience Lab, The University of Manchester | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| @prefix ro: <./> . | ||
| @prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> . | ||
| @prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> . | ||
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
| @prefix schema: <http://schema.org/> . | ||
| @prefix sh: <http://www.w3.org/ns/shacl#> . | ||
| @prefix validator: <https://github.com/crs4/rocrate-validator/> . | ||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
|
||
|
|
||
| five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection | ||
| a sh:NodeShape ; | ||
| sh:name "Organizations (members of Responsible Project)" ; | ||
| sh:description """At least one of the organisations that are members of the responsible project SHOULD be included in the Requesting Agent's affiliations, if such properties exist.""" ; | ||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:prefixes ro-crate:sparqlPrefixes ; | ||
| sh:select """ | ||
| SELECT DISTINCT ?this WHERE { | ||
| ?action a schema:CreateAction ; | ||
| schema:agent ?this . | ||
| ?this a schema:Person ; | ||
| schema:memberOf ?project ; | ||
| schema:affiliation ?someAffiliation . | ||
| ?project schema:member ?org2 . | ||
| } | ||
| """ | ||
| ] ; | ||
| sh:sparql [ | ||
| a sh:SPARQLConstraint ; | ||
| sh:name "Intersection with agent affiliations" ; | ||
| sh:description """At least one of the organisations that are members of the responsible project SHOULD be included in the Requesting Agent's affiliations, if such properties exist.""" ; | ||
|
|
||
| sh:prefixes ro-crate:sparqlPrefixes ; | ||
| sh:select """ | ||
| SELECT $this WHERE { | ||
| FILTER NOT EXISTS { | ||
| $this schema:affiliation ?org . | ||
| $this schema:memberOf ?project . | ||
| ?project schema:member ?org . | ||
| } | ||
| } | ||
| """ ; | ||
| sh:severity sh:Warning ; | ||
| sh:message """At least one of the organisations that are members of the responsible project SHOULD be included in the Requesting Agent's affiliations, if such properties exist.""" ; | ||
| ] . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.