Skip to content

Commit

Permalink
Merge branch 'dev' into new_docmap_queries
Browse files Browse the repository at this point in the history
  • Loading branch information
eidens committed Oct 5, 2021
2 parents a66df18 + 0718a83 commit df5a070
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 36 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ NEO4J_AUTH=neo4j/sourcedata
NEO4J_dbms_memory_pagecache_size=16G
NEO4J_dbms_memory_heap_max__size=8G
NEO4J_dbms_security_procedures_unrestricted=gds.*
NEO4J_dbms_unmanaged__extension__classes=n10s.endpoint=/rdf

SD_API_URL=https://api.sourcedata.io/
SD_API_USERNAME=
Expand Down
14 changes: 13 additions & 1 deletion deploy/db
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ trap 'on_exit $?' EXIT

log(){
local timestamp=$(date +%Y-%m-%d\ %H:%M:%S)
echo "[deply/db $STAGE_NAME $PERIODICITY $timestamp] $1"
echo "[deploy/db $STAGE_NAME $PERIODICITY $timestamp] $1"
}

load_dotenv(){
Expand Down Expand Up @@ -135,10 +135,22 @@ update_local_neo4j() {
cat sdg/update_close.cql | docker-compose -f docker-compose.deploy.yml run --rm neo4j cypher-shell -a bolt://neo4j:7687 -u neo4j -p $NEO_PASSWORD
}

wait_for_neo4j() {
log "Waiting for neo4j to become available..."
docker-compose -f docker-compose.deploy.yml exec flask dockerize -wait tcp://neo4j:7687 -timeout 360s
if [ $? -ne 0 ]; then
log "neo4j probably failed to start, check the neo4j log for details. Aborting"
exit 1
fi
log "neo4j is available"
}


log "starting docker"
docker-compose -f docker-compose.deploy.yml build
docker-compose -f docker-compose.deploy.yml up -d
wait_for_neo4j


local PERIODICITY=$1
case $PERIODICITY in
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
neo4j:
image: neo4j:4.1
environment:
- NEO4JLABS_PLUGINS=["apoc", "graph-data-science"] #, "n10s"]
- NEO4JLABS_PLUGINS=["apoc", "graph-data-science"]
ulimits:
nofile:
soft: 40000
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
neo4j:
image: neo4j:4.1
environment:
- NEO4JLABS_PLUGINS=["apoc", "graph-data-science", "n10s"]
- NEO4JLABS_PLUGINS=["apoc", "graph-data-science"]
ulimits:
nofile:
soft: 40000
Expand Down
2 changes: 1 addition & 1 deletion production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
neo4j:
image: neo4j:4.1
environment:
- NEO4JLABS_PLUGINS=["apoc", "graph-data-science"] #, "n10s"]
- NEO4JLABS_PLUGINS=["apoc", "graph-data-science"]
ulimits:
nofile:
soft: 40000
Expand Down
31 changes: 0 additions & 31 deletions sdg/SD-prepare-docmap.cql
Original file line number Diff line number Diff line change
Expand Up @@ -162,31 +162,6 @@ MERGE (reply_action)<-[:participants]-(person:Person {
RETURN COUNT(person) AS `authors linked to replies`;
:commit


// :begin
// // setup for semantic mapping

// CALL n10s.graphconfig.init({handleVocabUris: 'MAP'});
// :commit

// :begin
// CREATE CONSTRAINT n10s_unique_uri IF NOT EXISTS ON (r:Resource)
// ASSERT r.uri IS UNIQUE;
// :commit

// :begin
// // prefixes
// CALL n10s.nsprefixes.add("dct", "http://purl.org/dc/terms/");
// CALL n10s.nsprefixes.add("foaf", "http://xmlns.com/foaf/0.1/");
// CALL n10s.nsprefixes.add("part", "http://www.ontologydesignpatterns.org/cp/owl/participation.owl#");
// CALL n10s.nsprefixes.add("fabio", "http://purl.org/spar/fabio/");
// CALL n10s.nsprefixes.add("pso", "http://purl.org/spar/pso/");
// CALL n10s.nsprefixes.add("pwo", "http://purl.org/spar/pwo/");
// CALL n10s.nsprefixes.add("xsd", "http://www.w3.org/2001/XMLSchema#");
// CALL n10s.nsprefixes.add("prism", "http://prismstandard.org/namespaces/basic/2.0/");
// :commit


// :begin
// // mappings
// WITH [
Expand Down Expand Up @@ -215,12 +190,6 @@ RETURN COUNT(person) AS `authors linked to replies`;
// { internal: "hasUrl", uri: "http://purl.org/spar/fabio/", pub: "hasURL" }
// ] as mappings

// UNWIND mappings as m
// CALL n10s.mapping.add(m.uri + m.pub, m.internal) YIELD schemaElement
// RETURN
// count(schemaElement) AS mappingsDefined;
// :commit

//try
// :POST /rdf/neo4j/cypher
// {"cypher": "MATCH path=(preprint:Preprint)-[:inputs]->(action1:Action)<-[:outputs]-(ref:RefereeReport)-[:inputs]->(actions2:Action)<-[:outputs]-(reply:AuthorReply), (docmap)<-[:actions]-(action_1) RETURN path LIMIT 1", "format": "JSON-LD"}

0 comments on commit df5a070

Please sign in to comment.