Giter VIP home page Giter VIP logo

nasa-jpl-cord-19 / covid19-knowledge-graph Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 3.0 28 KB

Builds a knowledge graph from the [COVID-19 Open Research Dataset (CORD-19)](https://pages.semanticscholar.org/coronavirus-research) dataset.

License: Apache License 2.0

Scala 100.00%
covid-19 covid19 covid-virus covid19-data covid-2019 covid knowledge-graph knowledgebase knowledge-representation jena

covid19-knowledge-graph's People

Contributors

lewismc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

covid19-knowledge-graph's Issues

Destination file processing in for loop?

@lewismc Continuing from #1

Looks like you fixed the output problem, but introduced a new problem by putting the opening of the destination file within the for loop.

files foreach { file =>
println(s" loading ${file.getCanonicalPath}")
val graph = new File("covid19_knowledge_graph.ttl")
graph.createNewFile()
val model = RDFDataMgr.loadModel("covid19_knowledge_graph.ttl")

[error] (run-main-0) java.util.NoSuchElementException: head of empty array

I tried both of patterns to run the program but I got failed the running.
I would like some advice if you know any solution.

What I did is as below:

  • From sbt

    • command
      sbt:covid19_knowledge_graph> run /home/taroaso/covid19-knowledge-graph/data/CORD-19_files/comm_use_subset /home/taroaso/covid19-knowledge-graph/data/annie_extraction_files
    • result
      [info] running gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph /home/taroaso/covid19-knowledge-graph/data/CORD-19_files/comm_use_subset /home/taroaso/covid19-knowledge-graph/data/annie_extraction_files
      loading
      [error] (run-main-0) java.util.NoSuchElementException: head of empty array
      [error] java.util.NoSuchElementException: head of empty array
      [error] at scala.collection.ArrayOps$.head$extension(ArrayOps.scala:222)
      [error] at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph$.loadAFileJSON(covid19_knowledge_graph.scala:76)
      [error] at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph$.$anonfun$main$3(covid19_knowledge_graph.scala:39)
      [error] at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph$.$anonfun$main$3$adapted(covid19_knowledge_graph.scala:38)
      [error] at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
      [error] at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph$.main(covid19_knowledge_graph.scala:38)
      [error] at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph$.main(covid19_knowledge_graph.scala:16)
      [error] at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph.main(covid19_knowledge_graph.scala)
      [error] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [error] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [error] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [error] at java.lang.reflect.Method.invoke(Method.java:498)
      [error] stack trace is suppressed; run last Compile / bgRun for the full output
      [error] Nonzero exit code: 1
      [error] (Compile / run) Nonzero exit code: 1
  • As a standalone JAR

    • command
      java -jar ./target/scala-2.13/covid19_knowledge_graph-assembly-0.1.0-SNAPSHOT.jar '/home/taroaso/covid19-knowledge-graph/data/CORD-19_files/comm_use_subset' '/home/taroaso/covid19-knowledge-graph/data/annie_extraction_files'
    • result
      loading
      Exception in thread "main" java.util.NoSuchElementException: head of empty array
      at scala.collection.ArrayOps$.head$extension(ArrayOps.scala:222)
      at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph$.loadAFileJSON(covid19_knowledge_graph.scala:76)
      at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph$.$anonfun$main$3(covid19_knowledge_graph.scala:39)
      at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph$.$anonfun$main$3$adapted(covid19_knowledge_graph.scala:38)
      at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
      at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph$.main(covid19_knowledge_graph.scala:38)
      at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph$.main(covid19_knowledge_graph.scala:16)
      at gov.nasa.jpl.covid19_knowledge_graph.covid19_knowledge_graph.main(covid19_knowledge_graph.scala)

Running outside of the sbt REPL

In the README.md file you give the following instructions to process the input json files.

## Running

Launch sbt:

    $ sbt

Run the program with an argument indicating the input `data` directory containing the dataset:

    > run path/to/data/containing/Commercial use subset json files

This is not conducive to running in an automated pipeline, is there any way we can get an assembly build task so that processing can be run like

$ java -jar covid19-knowledge-graph.jar path/to/data/containing/commercial_use_subset_json_files

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.