No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This repository contains software and tools using and implementing NIF 2.0.

NIF Stanford Implementation

We are currently providing a maven web service for the stanford implementation.

Compile and run

Note: you will need to install Maven

  1. Download and unzip:
  2. go to folder java-maven
  3. run mvn install
  4. go to the folder software/java-maven/implementation/stanfordcorenlp/
  5. run mvn jetty:run

The server will start at port 9999. You can change the port number, for example running at port 8899 you might use -Djetty.port=8899 parameter.

Now you should be able to reach the service under:

curl "http://localhost:9999/stanfordcorenlp/stanfordcorenlpn?f=text&i=This+is+a+test.&t=direct"


The -e option is Maven for extended error messages. The sentences is: My favorite actress is Natalie Portman. You might need to run mvn compile first.

Example (for Windows and Unix)

mvn exec:java -e  -Dexec.mainClass="org.nlp2rdf.implementation.stanfordcorenlp.StanfordCLI" -Dexec.args="-f text -i 'My favorite actress is Natalie Portman.' "

Unix Example from stdin

echo -n `My favorite actress is Natalie Portman.` | mvn compile exec:java -e  -Dexec.mainClass="org.nlp2rdf.implementation.stanfordcorenlp.StanfordCLI" -Dexec.args="-f text -i -"

NIF Validator

An up-to-date validator is supplied at root level in this repository and can be dowloaded here:

Use the Jar

# the file is executable, so you can run either "./validate.jar" or "java -jar validate.jar"
# display help
java -jar validate.jar -h
# validate a turtle file
java -jar validate.jar --input=java-maven/core/jena/src/test/resources/nif-erroneous-model.ttl --informat=turtle  --intype=file
# output in turtle
java -jar validate.jar --input=java-maven/core/jena/src/test/resources/nif-erroneous-model.ttl --informat=turtle --outformat=turtle --intype=file
# short version -i turtle and -o text are default
java -jar validate.jar -i core/jena/src/test/resources/nif-erroneous-model.ttl -t file
java -jar validate.jar -i core/jena/src/test/resources/nif-erroneous-model.ttl -o turtle -t file
# test URLs
java -jar validate.jar -i --intype=url

Start a server with Jetty and Maven

cd java-maven
mvn clean install
cd core/jena
mvn jetty:run 
# -Djetty.port=8899 is default and omitted

Use directly with Maven

# install
cd java-maven
mvn clean install
# run
cd ../implementation/validator
mvn compile exec:java -e  -Dexec.mainClass="org.nlp2rdf.implementation.validator.ValidateCLI" -Dexec.args="-i ../../core/jena/src/test/resources/nif-erroneous-model.ttl -t file -o turtle"
mvn compile exec:java -e  -Dexec.mainClass="org.nlp2rdf.implementation.validator.ValidateCLI" -Dexec.args="-i ../../core/jena/src/test/resources/nif-correct-model.ttl -t file -o turtle"

Build Validator Jar

the jar appears in core/jena/target

cd java-maven/core/jena
mvn clean compile assembly:single

Java-Maven implementation of NIF


We started with an implementation using Jena. We are aware that this is quite a large dependency. Feel free to copy and paste any code into your project and adapt it. We would be happy, if you were to share your code for NIF implementations using other RDF libraries.


Including the maven dependencies allows you to load the ontologies via

String nif_core_ttl = "org/uni-leipzig/persistence/nlp2rdf/nif-core/nif-core.ttl" ;
String nif_core_owl = "org/uni-leipzig/persistence/nlp2rdf/nif-core/nif-core.owl" ;
String testsuiteString = "org/uni-leipzig/persistence/nlp2rdf/testcase/lib/nif-2.0-suite.ttl" ;
// get input stream
InputStream is = SPARQLValidator.class.getClassLoader().getResourceAsStream(testsuite);
// load the test cases into Jena or the RDF library of your choice
OntModel testsuiteModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel());, "", "N3");


    <name>University Leipzig, AKSW Maven2 Repository</name>
    <name>University Leipzig, AKSW Maven2 Repository</name>


Please look here for the latest versions:


Jena Implementation

Please look here for the latest versions:


License headers

For all files are generator by headache

installation and manual

(googleing for help is pointless)

sudo apt-get install headache
firefox /usr/share/doc/headache/manual.html

adding licenses to all files

headache -h header -c headacheconfig java-maven/core/jena/src/main/java/org/nlp2rdf/core/
# all files
for i in  `find . -type f` ; do headache -h header -c headacheconfig $i ; done

#PHP There isn't much implemented, yet.