- Neo4j
- Docker
$ docker run -i -v $PWD:/app --workdir /app -t cross-talk /bin/bash
docker build -f Dockerfile -t cross-talk .
See neo4j-install instructions
- Create new project
- Under that project create or connect to a new DBMS
- Start DBMS (version 5.7 because at the time of writing this the plugins weren't available in later versionss)
- Install plugins: n10s, Graph Data Science, and APOC.
CREATE CONSTRAINT n10s_unique_uri FOR (r:Resource) REQUIRE r.uri IS UNIQUE;
CALL n10s.graphconfig.init({handleVocabUris: "MAP"});
WITH "https://data.bioontology.org/ontologies/MESH/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb&download_format=rdf"
AS uri
CALL n10s.rdf.import.fetch(uri, 'RDF/XML',{ classLabel : 'MESH_Class'})
YIELD terminationStatus, triplesLoaded, triplesParsed, namespaces, callParams, extraInfo
RETURN terminationStatus, triplesLoaded, triplesParsed, namespaces, callParams, extraInfo;
WITH "https://data.bioontology.org/ontologies/NCIT/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb&download_format=rdf"
AS uri
CALL n10s.rdf.import.fetch(uri, 'RDF/XML',{ classLabel : 'NCIT_Class'})
YIELD terminationStatus, triplesLoaded, triplesParsed, namespaces, callParams, extraInfo
RETURN terminationStatus, triplesLoaded, triplesParsed, namespaces, callParams, extraInfo;
In order to access local files, we need to change some configuration of Neo4J. In the settings, you must add the following with modifications depending on your system (also covered in the neo4j-install.md instructions):
dbms.security.allow_csv_import_from_file_urls=true
server.directories.import=/home/paul/
apoc.import.file.enabled=true
You should replace the import directory to match your system, but all imports will be relative to this directory.
In order to execute things at the command line, you must set some environment variables.
export APPDIR=path to this repo
export DATADIR=path to data directory # e.g. parent of pdfs.biomechanics
export OPENAI_API_KEY=foobar
The next steps are described in:
Example queries are shown in NEO4J_COMMANDS.