-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This pull implements the blocking and staging logics, which are totally independent. - Blocking is implemented through cypher queries, see process.sh lines 56-57. - Staging is the rest. We only care here about the embargo logic of staging. So if we embargo, then, depending on whether we are in the prod or dev stage mode (see Dockerfile), we will embargo different things. The logic corresponds to what was discussed [here](VirtualFlyBrain/neo4j2owl#52). The implementation is realised through two different sets of sparql queries (one for prod, one for dev), which apply differently rigorous embargo rules. The prod queries are unchanged, and the embargo rules in dev are tighter (i.e. less stuff gets embargoed). see #8 see VirtualFlyBrain/neo4j2owl#52
- Loading branch information
Showing
12 changed files
with
157 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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 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,25 @@ | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX n2o: <http://n2o.neo/property/> | ||
PREFIX n2oc: <http://n2o.neo/custom/> | ||
PREFIX dct: <http://purl.org/dc/terms/> | ||
|
||
SELECT DISTINCT ?dataset | ||
|
||
WHERE { | ||
|
||
?dataset n2o:nodeLabel ?nodelabel . # This selects all datasets | ||
OPTIONAL { | ||
?dataset n2oc:production ?production . | ||
# n2oc:production is a bit brittle because IRI might be changed (risk!) | ||
} | ||
|
||
OPTIONAL { | ||
?dataset n2oc:staging ?staged . | ||
} | ||
|
||
IF((staging=false || unbound(staging)) && (prod = false || unbound(prod)) ) -----> EMBARGO | ||
|
||
FILTER( (?production=false || !bound(?production)) && (?staged=false || !bound(?staged)) ) . | ||
FILTER(?nodelabel="DataSet") | ||
} |
File renamed without changes.
This file contains 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,15 @@ | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX n2o: <http://n2o.neo/property/> | ||
PREFIX n2oc: <http://n2o.neo/custom/> | ||
PREFIX dct: <http://purl.org/dc/terms/> | ||
|
||
SELECT ?s ?p ?o . | ||
WHERE { | ||
?s <http://n2o.neo/custom/block> ?blocked . | ||
?s ?p ?o . | ||
FILTER(?blocked=true) . | ||
FILTER(isIRI(?s)) | ||
} | ||
|
||
### EDIT: this was obsoleted in the end in favour of a cypher solution, see process.sh. |
This file contains 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,22 @@ | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX n2o: <http://n2o.neo/property/> | ||
PREFIX n2oc: <http://n2o.neo/custom/> | ||
PREFIX dct: <http://purl.org/dc/terms/> | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
||
|
||
SELECT ?s ?p ?o | ||
WHERE { | ||
?s ?p ?o . | ||
?r rdf:type owl:Axiom ; | ||
owl:annotatedSource ?s ; | ||
owl:annotatedProperty ?p ; | ||
owl:annotatedTarget ?o ; | ||
<http://n2o.neo/custom/block> ?blocked; | ||
?bp ?bo; | ||
|
||
FILTER(?blocked=true) . | ||
} | ||
|
||
### EDIT: this was obsoleted in the end in favour of a cypher solution, see process.sh. |
This file contains 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,29 @@ | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX n2o: <http://n2o.neo/property/> | ||
PREFIX n2oc: <http://n2o.neo/custom/> | ||
PREFIX dct: <http://purl.org/dc/terms/> | ||
|
||
#Delete all ds:DataSet where ds.production is False | ||
#Delete all i:Individual where (ds)-[:has_source]-(i:Individual)<-[:depicts]-(ch:Individual) WHERE ds.production is False | ||
|
||
SELECT DISTINCT ?channel | ||
WHERE { | ||
|
||
?dataset n2o:nodeLabel ?nodelabel . # This selects all datasets | ||
|
||
OPTIONAL { | ||
?dataset n2oc:production ?production . | ||
# n2oc:production is a bit brittle because IRI might be changed (risk!) | ||
} | ||
|
||
OPTIONAL { | ||
?dataset n2oc:staging ?staged . | ||
} | ||
|
||
?image dct:source ?dataset . | ||
?channel <http://xmlns.com/foaf/0.1/depicts> ?image . # There does not always seem to be a channel | ||
|
||
FILTER( (?production=false || !bound(?production)) && (?staged=false || !bound(?staged)) ) . | ||
FILTER(?nodelabel="DataSet") | ||
} |
File renamed without changes.
This file contains 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,26 @@ | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX n2o: <http://n2o.neo/property/> | ||
PREFIX n2oc: <http://n2o.neo/custom/> | ||
PREFIX dct: <http://purl.org/dc/terms/> | ||
|
||
#Delete all ds:DataSet where ds.production is False | ||
#Delete all i:Individual where (ds)-[:has_source]-(i:Individual)<-[:depicts]-(ch:Individual) WHERE ds.production is False | ||
|
||
SELECT DISTINCT ?dataset | ||
WHERE { | ||
|
||
?dataset n2o:nodeLabel ?nodelabel . # This selects all datasets | ||
|
||
OPTIONAL { | ||
?dataset n2oc:production ?production . | ||
# n2oc:production is a bit brittle because IRI might be changed (risk!) | ||
} | ||
|
||
OPTIONAL { | ||
?dataset n2oc:staging ?staged . | ||
} | ||
|
||
FILTER( (?production=false || !bound(?production)) && (?staged=false || !bound(?staged)) ) . | ||
FILTER(?nodelabel="DataSet") | ||
} |
File renamed without changes.
This file contains 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,28 @@ | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX n2o: <http://n2o.neo/property/> | ||
PREFIX n2oc: <http://n2o.neo/custom/> | ||
PREFIX dct: <http://purl.org/dc/terms/> | ||
|
||
#Delete all ds:DataSet where ds.production is False | ||
#Delete all i:Individual where (ds)-[:has_source]-(i:Individual)<-[:depicts]-(ch:Individual) WHERE ds.production is False | ||
|
||
SELECT DISTINCT ?image | ||
WHERE { | ||
|
||
?dataset n2o:nodeLabel ?nodelabel . # This selects all datasets | ||
|
||
OPTIONAL { | ||
?dataset n2oc:production ?production . | ||
# n2oc:production is a bit brittle because IRI might be changed (risk!) | ||
} | ||
|
||
OPTIONAL { | ||
?dataset n2oc:staging ?staged . | ||
} | ||
|
||
?image dct:source ?dataset . | ||
|
||
FILTER( (?production=false || !bound(?production)) && (?staged=false || !bound(?staged)) ) . | ||
FILTER(?nodelabel="DataSet") | ||
} |
File renamed without changes.