Skip to content

Commit

Permalink
All Spans that are translated into nodes inside the RDF graph additio…
Browse files Browse the repository at this point in the history
…nally get the type nif:Phrase.
  • Loading branch information
MichaelRoeder committed Feb 17, 2016
1 parent 1b11a41 commit f52a724
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.aksw</groupId>
<artifactId>gerbil.nif.transfer</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1</version>
<name>NIF transfer library for the General Entity Annotator Benchmark</name>
<description>This project contains classes for transferring documents using NIF.</description>

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/aksw/gerbil/io/nif/AnnotationWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public void addSpan(Model nifModel, Resource documentAsResource, String text, St

String spanUri = NIFUriHelper.getNifUri(documentURI, start, end);
Resource spanAsResource = nifModel.createResource(spanUri);
nifModel.add(spanAsResource, RDF.type, NIF.Phrase);
nifModel.add(spanAsResource, RDF.type, NIF.String);
nifModel.add(spanAsResource, RDF.type, NIF.RFC5147String);
// TODO add language to String
Expand Down
60 changes: 30 additions & 30 deletions src/main/java/org/aksw/gerbil/io/nif/impl/TurtleNIFWriter.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
/**
* This file is part of NIF transfer library for the General Entity Annotator Benchmark.
*
* NIF transfer library for the General Entity Annotator Benchmark is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NIF transfer library for the General Entity Annotator Benchmark is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with NIF transfer library for the General Entity Annotator Benchmark. If not, see <http://www.gnu.org/licenses/>.
*/
package org.aksw.gerbil.io.nif.impl;

import org.aksw.gerbil.io.nif.AbstractNIFWriter;

public class TurtleNIFWriter extends AbstractNIFWriter {

private static final String HTTP_CONTENT_TYPE = "application/x-turtle";
private static final String LANGUAGE = "TTL";

public TurtleNIFWriter() {
super(HTTP_CONTENT_TYPE, LANGUAGE);
}

}
/**
* This file is part of NIF transfer library for the General Entity Annotator Benchmark.
*
* NIF transfer library for the General Entity Annotator Benchmark is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NIF transfer library for the General Entity Annotator Benchmark is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with NIF transfer library for the General Entity Annotator Benchmark. If not, see <http://www.gnu.org/licenses/>.
*/
package org.aksw.gerbil.io.nif.impl;

import org.aksw.gerbil.io.nif.AbstractNIFWriter;

public class TurtleNIFWriter extends AbstractNIFWriter {

private static final String HTTP_CONTENT_TYPE = "application/x-turtle";
private static final String LANGUAGE = "TTL";

public TurtleNIFWriter() {
super(HTTP_CONTENT_TYPE, LANGUAGE);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected static final Property property(String local) {

public static final Resource Annotation = resource("Annotation");
public static final Resource Context = resource("Context");
public static final Resource Phrase = resource("Phrase");
public static final Resource String = resource("String");
public static final Resource RFC5147String = resource("RFC5147String");

Expand Down

0 comments on commit f52a724

Please sign in to comment.